URL Encoder & Decoder
Percent-encode reserved characters into RFC 3986 format or decode query strings to plain text with configurable space handling and query inspection.
1. The Mechanics of URL Percent-Encoding
Uniform Resource Identifiers (URIs) across HTTP/HTTPS networks must conform strictly to the US-ASCII character set. Because URLs use specific punctuation characters like ?, &, =, and / to define protocol hierarchy, path segments, and query parameters, arbitrary strings cannot contain these literal symbols without ambiguity.
Percent-encoding maps reserved, unprintable, or non-ASCII multibyte characters (like UTF-8 international text or emojis) into a % followed by a two-digit hexadecimal byte value. For instance, the UTF-8 symbol & becomes %26, preventing downstream web servers and reverse proxies from truncating parameter pairs.
2. URL Character Classifications (RFC 3986)
| Classification | Characters Included | Encoding Policy |
|---|---|---|
| Unreserved | A-Z, a-z, 0-9, -, _, ., ~ |
Never encoded; safe in all URL contexts |
| Reserved (General) | :, /, ?, #, [, ], @ |
Encoded inside query values; preserved in full URIs |
| Reserved (Sub-delimiters) | !, $, &, ', (, ), *, +, ,, ;, = |
Encoded when separating keys/values |
| Non-ASCII (Multibyte) | Accented letters, non-Latin scripts, Emojis | Converted to UTF-8 byte sequences, then percent-encoded |
3. Technical Limitations & Error Prevention
- Incomplete UTF-8 Sequences: Truncated hex sequences like
%E0%A4will trigger aURIErrorduring decoding because JavaScript expects complete multi-byte representations. - Contextual Scope Matters: Do not encode entire URLs using
encodeURIComponentor the protocol delimiter (https://) will becomehttps%3A%2F%2F, breaking client routing. Use Full URI mode for full links and Component mode for parameters. - Hash Fragment Scope: Anchor fragments (prefixed with
#) are processed on the client side and are never transmitted to the web server in standard HTTP GET request headers.
4. Execution Architecture & Privacy Transparency
All percent-encoding, decoding, string replacements, and query parsing routines are processed directly in-memory within your web browser session using client-side JavaScript. No URL strings, credentials, or query parameters are ever uploaded to remote servers or stored in databases.
Standard analytics (Google Analytics) and advertising scripts (Google AdSense) operate on this website for operational analytics and ad delivery in accordance with our Privacy Policy.
5. Explore Related Developer Utilities
6. Frequently Asked Questions
What is the difference between encodeURI and encodeURIComponent?
encodeURI is meant for full URLs and preserves protocol and path delimiters like : / ? # & =. encodeURIComponent encodes all reserved characters, making it suitable for single query string keys and values.
When should spaces be encoded as %20 versus +?
%20 is the standard percent-encoding defined in RFC 3986 for URIs. The plus symbol (+) is specific to HTML form data submissions (application/x-www-form-urlencoded).
Is my URL data stored on any server?
No. All calculations run locally in your browser sandbox using JavaScript. No input data is logged on remote servers.
What causes a URIError: malformed URI sequence?
This error happens when the input contains an invalid percent sequence (such as % without two hex digits) or an incomplete multi-byte UTF-8 character.