URL Encoder / Decoder
Encode and decode URL strings with encodeURIComponent, encodeURI, and Base64URL modes.
Encode and decode URL strings with multiple encoding modes.
How do I use URL Encoder / Decoder?
Choose 'Encode' or 'Decode', select `encodeURIComponent` (Query Param) or `encodeURI` (Full URL), or click 'Sample'.
Paste your unencoded string or percent-encoded URL into the left editor.
Copy the RFC 3986 percent-encoded or decoded output from the right panel.
What features does URL Encoder / Decoder offer?
URL encode & decode modes
Multiple algorithm options (encodeURIComponent, encodeURI, Base64URL)
1-click copy encoded/decoded string
100% client-side local browser execution
RFC 3986 Percent-Encoding: `encodeURIComponent` vs. `encodeURI`
RFC 3986 divides ASCII characters into Unreserved characters (`A-Z a-z 0-9 - _ . ~`) and Reserved delimiters (`: / ? # [ ] @ ! $ & ' ( ) * + , ; =`).
| Encoding Mode | Escapes : / ? & = + | Space Encoding | Correct Engineering Use Case |
|---|---|---|---|
| encodeURIComponent() | Yes (%3A %2F %3F %26 %3D %2B) | %20 | Encoding individual query parameter keys or values |
| encodeURI() | No (preserves URL structure) | %20 | Encoding a complete URL with Unicode path segments |
| application/x-www-form-urlencoded | Yes | + (Plus sign) | HTML <form> POST bodies & legacy URLSearchParams |
Frequently Asked Questions about URL Encoder / Decoder
What happens if I pass a full `https://...` URL into `encodeURIComponent()`?
`encodeURIComponent()` escapes the protocol colon and slashes (`https%3A%2F%2F`), breaking the URL if used as an `href`. Use `encodeURIComponent()` only on individual query parameter values, or select `encodeURI` for a complete URL.
Why does `decodeURIComponent()` throw `URIError: malformed URI sequence`?
A `URIError` occurs when a string contains a raw `%` sign not followed by two valid hexadecimal digits (for example, `100% organic`), or when a truncated multi-byte UTF-8 percent sequence is encountered. Replace stray `%` signs with `%25` first.
Why are spaces sometimes encoded as `+` and other times as `%20`?
RFC 3986 standard URI encoding encodes spaces as `%20`, whereas the HTML form specification (`application/x-www-form-urlencoded`) encodes spaces as `+`. If a query string contains literal `+` signs (e.g., `+84` phone numbers), encode `+` as `%2B`.
What is double URL encoding (`%2520`) and how do I fix it?
Double encoding happens when an already-encoded string (`%20`) is passed through `encodeURIComponent()` a second time, turning the `%` into `%25` (`%2520`). Run 'Decode' twice to restore the original plaintext.
Explore Related Developer Tools
Smart String Escaper & Unescaper (JSON, HTML, JS, SQL, Unicode)
Bidirectional escaping and unescaping tool for JSON, HTML Entities, JavaScript, SQL strings, and Unicode characters.
Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 strings back to text. Supports Unicode UTF-8 and URL-Safe modes.
JWT Decoder
Decode and inspect JSON Web Tokens. View header, payload, signature, and expiration status.
cURL to Code Converter
Convert cURL commands into JavaScript (Fetch, Axios), Python (requests, httpx), Go, Rust, and PHP code.
cURL to Python Requests Converter
Convert cURL commands with Bearer tokens, custom headers, and JSON payloads into clean Python requests code locally in your browser.
cURL to JavaScript Fetch Converter
Transform cURL commands into modern JavaScript and Node.js 20+ Fetch API calls with typed headers and JSON.stringify payloads.