Skip to content
English

Switch theme

// Tools · encoding

URL encode / decode

Percent-encode text for URLs or decode %E4%B8%AD-style strings back to readable text. Handles Chinese and emoji, form “+” spaces, links encoded several times, and splits a query string into a table.

Runs on your device – nothing is uploadedencodeURIComponent · encodeURIUTF-8Multi-layer decode

Type or paste above; the result updates as you type.

01Which mode should I use?

encodeURIComponentencodeURI
Use forOne parameter value or path segmentA whole URL
Keeps unencodedA–Z a–z 0–9 - _ . ! ~ * ' ( )same, plus ; / ? : @ & = + $ , #
Example: a&b=c da%26b%3Dc%20da&b=c%20d
Example: 中文%E4%B8%AD%E6%96%87%E4%B8%AD%E6%96%87

Rule of thumb: building a query yourself → encode each value with encodeURIComponent; fixing spaces or Chinese in a ready-made link → encodeURI.

Related: Base64 encode / decode · all tools →

FAQ

What is the difference between encodeURIComponent and encodeURI?

encodeURIComponent encodes everything except A–Z a–z 0–9 - _ . ! ~ * ' ( ), including / ? : @ & = + $ , #. Use it for a single parameter value or path segment. encodeURI also leaves those URL-structure characters alone, so it suits a whole URL that only has spaces or Chinese in it – but a value containing & or = would break the query.

Should a space be %20 or +?

In paths and in general percent-encoding a space is %20. HTML forms (application/x-www-form-urlencoded) write it as +, and many back ends read + in the query string as a space. Tick “+ as space” to encode or decode that way. If a real plus sign must survive, it has to be %2B.

Why is my link encoded twice (%25E4…)?

%25 is an encoded “%”. It appears when an already encoded string is encoded again, for example by a redirect or tracking link. “Decode all layers” keeps decoding until nothing changes (up to 10 layers) and tells you how many layers it removed.

What does “invalid % sequence” mean?

Every % must be followed by two hexadecimal digits, and the bytes must form valid UTF-8. A lone % (as in “100%”), %zz, or a truncated Chinese character (%E4%B8 without its third byte) cannot be decoded. The tool shows the position so you can fix or encode that part first.

Is my data uploaded?

No. Everything runs in this page’s JavaScript. Your input is not sent anywhere, not put in the address bar, cookies or localStorage, and not included in analytics.