URL Encoder / Decoder
Percent-encode text for URLs, or decode it back.
About URL Encoder / Decoder
A URL encoder and decoder that percent-encodes text for use in query strings and paths, or decodes %XX sequences back to readable text, as you type.
How to use
- Choose a mode: Component for a single value, Full URL to keep a whole address navigable, or Form for the plus-for-space format HTML forms submit. Then choose Encode or Decode.
- Type or paste into the left pane. The result appears on the right as you type, with a Copy button.
- Press the swap button on the result to feed it back in as input with the direction reversed, which is a quick way to check a round trip.
What it supports
- Component uses
encodeURIComponent: every character exceptA–Z a–z 0–9 - _ . ! ~ * ' ( )becomes%XX, where XX is the UTF-8 byte in hex. Non-ASCII characters produce more than one escape, for exampleébecomes%C3%A9./,?,=,&and:are all encoded, so paste a single value, not a whole URL. - Full URL uses
encodeURI, which leaves: / ? # & = @ + $ , ;alone so the address keeps its structure. - Form is
application/x-www-form-urlencoded: a space becomes+and!'()~are escaped as well; decoding turns+back into a space. - Decoding shows an error if a
%is not followed by two hex digits or the bytes are not valid UTF-8. Encoding fails only for text containing a lone surrogate. - Not supported: punycode for international domain names.
Example
q=hello world&lang=en
→ q%3Dhello%20world%26lang%3Den
Privacy
Conversion runs in the page. No request is made, and nothing is stored.
Frequently asked questions
- What is the difference between %20 and + for a space in a URL?
- %20 is the percent-encoding of a space and is valid anywhere in a URL. + means a space only in application/x-www-form-urlencoded query strings, the format HTML forms submit; in a path it is a literal plus sign. Component and Full URL modes produce %20; Form mode produces +.
- What is the difference between encodeURI and encodeURIComponent?
- encodeURIComponent encodes everything except unreserved characters, including / ? = & and :, so it is for a single value. encodeURI leaves those separators alone so a whole URL stays navigable. Component mode uses encodeURIComponent; Full URL mode uses encodeURI.
- Why does decoding say the input is not valid percent-encoding?
- Every % in encoded text must be followed by exactly two hexadecimal digits, and the resulting bytes must form valid UTF-8. A stray % (as in "100%") or a truncated sequence such as %C3 on its own causes the error.