URL Encoder & Decoder
Encode or decode URLs and query strings with percent-encoding. Choose component or full-URL encoding, pick %20 or + for spaces, and see every query parameter split out with its encoded form.
Written by Suhaib Hassan. Figures are estimates you can edit. Our methodology.
It uses the browser's own encodeURIComponent, encodeURI and decodeURIComponent, with options for strict escaping and form-style spaces.
Broken links are often an encoding problem. This shows what changed and which parts of a URL are affected.
—
| Key | Value | Encoded |
|---|
Which characters get percent-encoded
Percent-encoding writes a character as % followed by the hexadecimal value of each of its UTF-8 bytes. encodeURI() keeps characters that structure a URL. encodeURIComponent() encodes them, which is what you want for a single query value.
| Character | Percent form | RFC 3986 class | encodeURI | encodeURIComponent |
|---|---|---|---|---|
space | %20 | Not allowed | %20 | %20 |
! | %21 | Sub-delim | Kept | Kept |
" | %22 | Not allowed | %22 | %22 |
# | %23 | Gen-delim | Kept | %23 |
$ | %24 | Sub-delim | Kept | %24 |
% | %25 | Not allowed | %25 | %25 |
& | %26 | Sub-delim | Kept | %26 |
' | %27 | Sub-delim | Kept | Kept |
( | %28 | Sub-delim | Kept | Kept |
) | %29 | Sub-delim | Kept | Kept |
* | %2A | Sub-delim | Kept | Kept |
+ | %2B | Sub-delim | Kept | %2B |
, | %2C | Sub-delim | Kept | %2C |
/ | %2F | Gen-delim | Kept | %2F |
: | %3A | Gen-delim | Kept | %3A |
; | %3B | Sub-delim | Kept | %3B |
< | %3C | Not allowed | %3C | %3C |
= | %3D | Sub-delim | Kept | %3D |
> | %3E | Not allowed | %3E | %3E |
? | %3F | Gen-delim | Kept | %3F |
@ | %40 | Gen-delim | Kept | %40 |
[ | %5B | Gen-delim | %5B | %5B |
\ | %5C | Not allowed | %5C | %5C |
] | %5D | Gen-delim | %5D | %5D |
^ | %5E | Not allowed | %5E | %5E |
` | %60 | Not allowed | %60 | %60 |
{ | %7B | Not allowed | %7B | %7B |
| | %7C | Not allowed | %7C | %7C |
} | %7D | Not allowed | %7D | %7D |
~ | %7E | Unreserved | Kept | Kept |
³ | %C2%B3 | Unreserved | %C2%B3 | %C2%B3 |
Formulas
How the numbers are worked out.
Percent-encoding
Each byte of the character's UTF-8 form becomes a percent sign and two hexadecimal digits.
%C2%B3 = ³ (two UTF-8 bytes)
space = %20Component or full URL
Encode a single value with the component option. Encode a whole address with the full URL option so : / ? & = # stay as they are.
encodeURIComponent(value)
encodeURI(url)Decoding
Each %XX sequence is turned back into its byte, and bytes are read as UTF-8.
decodeURIComponent(text)Worked examples
Illustrative figures, each checked by hand. The first is the default setup.
A query value
Encode the component "gas leak & m³/hr".
result: gas%20leak%20%26%20m%C2%B3%2Fhr
A full URL
Encode "https://example.com/a b?x=1".
Decode
Decode "caf%C3%A9%20menu".
How to encode or decode a URL
- Choose Encode a component, Encode a full URL or Decode.
- Paste your text. Use the examples to see typical cases.
- Copy the result, or use it as the next input to round-trip.
- Check the table for each query parameter.
Encoding turns text into a safe form for URLs. It is not encryption and hides nothing. Never put secrets in a URL.
By Suhaib Hassan · Reviewed 29 September 2026 · How CalculatePilot verifies formulas →
Sources
- IETF, RFC 3986, Uniform Resource Identifier (URI): Generic Syntax (2005).
- WHATWG, URL Standard, percent-encoding.
- MDN Web Docs, encodeURIComponent() and encodeURI().
Frequently asked questions
What is the difference between encodeURI and encodeURIComponent?
encodeURI keeps characters such as : / ? & = # so a whole address still works. encodeURIComponent encodes them, so use it for a single value inside a URL.
When should a space be %20 and when +?
%20 is correct everywhere in a URL. A + means a space only in HTML form data (application/x-www-form-urlencoded), such as query strings from forms.
Why does ³ become %C2%B3?
Non-ASCII characters are first turned into UTF-8 bytes, and each byte is written in hex. ³ is the two bytes C2 and B3.
Why does decoding fail with a malformed error?
A % must be followed by two hexadecimal digits, and the bytes must form valid UTF-8. A stray % or truncated sequence causes this.
Is this data sent anywhere?
No. Everything runs in your browser.
Related calculators
More everyday tools.