Updated 2026-04

URL Encoder / Decoder

Free URL encoder and decoder following IETF RFC 3986. Encode special characters for query strings, decode percent-encoded URLs, and choose between encodeURI and encodeURIComponent.

URL Encoder / Decoder

Share with friends

How to use

  1. 1 Choose mode: encode or decode.
  2. 2 Pick component mode (encodes reserved chars like &, =, ?, /) or URI mode (keeps URL structure intact).
  3. 3 Paste your input. Output updates instantly as you type.
  4. 4 Use component mode for query string values: a search term Hello & World becomes Hello%20%26%20World.
  5. 5 Use URI mode for full URLs: https://example.com/?q=hello world becomes https://example.com/?q=hello%20world while keeping ://, ?, & intact.

FAQ

Q Why is a space encoded as %20 sometimes and + other times?

Both decode to a space. <code>%20</code> is RFC 3986 percent-encoding for URLs. <code>+</code> is the historical form-encoding from HTML forms (application/x-www-form-urlencoded). Modern URLs prefer <code>%20</code>; legacy server-side CGI may expect <code>+</code> in query strings.

Q When should I use encodeURI vs encodeURIComponent?

Use <code>encodeURIComponent()</code> for individual query values, path segments, or any data inside a URL. Use <code>encodeURI()</code> only when encoding a complete URL where you want to preserve <code>://</code>, <code>?</code>, <code>#</code>, <code>&</code>, and <code>/</code>. The wrong choice is the most common URL bug.

Q How are Unicode characters URL-encoded?

They're first encoded as UTF-8 bytes, then each byte is percent-encoded. The character <code>é</code> (U+00E9) becomes <code>%C3%A9</code> — two bytes in UTF-8, percent-encoded as two hex pairs. Emojis like 🎉 (U+1F389) become four bytes: <code>%F0%9F%8E%89</code>.

Q Why does my URL break when I copy it from the browser?

Browsers display the human-readable form (Unicode characters intact) but transmit the percent-encoded form. When you copy a URL, you may get either depending on the browser. Re-paste with proper encoding for cross-system use, or use this tool to convert to the canonical %-encoded form.

Q Are there reserved characters that don't need encoding?

Yes — RFC 3986 defines <strong>unreserved</strong> characters that must never be encoded: A–Z, a–z, 0–9, hyphen, underscore, period, and tilde. These remain literal in URLs. The <strong>sub-delims</strong> (! $ & ' ( ) * + , ; =) and <strong>gen-delims</strong> (: / ? # [ ] @) need encoding only in component mode.

Q Can I have hashtags # in URL parameters?

Yes, but you must encode them as <code>%23</code>. Unencoded <code>#</code> starts the URL fragment, so anything after it isn't sent to the server — a common bug when generating tracking links. Always pass <code>#</code> through component encoding.

Q Why are some URL shorteners shorter than the encoded URL?

They map a long URL to a short ID stored in a database. The short URL doesn't contain the original — it's a redirect lookup key. Useful for SMS character limits and clean printed URLs. The trade-off is dependency on the shortener's uptime and analytics.

Q What is the maximum URL length?

No standard limit, but practical caps: browsers around 2,000–8,000 characters; servers (Apache, nginx) often default to 8 KB; CDNs may set 4–8 KB. RFC 9110 (HTTP/1.1) recommends supporting at least 8,000 characters. For long data, use POST request bodies instead of URL parameters.