Converter Tool
URL Encoder & Decoder
Encode URL components or full URLs, and decode percent-encoded strings. Live character map shows exactly which characters get encoded — no signup, no data sent to any server.
Character Map
Type or paste input to see character analysis…
What is URL Encoding?
URL encoding (formally called percent encoding) is a mechanism for converting characters that are not allowed — or have special meaning — in URLs into a safe text representation. Each unsafe character is replaced by a percent sign (%) followed by two hexadecimal digits representing the character's byte value. A space becomes %20, an ampersand becomes %26, and a forward slash becomes %2F.
URLs are restricted to a subset of ASCII characters defined in RFC 3986. Characters outside this set — including spaces, non-Latin letters, emoji, and many punctuation marks — must be percent-encoded before being placed in a URL. Without encoding, these characters would either be stripped, misinterpreted, or cause the URL to break entirely.
This free online URL encoder and decoder runs entirely in your browser using JavaScript's native encodeURI, encodeURIComponent, and decodeURIComponent functions. No data ever leaves your device.
encodeURI vs encodeURIComponent
JavaScript provides two encoding functions and they serve different purposes. Choosing the wrong one is one of the most common URL-handling bugs in web development.
- ▸encodeURIComponent — encodes a single component of a URL, such as a query parameter name or value. It encodes everything except
A–Z a–z 0–9 - _ . ! ~ * ' ( ). This means it does encode/ ? # & = :— characters that would otherwise break the URL structure if left raw inside a parameter value. Use this when building query strings. - ▸encodeURI — encodes an entire URL and deliberately preserves the structural characters that give URLs their meaning:
; , / ? : @ & = + $ #. Use this when you need to make an arbitrary string safe as a complete URL, but still want it to remain a valid URL.
The character map in this tool color-codes exactly which characters fall into each category — green for safe (unchanged by both), rose for percent-encoded, and zinc for characters preserved by encodeURI but encoded by encodeURIComponent.
Common URL Encoding Use Cases
- ▸Building query strings — when appending user input to a URL as a query parameter, always use
encodeURIComponenton both the key and value to prevent injection of&or=characters that would corrupt the query string. - ▸Decoding API responses — many APIs return percent-encoded strings in URLs or Location headers. Paste them here to decode and read them in plain text.
- ▸Debugging redirect chains — URLs passed through multiple redirects often get double-encoded. Use Decode mode to peel back layers and see the original URL.
- ▸Sharing URLs containing non-ASCII text — URLs with Cyrillic, Arabic, Chinese, or emoji characters must be percent-encoded before they can be reliably shared or embedded in HTML attributes.
- ▸Form data encoding — HTML forms encode field values using a variant of URL encoding (application/x-www-form-urlencoded) before sending them. Understanding this helps when debugging POST request bodies.
Special Characters Reference
Quick reference for the most commonly encountered percent-encoded characters:
| Character | Encoded | Notes |
|---|---|---|
| Space | %20 | Most common encoding; some forms use + instead |
| ! | %21 | Safe in encodeURIComponent (not encoded) |
| # | %23 | Encoded by encodeURIComponent; marks fragment in URLs |
| & | %26 | Encoded by encodeURIComponent; separates query params |
| + | %2B | Encoded by encodeURIComponent; means space in form data |
| / | %2F | Encoded by encodeURIComponent; path separator in URLs |
| = | %3D | Encoded by encodeURIComponent; separates key=value |
| ? | %3F | Encoded by encodeURIComponent; starts query string |
| @ | %40 | Encoded by encodeURIComponent; used in mailto/auth URLs |