CalcMint

URL Encoder and Decoder

Turn text into a safe URL component, or decode a messy link full of %20 and %E2%9C%93 back into readable text.

URL encoder / decoder

Output

Add this calculator to your website

Copy the code and paste it into your page's HTML. It's free; please keep the credit link.

What percent-encoding does

A URL may only contain a limited set of ASCII characters (RFC 3986). Everything else, including spaces, non-English letters and characters that have a meaning in URLs such as & and #, is written as % followed by the two hex digits of each UTF-8 byte.

Encode each piece separately: the path segments and every query value. Encoding a finished URL with the component option turns its :// and ? into %3A%2F%2F and %3F and breaks it, and encoding twice turns % into %25, which is why you sometimes see %2520 instead of a space.

Common percent-encodings

CharacterEncodedCharacterEncoded
(space)%20!%21
"%22#%23
$%24%%25
&%26'%27
+%2B,%2C
/%2F:%3A
;%3B=%3D
?%3F@%40

Frequently asked questions

Should a space be %20 or +?

%20 works everywhere in a URL. + means a space only in query strings sent as HTML form data (application/x-www-form-urlencoded). Pick the form option when building those, and tick “Treat + as a space” when decoding them.

What's the difference between encodeURI and encodeURIComponent?

encodeURI is for a whole URL and leaves characters like : / ? & = alone. encodeURIComponent is for one piece, such as a query value, and encodes those characters too, so a value containing & doesn't break the URL.

Why do non-English letters become several %XX codes?

URLs are encoded as UTF-8 bytes. é is two bytes (%C3%A9), most Japanese characters three and emoji four.

Is what I paste sent to a server?

No. This tool runs entirely in your browser with JavaScript and the built-in Web Crypto API. Nothing you type, paste or open is uploaded or stored.

Related calculators