URL Encode / Decode

Encode or decode URL components.

...

Why URLs Need Encoding

A URL can only contain a limited set of ASCII characters. Everything else — spaces, umlauts, emoji, and characters that have special meaning like &, = and ? — must be percent-encoded: each byte of the character's UTF-8 representation becomes % followed by two hex digits. Skip this step and a search query like coffee & cream silently breaks your query string: the & starts a new parameter and half your value vanishes.

This tool uses encodeURIComponent, the strict variant meant for individual URL parts. coffee & cream becomes coffee%20%26%20cream, and decoding reverses it exactly.

Common Characters and Their Encodings

CharacterEncodedWhy it matters in a URL
space%20Spaces terminate the URL in many contexts
&%26Separates query parameters
=%3DSeparates parameter name and value
?%3FStarts the query string
#%23Starts the fragment — everything after is dropped from requests
/%2FPath segment separator
+%2BDecoded as a space in form data if left raw
ü%C3%BCNon-ASCII — two bytes in UTF-8, two %-sequences

encodeURI vs. encodeURIComponent

JavaScript ships two encoders, and mixing them up is a classic bug. encodeURI is for a complete URL: it leaves :, /, ?, # and & alone so the URL structure survives. encodeURIComponent — what this tool uses — is for a single value inside a URL and encodes all of those. Rule of thumb: building a query parameter? Always encodeURIComponent. Encoding a whole URL someone typed? encodeURI. If you encode a full URL with the component variant, the https%3A%2F%2F at the front tells you what went wrong.

Pitfalls Worth Knowing

  • Double encoding: encoding twice turns %20 into %2520. If you see %25 sequences in the wild, something encoded already-encoded text.
  • Decoding invalid input: a stray % not followed by two hex digits (like 100% legit) fails to decode — the tool reports it instead of guessing.
  • + is not always a space: only in application/x-www-form-urlencoded form data. decodeURIComponent correctly leaves + as +.

Everything runs entirely in your browser — no URL you paste is ever sent to a server. Related tools: escape text for markup with the HTML encoder, or build clean URL paths with the slug generator.

Frequently Asked Questions

What characters get URL-encoded?
Everything except letters, digits, and - _ . ~ is converted to %-sequences: space becomes %20, & becomes %26, and non-ASCII characters become one %-sequence per UTF-8 byte (ü → %C3%BC).
What is the difference between encodeURI and encodeURIComponent?
encodeURI encodes a full URL and preserves structural characters like :, /, ?, #. encodeURIComponent (used by this tool) encodes a single value and escapes those too. Use the component variant for query parameters.
Why does %20 sometimes appear as + instead?
HTML form submissions (application/x-www-form-urlencoded) historically encode spaces as +. Percent-encoding proper uses %20. Both mean "space" in query strings, but %20 is the safe, universal choice.
What is double encoding?
Running already-encoded text through the encoder again: %20 becomes %2520 because the % itself gets encoded. It is a common bug when multiple layers of a system each encode. Encode exactly once, at the last moment.
Why does decoding my string fail?
A % that is not followed by two hex digits is malformed percent-encoding — "100% legit" cannot be decoded. Fix or encode the raw % as %25 first.