URL Encoder
Percent-encode text for URLs: a single component, a full URL, or form data. Unicode is encoded as UTF-8.
URL Encoder: the tool
Input
Encoded
The result appears here.How to use URL Encoder
- Paste the text or URL to encode.
- Pick the mode. Component encodes everything except letters, digits and - _ . ! ~ * ' ( ), which is right for a single query value or path segment.
- Pick Full URL to keep the structure of a complete address (: / ? # & =) and only encode what would break it.
- Pick Form data for application/x-www-form-urlencoded, where a space becomes + and more symbols are encoded.
Example
The same address encoded as a component and as form data. Notice the space: %20 in the first, + in the second.
https://example.com/search?q=café & crème&lang=fr
https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dcaf%C3%A9%20%26%20cr%C3%A8me%26lang%3Dfr
https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dcaf%C3%A9+%26+cr%C3%A8me%26lang%3Dfr
About this tool
A URL can only contain a limited set of ASCII characters. Everything else, including spaces, accents and symbols that have a special meaning in the address, is written as a percent sign followed by the byte value in hexadecimal: a space is %20 and é is %C3%A9, because é takes two bytes in UTF-8.
The mode matters. Encoding a whole URL as a component also encodes the :, / and ? that make it a URL, producing a string that no longer works as an address. Encoding a query value in Full URL mode leaves & and = alone, which can silently split one value in two. The three modes follow encodeURIComponent, encodeURI and the form encoding of the WHATWG URL standard.
Everything is converted in your browser, so URLs that contain tokens or internal host names stay on your device.
Which mode to use
| Mode | Same as | Leaves unencoded | Use it for |
|---|---|---|---|
| Component | encodeURIComponent() | A-Z a-z 0-9 - _ . ! ~ * ' ( ) | One query value, path segment or fragment |
| Full URL | encodeURI() | Component set plus ; , / ? : @ & = + $ # | A complete URL that may contain spaces or accents |
| Form data | URLSearchParams | A-Z a-z 0-9 * - . _ | Request bodies and query strings built by HTML forms |
Frequently asked questions
What is the difference between encodeURI and encodeURIComponent?
encodeURIComponent encodes everything that is not a letter, digit or one of - _ . ! ~ * ' ( ), so it is meant for individual values. encodeURI leaves the characters that structure a URL alone, so it is meant for a whole address.
Should a space be %20 or +?
In a path, always %20. In a query string both are understood by servers, but + only means a space in form encoding. When in doubt, use %20, which is valid everywhere.
Why is é encoded as %C3%A9?
Percent-encoding works on bytes, and é is the two bytes C3 A9 in UTF-8. This is the encoding every modern browser and server expects.
Why does encoding fail on some text?
A string containing an unpaired surrogate (half of an emoji, for example) has no UTF-8 representation. The error shows its position so you can remove it.
Do I need to encode a URL twice?
No. Encoding twice turns % into %25 and produces values like %2520 that servers decode to the wrong text. Encode each value once, when you build the URL.
More developer tools
- %20URL DecoderDecode percent-encoded URLs and query strings back to readable text, with exact errors for malformed sequences.
- b64Base64 EncoderEncode text to Base64 in your browser. Handles Unicode, the URL-safe alphabet and MIME line wrapping.
- &;HTML EncoderEscape text for safe use in HTML: <, >, &, quotes and, if you want, every non-ASCII character.
- a-bSlug GeneratorTurn titles into clean URL slugs. Accents are removed, Cyrillic and Greek are transliterated, and you control the separator and length.