Encoding mode
Standard mode uses encodeURIComponent / decodeURIComponent; form mode encodes spaces as "+".
Input
Result
The encoded / decoded result will appear here as you type.
Escape map
Every character that gets escaped is listed one by one, so you can see the rule and the UTF-8 bytes.
History
Records live only in this browser's localStorage (latest {n}), click an entry to restore input, mode and operation.
Features
- Two modes in one click: standard mode follows RFC 3986 (encodeURIComponent, escapes nearly everything), form mode follows application/x-www-form-urlencoded (spaces become +).
- Live conversion: encoding and decoding run as you type. Chinese, emoji, spaces, &, #, ?, = are all handled correctly with no button press.
- Escape map: lists every character that is escaped, what it turns into and how many UTF-8 bytes it takes - you can see the encoding rule itself.
- Character & byte stats: input and result both show character count and UTF-8 byte size, handy for API signatures and request bodies.
- History: the latest 20 conversions are kept in local storage; click any record to restore its input and settings, or clear them all at once.
- 100% client-side: escaping and unescaping happen inside your own browser; nothing is uploaded or retained. UI in English / 简体 / 繁體.
How to use
- Choose Standard or Form mode - use standard for query parameters and URL fragments, form when submitting an application/x-www-form-urlencoded body.
- Switch between Encode / Decode in the operation toggle, paste text into the input box, and the result appears immediately below - copy it with one click.
- Hit Sample to load a string with Chinese, spaces, &, # and ?; after encoding, check the escape map to see exactly why each character was transformed.
- If decoding fails, make sure the input is valid percent-encoding: % must be followed by two hex digits; pasting multiline text can sneak in newlines or spaces.
FAQ
- What is the difference between encodeURIComponent and encodeURI?
- encodeURI only escapes characters that are not allowed in a URI and keeps structural symbols like : / ? # & = intact - good for encoding a whole URL. encodeURIComponent escapes everything except A-Z a-z 0-9 - _ . ! ~ * ' ( ), including : / ? # & = spaces and Chinese - the safe choice for a single parameter value. This tool's standard mode is encodeURIComponent.
- What is the difference between form mode and standard mode?
- It is all about spaces: standard mode escapes a space to %20, while the HTML form submission spec (application/x-www-form-urlencoded) requires spaces to become +. Both mean the same thing, but servers parse them differently: form-body parsers turn + back into a space, while some URL parsers only understand %20. Prefer %20 for parameter values, use + when simulating a form submission.
- Why do I get "URI malformed" when decoding?
- decodeURIComponent requires % to be followed by two hex digits (0-9 a-f A-F). It throws URIError when a % is not followed by valid hex, or when the %XX sequence does not form valid UTF-8. Common causes: double-decoding text that was already decoded, truncated Chinese text, or invisible characters pasted from a rich-text editor.
- Why do Chinese characters and emoji become long strings of %XX?
- URLs only allow ASCII characters, so non-ASCII text is first encoded to UTF-8 bytes and each byte is written as %XX. A Chinese character occupies 3 UTF-8 bytes (e.g. %E4%B8%AD), an emoji 4 bytes. That is why Chinese in a URL must be encoded - decoding restores it exactly.
- Will my text be uploaded?
- No. Encoding, decoding, stats and the escape map all run in your browser's memory: this is a purely static page with no backend, so your text never leaves the browser. History is stored only in your own device's localStorage (max 20 entries) and can be cleared with one click.
About
URL Encoder/Decoder is a purely front-end online tool: paste text, pick Standard (encodeURIComponent) or Form (x-www-form-urlencoded) and get the converted result live, plus character/byte stats, a per-character escape map and local history. It solves the classic front-end / API-debugging pain: Chinese, spaces, &, # and ? breaking when they go into a URL.
The engine calls the browser's built-in encodeURIComponent / decodeURIComponent (standard mode) plus the space-to-+ replacement (form mode). No third-party libraries, no backend, no tracking; all input and output exists only in your own browser session. UI in English / 简体 / 繁體.
More tools
Runs entirely in your browser · Free · 中文 / 繁體 / English