What is URL encoding?
URLs may only contain a limited set of characters. Everything else (spaces, accents, emoji, and characters with a
special meaning like & or ?) is written as % plus two hex digits for each UTF-8 byte. A space becomes %20, and
é becomes %C3%A9. This is also called percent-encoding.
How to use it
- Pick Encode or Decode and type or paste. The result updates as you type.
- Choose Part of a URL for one value (a search term, a path segment) or Whole URL for a complete address.
- Turn on Spaces as + for HTML form data. Swap sends the result back into the input.
Part of a URL or whole URL?
| Option | Keeps | Use for | JavaScript |
|---|---|---|---|
| Part of a URL | Letters, digits, - _ . ! ~ * ' ( ) | One query value or path segment, e.g. a search term | encodeURIComponent |
| Whole URL | Also : / ? # [ ] @ & = + $ , | A complete address that should still work as a link | encodeURI |
Spaces as + follows the HTML form format, where a space is written as +. When decoding, it turns + back into
spaces.
Example
café & crème
caf%C3%A9%20%26%20cr%C3%A8me
Common errors
- “%of” isn't a valid escape: a
%must be followed by two hex digits. A literal percent sign is written%25. - The bytes “%E9” aren't valid UTF-8: the text was encoded in an old encoding like Latin-1, where
éwas one byte. Today's URLs use UTF-8, whereéis%C3%A9.
FAQ
Why didn't “Whole URL” decode %2F?
In whole-URL mode, escapes for characters that have a meaning in URLs (like / as %2F or & as %26) are kept, so
the URL's structure doesn't change. Use Part of a URL to decode everything.
Is my text uploaded?
No. Encoding and decoding happen in your browser. See the privacy page.