🔗 URL Encoder / Decoder

Encode and decode URLs instantly. Supports encodeURIComponent, encodeURI, and safe decode with error handling.

encodeURIComponent — encodes everything including &, =, +, /. Best for query parameter values.
encodeURI — preserves URL structure characters (/, ?, #, &, =). Best for full URLs.
⚠️ Invalid encoded string — could not decode. Check for malformed percent sequences.
📖 Common URL Encoding Reference
CharacterEncodedDescription
Space%20Whitespace character
&%26Ampersand — query parameter separator
=%3DEquals — key/value separator
+%2BPlus sign (also used for space in forms)
#%23Hash — fragment identifier
?%3FQuestion mark — query string start
/%2FForward slash — path separator
@%40At sign — used in emails and auth
%%25Percent sign itself
:%3AColon — protocol/port separator
,%2CComma
[%5BLeft square bracket
]%5DRight square bracket

What is URL Encoding?

URL encoding, also known as percent-encoding, is a mechanism used to convert characters that are not allowed or that have special meaning in a URL into a safe format. The HTTP specification (RFC 3986) defines which characters can appear literally in a URL — only a small set of "unreserved characters" (A–Z, a–z, 0–9, -, _, ., ~) are allowed as-is. Every other character must be encoded as a percent sign (%) followed by two hexadecimal digits representing the character's ASCII or UTF-8 code point.

For example, a space becomes %20, an ampersand (&) becomes %26, and an equals sign (=) becomes %3D. This is critical when passing data through query strings, building API requests, or embedding links in HTML. Without proper encoding, browsers and servers may misinterpret characters like & as parameter separators or # as a fragment identifier, breaking your URLs and causing data loss or security issues.

How to Use — Step-by-Step

  1. Select the Encode tab to encode text, or the Decode tab to decode an encoded URL.
  2. Paste your raw text or encoded URL into the input textarea, or click Load Sample to try an example.
  3. For encoding: choose Encode URI Component for query parameter values, or Encode URI for a complete URL that needs safe characters only.
  4. The result appears instantly in the output box. The tool also auto-encodes/decodes as you type (with a 300 ms debounce).

Key Features

Real-time Encoding

Results update automatically as you type with a 300 ms debounce so you never have to click encode manually.

🔀
Two Encode Modes

Choose between encodeURIComponent (full encoding) and encodeURI (structure-preserving) to match your exact use case.

🛡️
Safe Decode

Invalid encoded strings are caught gracefully with a clear error message instead of crashing the page.

📋
One-click Copy

Copy any output directly to your clipboard with a single button click — no manual selection needed.

📖
Reference Table

Built-in character reference shows the most common URL encodings so you can look up values at a glance.

🔒
100% Private

All processing happens in your browser using native JavaScript. Nothing is ever sent to a server.

Frequently Asked Questions

❓ What is URL encoding?
URL encoding (percent-encoding) converts characters that are not safe for use in a URL into a % followed by two hex digits representing the character's byte value. For example, a space becomes %20 and an ampersand becomes %26. This is required by the HTTP standard (RFC 3986) to ensure URLs are transmitted correctly.
❓ When should I use encodeURIComponent vs encodeURI?
Use encodeURIComponent when encoding a single query parameter value — it encodes characters like &, =, /, ?, and # that would otherwise be interpreted as URL structure. Use encodeURI when encoding a complete URL where you want to preserve those structural characters and only escape characters that are truly unsafe (spaces, non-ASCII, etc.).
❓ Why does a space encode to %20 sometimes and + other times?
In RFC 3986 (the URL standard), spaces must be encoded as %20. However, in HTML form data (application/x-www-form-urlencoded), spaces are encoded as + for historical reasons. This tool always uses %20, which is the correct encoding for URLs. If you're submitting HTML forms, browsers handle the + encoding automatically.
❓ Can this tool handle Unicode characters?
Yes. JavaScript's encodeURIComponent converts Unicode characters to their UTF-8 byte sequences and then percent-encodes each byte. For example, the Japanese character 日 encodes to %E6%97%A5. This is the correct and widely supported way to include non-ASCII characters in URLs.
❓ What happens if I try to decode an invalid encoded string?
If the encoded string contains malformed percent sequences (e.g. %GG or a lone % at the end), decodeURIComponent will throw a URIError. This tool catches that error and displays a friendly warning message, then attempts a fallback decode using decodeURI which is more lenient.