How to use the URL encoder and decoder
- Paste text into Text. The default is a sample search URL with accents and spaces.
- Choose Mode: Encode or Decode.
- Choose Scope: Component (encodeURIComponent) or Full URL (encodeURI).
- Tick Spaces as + (form encoding) if you need form-style spaces.
- Copy the Encoded or Decoded result.
What it does and when to use it
URLs may only contain a limited set of ASCII characters. Everything else, from spaces and & to é and emoji, must be written as % followed by hex bytes. Use this tool when you build a link by hand, debug a redirect that loses part of its query string, read an encoded value from a server log, or check what your code should produce.
To build a full query string from key–value pairs, use the query string builder, or turn a JSON object into one with JSON to query string. To split a URL into protocol, host, path and parameters, use the URL parser.
How it works
Text is converted to UTF-8 bytes, and each byte outside the allowed set is written as %XX, as described in RFC 3986. The tool calls JavaScript’s built-in functions in your browser:
- Component uses
encodeURIComponentanddecodeURIComponent. Reserved characters such as/ ? & = #are escaped too. - Full URL uses
encodeURIanddecodeURI. Reserved characters are kept, and when decoding, escapes such as%2Fand%26stay as they are. - Spaces as + swaps
%20for+after encoding, and swaps+for a space before decoding.
Worked examples
Component mode on a value with reserved characters, a b&c=d/é:
a%20b%26c%3Dd%2F%C3%A9
é becomes two bytes, %C3%A9, because UTF-8 uses two bytes for it.
Full URL mode on the default sample shows the classic trap:
Input: https://example.com/search?q=café & crème&page=2
Output: https://example.com/search?q=caf%C3%A9%20&%20cr%C3%A8me&page=2
The & inside the search term is left as is, so a server reads q=café and a stray parameter crème. Encode the value café & crème in Component mode instead, which gives caf%C3%A9%20%26%20cr%C3%A8me.
Decoding form data with Spaces as + ticked, caf%C3%A9+au+lait gives café au lait.
Limits and tips
- Encode once. Running encoded text through again turns
%20into%2520. If you see%25in a URL, something encoded twice. - No validation. The tool does not check that a URL is well formed or that its host exists.
- Decoding can change meaning. Decoding a whole URL in Component mode turns
%26into a real&, which splits the value.
Frequently asked questions
Which mode should I use?
Why does Full URL mode leave & and = alone?
Should spaces be %20 or +?
Why are ' ( ) ! * not encoded?
What does "broken percent-escape" mean?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.