piapia123
en

URL Encode & Decode

Encoding & Crypto

Everything runs locally in your browser — nothing is uploaded

Input
Output

Convert text to percent-encoding and back. The two available methods differ in exactly eleven characters: encodeURIComponent turns & into %26 while encodeURI leaves it alone. Use the first for parameter values — an unescaped & or = inside a value gets read as a separator, silently splitting it into extra parameters — and the second for a whole URL, where :// ? & = # are structure rather than data. Choosing the wrong one never throws; it just produces a link that breaks for someone else, which is why the choice is explicit here. When decoding fails you also get the reason: a truncated escape, or bytes that were never UTF-8.

Features

  • Both directions: text ⇄ percent-encoding
  • Choose encodeURIComponent for parameter values or encodeURI for a whole URL
  • CJK, spaces and emoji encoded as UTF-8, matching what browsers put in the address bar
  • Decoding errors distinguish a truncated escape from bytes that are not UTF-8
  • Never treats + as a space — that rule belongs to form encoding, not percent-encoding
  • Results update as you type — no button to press

How to use

  1. Pick the direction: encode or decode
  2. Choose the scope: a parameter value or a whole URL
  3. Paste your content — the result appears instantly
  4. Click Copy to take the result

FAQ

Which one should I use?
One rule covers it: encodeURI for a full URL, encodeURIComponent for a single parameter value. They differ only on ; , / ? : @ & = + $ # — encodeURI keeps those because the URL structure depends on them, while encodeURIComponent escapes them. Running a whole URL through encodeURIComponent escapes the :// as well and leaves you with an address that no longer opens.
Why is %3F still escaped after decoding?
Because the scope is set to encodeURI. Its counterpart decodeURI deliberately leaves reserved characters escaped: %3F means "a literal ? inside the data", and turning it back into ? would change what the URL means. Switch to encodeURIComponent to decode those too.
Why is a space %20 and not +?
A space is %20 in percent-encoding. The + shorthand comes from HTML form submission (application/x-www-form-urlencoded), which is a different scheme. This tool follows percent-encoding and will not turn + into a space.
What does "the bytes are not valid UTF-8" mean?
The escapes are structurally fine, but the bytes they produce are not valid UTF-8 — usually because the link came from an older system using GBK or Latin-1. The character U+4F60 is %C4%E3 in GBK but %E4%BD%A0 in UTF-8, and this tool will not guess which one you meant.

Related tools