How this encoder and decoder works
Pick a direction — Encode or Decode — pick a method, and paste. The result updates live in the preview panel on every keystroke; there is nothing to submit. The Swap button feeds the result back into the input box and flips the direction, so you can encode a value and immediately decode it again to check nothing was lost. Copy puts the result on your clipboard, Download saves it as a .txt file, and counters track the input and output lengths. Reset clears everything, and asks for confirmation first.
What percent-encoding actually is
A URL can only safely contain a limited set of characters: letters, digits, and a small group of punctuation marks. Some of those marks already have jobs — / separates folders, ? starts the query string, & separates parameters, # marks a spot on the page — so they cannot also appear freely inside the values a URL carries. Everything else has to be translated. Percent-encoding is that translation, defined in the URL standard (RFC 3986): write the character's UTF-8 bytes, each as a % plus two hexadecimal digits.
Which characters get encoded
It depends on the method. Component encoding (encodeURIComponent) is strict: it protects a single value, so it encodes everything structural. Full URL encoding (encodeURI) is gentle: it assumes the input is already an address and only fixes what cannot travel.
| Character | Component | Full URL |
|---|---|---|
| Space | %20 | %20 |
| é (and other non-ASCII letters) | %C3%A9 | %C3%A9 |
| % | %25 | %25 |
| & | %26 | stays & |
| = | %3D | stays = |
| ? | %3F | stays ? |
| / | %2F | stays / |
| : | %3A | stays : |
| # | %23 | stays # |
| + | %2B | stays + |
| @ | %40 | stays @ |
| A–Z, a–z, 0–9 and - _ . ! ~ * ' ( ) | never encoded | never encoded |
Two rows deserve attention: % itself is always encoded, because a bare % would be mistaken for the start of an escape — and the last row never changes, because those unreserved characters are the alphabet URLs are built from.
Component or Full URL: the one choice that matters
Ask what the text is. If it is one value that will sit inside a URL — a search term, a product name, a redirect target, anything after a ? or an = — use Component. A value like “café & tea” contains an &, which a browser would read as the start of the next parameter; component encoding turns it into %26 so the value survives intact. If the text is a URL — a whole address with spaces in a file name or an accented word in a path — use Full URL, which repairs only the unsafe parts. In reverse, Component decoding turns every %XX back into its character, while Full URL decoding leaves sequences for structural characters (like %26) untouched, because a readable URL keeps those as symbols.
Why decoding sometimes fails
Decoding is unforgiving because the format is precise. Every % must be followed by exactly two hex digits — 0–9 and A–F — so %zz is meaningless, and a % dangling at the end of copied text has nothing after it at all. Multi-byte characters are stricter still: é travels as the pair %C3%A9, and if a copy-paste drops the second half, the remaining %C3 is an unfinished character no decoder can complete. This tool catches those cases and tells you, instead of a raw browser error or garbled text. The usual cause: text trimmed by a form, a chat app or a spreadsheet on its way to you.
Your text stays in your browser
Everything on this page happens inside your browser, using JavaScript's built-in functions — your text is never uploaded, transmitted or stored. That makes it safe for text other services should not see: signed links, API tokens, private search terms. The page keeps nothing for you, though — refresh or close the tab and the boxes are empty, so save anything you need first.
Common mistakes with URL encoding
- Encoding a whole URL with the Component method. Its ://, ? and & get encoded and the link breaks. Whole addresses take the Full URL method.
- Encoding twice. Run an already-encoded value through again and %20 becomes %2520 — the % itself gets encoded, and the page shows a literal “%20” instead of a space. Decode once and check before re-encoding.
- Expecting + to mean a space. That shortcut belongs to HTML form data. In a URL path, + is a plus sign, and this tool decodes it as one.
- Pasting encoded text that was cut short. A sequence sliced in half — %C3 with no %A9 after it — cannot decode. Copy the complete value, including its tail.
- Assuming encoding hides anything. Percent-encoding is a transport format, not encryption. Anyone can decode %63%61%66%C3%A9 back to “café” with this very tool — never use it to conceal passwords or private data.