← Back to ResearchRanked

URL Encoder / Decoder

encodeURIComponent · Form encoding · Live · History

English 简体 繁體

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

How to use

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