Free Converter

URL Encoder / Decoder

Encode and decode URLs and URI components instantly in your browser. Free, private, and no upload required.

Or

About URL Encoding and Decoding

URL encoding (formally percent-encoding, defined in RFC 3986) translates characters that have special meaning in URLs — spaces, slashes, ampersands, hash marks — into a safe form using percent signs followed by hex digits. The space character becomes %20 (or + in form-encoded contexts), the ampersand becomes %26, and so on. Without this encoding, special characters would be interpreted as URL syntax rather than as literal data, breaking the URL or causing unintended behavior.

Two related but distinct encodings exist. The standard URL component encoding uses %-escapes for everything outside the unreserved character set: A-Z, a-z, 0-9, hyphen, underscore, period, tilde. The form-encoded variant (application/x-www-form-urlencoded) additionally treats spaces as plus signs and uses different rules for some other characters. JavaScript's encodeURIComponent uses the strict component encoding; encodeURI uses a more permissive form that preserves URL structure characters.

This tool offers both encoding and decoding. Encode mode wraps each character that requires escaping in %HH format; decode mode reverses the transformation. Both run entirely in your browser using built-in JavaScript URL functions, so no data is sent anywhere.

Why Encode or Decode URLs

Any time data is included in a URL — query string parameters, path segments containing user input, redirect targets — proper encoding is required. Failing to encode produces URLs that break when special characters appear, leak parameter boundaries to query strings (turning &x=1 into a separate parameter), or get blocked by web servers as malformed requests.

Decoding is the inverse: extracting the original data from an encoded URL. Browser address bars often show URLs in encoded form; decoding reveals what was actually intended. Logging, debugging, and security analysis all benefit from decoded URLs that show the original parameters and paths.

How to Encode and Decode URLs

Paste a string, choose direction.

  1. Choose encode or decode: Encode wraps unsafe characters in %HH format. Decode reverses %HH escapes back to literal characters.
  2. Add input text: Paste the string to encode or decode. For encoding, this is typically a literal value with spaces, special characters, or non-ASCII content. For decoding, this is a URL or URL component containing %HH escapes.
  3. Convert: The tool applies encodeURIComponent or decodeURIComponent. Encoded output is safe to embed in a URL; decoded output is the original literal value.
  4. Copy or download: Use the result wherever you need it. Encoded values fit into URLs; decoded values reveal the original data.

Common Use Cases

Technical Details

encodeURIComponent encodes every character outside the unreserved set [A-Za-z0-9-_.~]. Spaces become %20, plus signs become %2B, equals signs become %3D, and so on. Characters outside ASCII are first encoded in UTF-8 and then each byte is %-escaped.

encodeURI is more permissive and is intended for full URLs rather than components. It does not escape /, ?, &, =, #, and a few others because those characters have URL-syntax meaning. For embedding user data in a URL, encodeURIComponent is almost always the right choice.

decodeURIComponent reverses %-escapes, validating that each escape is well-formed and that the resulting bytes form valid UTF-8. Malformed input throws an error rather than producing garbage.

Best Practices

Frequently Asked Questions

What's the difference between encode and decode?
Encoding converts special characters to %HH percent-escape form so they can safely appear in URLs. Decoding reverses the process to recover the original characters. They are inverse operations.
When do I need URL encoding?
Whenever embedding data with special characters (spaces, &, =, ?, #, /) in a URL. Failing to encode produces broken URLs or misinterpreted parameters.
What about non-ASCII characters?
Non-ASCII characters are first UTF-8 encoded, then each byte is percent-escaped. encodeURIComponent handles this transparently.
Why does %20 sometimes appear as +?
Form-encoded URLs (application/x-www-form-urlencoded) use + for spaces; standard URL components use %20. The two are nearly equivalent but not identical; decoders should be aware of the context.
Should I use encodeURI or encodeURIComponent?
Almost always encodeURIComponent. Use encodeURI only if you have a complete URL and want to preserve its structure — typically rare since you build URLs from components anyway.
Is my data uploaded to a server?
No. URL encoding and decoding happen entirely in your browser.
Does it handle Unicode emoji?
Yes. Emoji are multi-byte UTF-8 sequences; the encoder produces a chain of %-escaped bytes that decoders correctly reassemble back to the original emoji.
What if my input has %HH-looking strings that aren't actually encoded?
Encoding turns each % into %25, then re-applies escaping for the rest. Decoding strict input throws errors on malformed escapes; ambiguous-looking strings may decode incorrectly.