Home › URL Encoder / Decoder

URL Encoder / Decoder

Percent-encode text so it is safe to drop into a URL, or decode an encoded string back to plain text. Everything runs locally in your browser — your data is never uploaded.

Advertisement
Mode:

All encoding and decoding happens on your device using the browser's built-in encodeURIComponent, encodeURI, decodeURIComponent and decodeURI functions. No network calls are made.

What is URL encoding (percent-encoding)?

URLs may only contain a limited set of characters. Letters, digits, and a handful of symbols are allowed directly, but spaces, accented letters, and reserved characters such as ?, &, =, # and / can change how a URL is parsed — or break it entirely. URL encoding, also called percent-encoding, replaces each unsafe byte with a percent sign followed by its two-digit hexadecimal value. For example, a space becomes %20 and an ampersand becomes %26. Non-ASCII characters are first converted to their UTF-8 bytes, so é becomes %C3%A9. URL decoding reverses this, turning the %xx sequences back into the original text.

How to use it

1. Pick a mode: choose Component when you are encoding a single value such as a query-parameter value or a path segment, or Full URL when you are encoding an entire address. 2. Type or paste your text into the box above. 3. Click Encode to percent-encode it, or Decode to convert an encoded string back to plain text. 4. Click Copy to grab the result, or Sample to load an example.

encodeURIComponent vs encodeURI — which mode?

encodeURIComponent (the Component mode, and the right default for most jobs) escapes every reserved character, including &, =, ?, / and #. Use it for individual pieces of a URL — a query-string value, a single path segment, or a fragment — so that special characters inside the value are not mistaken for URL structure.

encodeURI (the Full URL mode) is meant for an entire URL that is already assembled. It leaves characters that have a structural meaning — such as :, /, ?, &, = and # — untouched, while still escaping spaces and other clearly-unsafe characters. Reach for it only when you have a complete URL you want to clean up without disturbing its delimiters.

CharacterComponent (encodeURIComponent)Full URL (encodeURI)
space%20%20
&%26& (kept)
=%3D= (kept)
/%2F/ (kept)
?%3F? (kept)

Why does decoding sometimes fail?

Decoding throws an error when the input is not valid percent-encoding — for instance a lone %, or a % followed by characters that are not two hexadecimal digits (such as %zz or a truncated %2). When that happens this tool shows a clear message instead of returning broken text, so you can fix the malformed sequence and try again.

Is my data safe?

Yes. This encoder and decoder runs entirely in your browser using its built-in encoding functions. Nothing you type or paste is ever sent to a server, logged, or stored.