“café au lait” cannot appear in an address as it is. It becomes caf%C3%A9%20au%20lait: each unsafe byte is written as a percent sign and two hex digits.
Two scopes, two results
The URL Encoder/Decoder offers component and full-URL scope. Take https://example.com/a b?q=café&x=1:
- Component encodes everything that is not safe in a single value, including the structure characters:
https%3A%2F%2Fexample.com%2Fa%20b%3Fq%3Dcaf%C3%A9%26x%3D1. Use this for a query value or a piece you are inserting into a URL. - Full URL leaves the structure alone and encodes only what must change:
https://example.com/a%20b?q=caf%C3%A9&x=1. Use this for a complete address.
The key difference: component mode also encodes the characters : / ? & =. If you component-encode a whole URL and use it as a link, it will not work. If you want to put a URL inside another URL, as in a redirect parameter, component encoding is right.
Decoding
Choose decode and paste caf%C3%A9%20au%20lait to get “café au lait”. If the text has a stray percent sign not followed by two hex digits, the tool tells you the encoding is not valid.
Using the tool
- Choose encode or decode.
- Choose component or full.
- Paste your text and copy the result.
Common mistakes
- Encoding twice, which turns
%20into%2520. - Using full mode on a value that contains an ampersand, which leaves the ampersand unescaped and splits your parameter.
- Assuming a plus sign means a space. That is true only in form-encoded query strings, and not in paths.
For the underlying idea, see the component vs full comparison.
Frequently asked questions
Why are accented letters turned into several codes?
Each character is first converted to UTF-8 bytes, and every byte is written as its own percent code. The letter é is two bytes, so it becomes %C3%A9.