Skip to main content
CalcChef

URL Encoder/Decoder

Percent-encode or decode text as you type: one value with encodeURIComponent or a whole URL with encodeURI, and an option to read + as a space. How it works

Use the URL Encoder/Decoder

Encode as

About the URL Encoder/Decoder

Percent-encoding writes each unsafe byte as % and two hex digits: a space is %20 and é is %C3%A9. This tool has two encode settings. A value or path part (encodeURIComponent) escapes everything except A-Z a-z 0-9 - _ . ~ ! ' ( ) *. A whole URL (encodeURI) also keeps ; , / ? : @ & = + $ # so the link still works.

How each character is encoded

CharacterAs a value or path partIn a whole URL
Space%20%20
!!!
#%23#
$%24$
%%25%25
&%26&
'''
(((
)))
***
+%2B+
,%2C,
/%2F/
:%3A:
;%3B;
=%3D=
?%3F?
@%40@
[%5B%5B
]%5D%5D
~~~
é (e acute)%C3%A9%C3%A9
€ (euro sign)%E2%82%AC%E2%82%AC

What the tool outputs for each single character. Non-ASCII characters are written as their UTF-8 bytes. A space is always %20, never +.

How to use this tool

  1. Choose Encode or Decode.
  2. To encode, choose A value or path part for one parameter, or A whole URL for a complete link.
  3. To decode form data, tick Read + as a space.
  4. Type or paste the text. The output updates as you type; press the copy button to copy it.

Frequently asked questions

Should I use encodeURIComponent or encodeURI?
Use encodeURIComponent, the value setting, for one query value or path segment, and encodeURI, the whole-URL setting, for a complete link. Encoding https://example.com/a?b=c&d=e f as a value gives https%3A%2F%2Fexample.com%2Fa%3Fb%3Dc%26d%3De%20f, which no longer works as a link. As a whole URL it gives https://example.com/a?b=c&d=e%20f.
Is a space %20 or +?
The encoder always writes %20. A + stands for a space only in form data (application/x-www-form-urlencoded), so when you decode form data, tick Read + as a space: a+b%20c decodes to a b c, and to a+b c without the tick.
Why does decoding give an error?
A % must be followed by two hex digits that complete a valid UTF-8 sequence. %E0%A4%A is cut short and gives a message with an empty output, while %C3%A9 decodes to é. The output never keeps an older result.
Why does encoding twice turn %20 into %2520?
Both settings escape the % sign itself as %25, so an already-encoded %20 becomes %2520. Encode raw text once, or decode first.
Does it handle accents, euro signs and emoji?
Yes, as UTF-8 bytes: é is %C3%A9, € is %E2%82%AC and 😀 is %F0%9F%98%80. A lone half of an emoji cannot be encoded and gets a message.

Related Tools

View all tools