URL Encoder / Decoder
Encode and decode URLs, with structure breakdown and query parsing
Uses encodeURIComponent: slashes, question marks and & are encoded too - right for a value inside a query parameter.
Last updated: 2026-10-09
About this tool
A URL may only contain a small subset of ASCII characters, so Chinese text, spaces and symbols with special meaning like ? & = all have to be escaped as %XX. This tool encodes and decodes in both directions, lets you choose between "a single parameter value" and "the whole URL", and when you paste a full address it also splits out the protocol, host, path, query and fragment, listing the parameters in a table.
Features
Two encoding scopes
encodeURIComponent encodes / ? & = as well, which is right for a value inside one query parameter. encodeURI preserves those structural characters and only encodes Chinese and spaces, which is right for a full address. Picking the wrong one breaks links, so the choice is explicit here.
Chinese and spaces handled correctly
Chinese is encoded as multi-byte %XX sequences per UTF-8, and spaces become %20. Decoding reverses the same rules without producing garbled text.
URL structure breakdown
Uses the browser's native URL parser rather than a regex to split out protocol, host, path, query and fragment. URL boundary rules are far more complex than a regex can cover.
Query parameter parsing
Turns the query string into a key/value table with a copy button per value. It treats + as a space per the form convention, and accepts a whole URL by extracting the query part automatically.
How to use
- 1
Pick a direction
Encode turns the source into %XX form; Decode restores it to readable text.
- 2
Pick a scope
Use "single parameter value" for one value, or "whole URL" to turn an address containing Chinese into a usable link.
- 3
Paste and run
Results appear as you type. If the input is a full URL, the breakdown and parameter table appear below too.
- 4
Copy what you need
The result, each URL part and each parameter has its own copy button.
Options
- Single value (encodeURIComponent)
- Encodes everything except A-Z a-z 0-9 - _ . ! ~ * ' ( ) , including / ? & = # . Use it to build query parameter values.
- Whole URL (encodeURI)
- Additionally preserves : / ? # [ ] @ ! $ & ' ( ) * + , ; = . Only Chinese, spaces and other illegal characters get encoded. Use it for a whole address.
- Plus and space
- In a query string, + means a space per the form convention, so parsing turns + back into a space. Encoding always emits %20. The two do not conflict.
Common use cases
- Build a query parameter from a search phrase containing Chinese
- Decode an unreadable %E4%B8%AD%E6%96%87 sequence from a backend log
- Inspect what a shared link’s query parameters actually say, to spot tampering
- Debug whether an OAuth redirect_uri needs escaping
- Turn a Chinese filename into something usable inside a URL
- Diagnose a broken link: confirm encodeURI was not replaced by encodeURIComponent
FAQ
Questions you may have about this tool
What is the difference between encodeURI and encodeURIComponent?
encodeURI preserves :/?#[]@ and similar characters that separate the structure of a URL, so it suits a whole address. encodeURIComponent encodes those too, suiting a single query parameter value. Passing a whole URL through encodeURIComponent breaks the link entirely - the most common misuse.
Why are there two ways to represent a space?
%20 is the URL standard escape for a space, while + comes from the HTML form submission convention. Both mean a space in a query string, but + only works there - inside a path or a parameter value, + is just a plus sign.
What is double encoding?
Encoding an already-encoded string a second time. The % that introduced an escape becomes %25, so %E4 turns into %25E4 and you end up with forms like %2520. This tool detects it and prompts you to decode once more.
What does an "invalid percent escape" error mean?
In a URL, % must be followed by exactly two hex digits. Forms like 100% or %E4% violate that rule and the browser throws. Check whether the string was truncated when copied.
Can I encode several parameters at once?
Yes. Paste the key/value pairs and use the "single parameter value" scope, or encode values individually and assemble them yourself. The parameter table below also gives you a normalised query string to copy.
Why does encoded Chinese get so long?
One Chinese character is 3 bytes in UTF-8, and each byte becomes %XX, so that is 9 characters per character. That overhead is fixed by the encoding rules.
What is the problem with Chinese in a URL?
The RFCs only allow a subset of ASCII in a URL, so Chinese must be escaped. Modern browsers show %XX decoded back to Chinese for readability, but what is actually sent is the encoded form.
Is anything uploaded during processing?
No. All encoding and decoding happens in the browser with no network requests.