Skip to content
codinganthem
All tools/Web/URL Encoder / Decoder

URL Encoder / Decoder

Encode and decode URLs and query string parameters online, instantly. Supports value encoding, full URL encoding, and decoding — free tool.

encodeURIComponent — encodes / : ? & for query param values

More
Buy me a coffee

What URL encoding does

URLs can only contain a limited set of characters. Anything else is percent-encoded: each byte becomes % followed by two hex digits. A space becomes %20, and é (two bytes in UTF-8) becomes %C3%A9. Letters, digits and - . _ ~ never need encoding.

Characters like / ? # & = have a structural meaning, so whether to encode them depends on where the text goes. That's why the tool has two encode modes.

Which mode to use

  • Encode value: encodes everything except letters, digits and - . _ ~, including / : ? & =. Use it for a single query parameter value or path segment. It matches JavaScript's encodeURIComponent.
  • Encode URL: keeps the URL's structure (/ : ? & = #) and encodes only characters that can't appear in a URL, like spaces. Use it for a whole URL. It matches encodeURI.
  • Decode: turns percent-encoded text back into readable text.

Example

Value:   rock & roll / 2026
Encoded: rock%20%26%20roll%20%2F%202026

https://example.com/search?q=rock%20%26%20roll

If you encoded the value with Encode URL instead, the & would stay as is and the server would read roll as the start of a new parameter.

%20 or + for spaces?

Both appear in the wild. %20 is correct everywhere in a URL. + means a space only in query strings sent as HTML form data (application/x-www-form-urlencoded); in a path it's a literal plus sign. When in doubt, use %20.

Spotting double encoding

If you see %2520 in a URL, something encoded an already-encoded string: %20 became %2520. Decode once to check, and make sure each layer of your code encodes only raw values. To inspect each part of a URL, use the URL Parser.

Frequently asked questions

What's the difference between encodeURI and encodeURIComponent?+

encodeURIComponent encodes everything except letters, digits and - . _ ~, so it's for a single value. encodeURI leaves URL structure characters such as / ? & = # alone, so it's for a whole URL. This tool's Encode value and Encode URL modes match them.

Should spaces be %20 or +?+

%20 is valid anywhere in a URL. + means a space only in form-encoded query strings; in a URL path it's a literal plus.

What does %2520 mean?+

It's a double-encoded space: %20 was encoded again, turning % into %25. Decode once and fix the code that encodes twice.

Which characters never need encoding?+

Letters A–Z and a–z, digits 0–9, and the four symbols - . _ ~ are unreserved and never need percent-encoding.