Skip to content
SUMILORASUMILORA

URL encoder and decoder

Developer tools

Paste a URL or a parameter value. Choose whether you are encoding a whole URL or a single component — they are different jobs.

Runs in your browser

Nothing is uploaded. The work happens on your own device, so your file or text never reaches us.

About this tool

Component or whole URL

The distinction matters and getting it wrong breaks links.

Component (encodeURIComponent) escapes everything that is not safe in a value, including /, ?, &, = and :. Use it for one query parameter or one path segment — anything whose content might contain those characters.

Full URL (encodeURI) leaves the structural characters alone, so the URL still works as a URL. Use it when you have a complete address with spaces or accented characters in it.

Encoding a whole URL as a component turns https://x.com/a?b=c into an unusable string. Encoding a parameter as a full URL leaves an ampersand in the value, which silently splits it into two parameters — the quieter and worse of the two failures.

The plus sign

In a query string, + has historically meant a space. In a path it does not — it is a literal plus.

So decoding is ambiguous without knowing which part of the URL you have. This decoder treats + as a space only when the input looks like a query string, and leaves it alone otherwise. To be unambiguous, encode a literal plus as %2B.

Questions

What is %20?

A space. 20 is the hexadecimal code for the space character, and percent-encoding writes any byte as % followed by its two hex digits.

Should I use encodeURI or encodeURIComponent?

encodeURIComponent for a single parameter or path segment; encodeURI for a whole URL. Using the wrong one either breaks the URL or lets an ampersand split your value in two.

Related tools