What is URL encoding?
URL encoding — also called percent-encoding — is the way text that is not allowed in a URL gets smuggled through one anyway. A URL may only contain a small set of characters: letters, digits, and a handful of punctuation marks. Everything else is replaced by a % sign followed by two hexadecimal digits, the byte value of the character. A space becomes %20, an ampersand becomes %26, and the French é becomes %C3%A9 — its two UTF-8 bytes, each written as a percent pair.
The rule exists because several characters already have jobs inside a URL. The ? starts the query string, & separates one parameter from the next, and = joins a name to its value. If your search term is literally “fish & chips”, putting it raw into a URL would split it into two parameters. Encoding turns the & into %26, and the whole phrase survives as one value. Decoding reverses the process.
Characters outside the ASCII range are encoded as UTF-8 first: é needs two percent pairs, an emoji like 🎉 needs four (%F0%9F%8E%89). The rules come from RFC 3986, and this tool uses your browser’s own built-in functions — encodeURIComponent, encodeURI and their decode partners — so the result is exactly what the browser itself would produce.
How to use this URL encoder and decoder
- Pick a direction. Encode turns plain text into percent-encoded form; Decode turns an encoded string back into readable text.
- Pick a mode. Component is for one value inside a URL, like a query parameter or a path segment. Full URL is for a complete address that just needs fixing up. Form data is for HTML form bodies, where spaces become
+. The line under the buttons explains the mode you picked, with a live preview of what it does toa b&c/d+e. - Paste or type. The result updates live with every keystroke — there is no button to press. You can also type directly into the result box: it converts back into the input box, so you can check a round trip without switching modes.
- Read the error, if any. If decoding fails, the message names the exact character position of the bad
%sequence, so you fix one spot instead of guessing. - Copy, swap or download. Copy result takes the output to the clipboard. Swap moves the result into the input and flips the direction — encode a value, swap, decode, and if the original comes back, it survives transport exactly as written. Download .txt saves the result as a file.
- Batch a list. Tick “Process each line separately”, paste one value per line, and every line is encoded or decoded on its own while the line breaks stay in place.
The sample button loads a string that exercises the interesting cases at once: spaces, an ampersand, a question mark, a percent sign, an accented letter and an emoji. Watch what each mode does to it.
Component vs full URL vs form data — which mode do I need?
This is the one decision that matters, and the one most encoder pages leave you to guess. The rule of thumb: encode each value, not the whole URL. Encode a complete URL in Component mode and the / and ? become %2F and %3F, so the address stops working as a link. Encode a single value in Full URL mode and the & inside it stays raw, splitting your query into a fake second parameter.
| Mode | Use when | Leaves unescaped | a b&c/d+e becomes |
|---|---|---|---|
| Component | One value inside a URL: a search term, a query parameter value, a path segment | Letters, digits, - _ . ~ and ! ' ( ) * | a%20b%26c%2Fd%2Be |
| Full URL | A complete address that needs fixing up (a pasted link with spaces, for example) | All of the above plus : / ? # [ ] @ $ & = + , ; | a%20b&c/d+e |
| Form data | A form body or a query string built the way browsers build one | Same as Component, except spaces become + | a+b%26c%2Fd%2Be |
Form data mode exists because HTML forms have their own convention: a browser submitting a form sends a space as +, not %20. Most servers accept both, but some form handlers only understand +. If you are debugging a form submission, Form data is the mode. Everywhere else, Component is the default, and Full URL is for whole addresses only.
Common characters and their codes
RFC 3986 splits URL characters into reserved characters — the ones with structural jobs — and unreserved characters, which never need encoding. Everything else must be percent-encoded. The table below is the cheat sheet: the eighteen reserved characters with their codes, plus the everyday characters people actually look up.
| Character | Code | Character | Code |
|---|---|---|---|
| space | %20 | ! | %21 |
" | %22 | # | %23 |
$ | %24 | % | %25 |
& | %26 | ' | %27 |
( | %28 | ) | %29 |
* | %2A | + | %2B |
, | %2C | / | %2F |
: | %3A | ; | %3B |
= | %3D | ? | %3F |
@ | %40 | [ | %5B |
] | %5D | < | %3C |
> | %3E | \ | %5C |
^ | %5E | ` | %60 |
{ | %7B | | | %7C |
} | %7D | ~ | %7E (unreserved — never needs it) |
| newline | %0A | é | %C3%A9 |
Two details catch people out. First, the percent sign itself must be encoded as %25 — that is what makes double-encoding possible, and why the tool warns you when your input already contains %XX sequences. Second, ~ is unreserved: encoding it as %7E is legal but unnecessary, and the browser’s functions leave it alone.
Three everyday uses
1. Building a link with a search term in it
You want to link to a search for “fish & chips” or share a URL containing a name with an accent. Paste the term, pick Component mode, and the result is safe to drop into a query string: fish%20%26%20chips. The & can no longer split your query, and the accented letter arrives intact. This is the single most common reason anyone opens an encoder.
2. Reading a link that is full of percent signs
A link arrives in an email or a log file looking like https://example.com/search?q=caf%C3%A9%20%26%20th%C3%A9. Paste it, pick Decode with Full URL mode, and you get the readable version back: the query was “café & thé”. Full URL mode keeps the structure visible while it decodes the values; Component mode would decode the ? and & holding the address together too.
3. Debugging an API call that keeps failing
An API returns a 400 error, or a redirect lands on the wrong page, and the URL in the log is the only evidence. Decode it and read it like a sentence: a %2520 where you expected a space means the value was encoded twice; a raw & inside a value means it was never encoded at all. Both bugs are invisible in the encoded form and obvious in the decoded one. The Swap button closes the loop: decode, spot the problem, fix the source, encode again, and confirm the round trip is clean.
Common mistakes to avoid
- Encoding the whole URL as a component.
https://example.com/a bencoded in Component mode becomeshttps%3A%2F%2Fexample.com%2Fa%20b— a string, not a link. Use Full URL mode for whole addresses. - Encoding a value in Full URL mode. A search term with an
&keeps its raw&in Full URL mode, and the server reads it as a parameter separator. Use Component mode for values. - Double-encoding. Encoding a value that is already encoded turns
%20into%2520. The server decodes once and gets the literal text%20instead of a space. If your input already contains%XX, this tool warns you before it happens. - Decoding too many times. A value that was encoded twice needs decoding twice — but decoding a normal value twice corrupts it, because a legitimate
%25in the original text becomes a bare%and then an error. Decode one layer, check whether%sequences remain, and only then decode again. - Mixing up + and %20. In a query string,
+means a space only in form data. In a path segment,+is a literal plus sign. If a filename with a plus in it comes back with a space, the decoder was in Form mode when it should have been in Component mode. - Forgetting that encoding is not encryption. Percent-encoding hides nothing:
%68%65%6C%6C%6Fis just “hello” written awkwardly. Never put a secret in a URL on the assumption that encoding protects it — URLs end up in logs, referer headers and browser history.
Frequently asked questions
- Is this URL encoder free?
- Yes. No account, no limits, no upload. Your text never leaves your browser.
- Is my data sent to a server?
- No. Encoding and decoding run entirely in your browser with JavaScript’s built-in URI functions. That matters, because URLs often contain API keys, tokens and session IDs. Load the page, disconnect from the internet, and the tool still works.
- Should I use Component or Full URL mode?
- Use Component for one value inside a URL — a search term, a query parameter value, a path segment. It encodes /, ?, & and = so the value cannot split your URL apart. Use Full URL for a complete address that just needs fixing up — it keeps :, /, ?, # and = as they are and only encodes characters that are not allowed, like spaces.
- What is Form data mode for?
- Form data mode matches how a browser sends an HTML form (application/x-www-form-urlencoded): spaces become + instead of %20, and a + decodes back as a space. Use it for form bodies and query strings built by server frameworks that expect + for spaces.
- Why does decoding fail with an invalid % sequence?
- A % in a URL must be followed by exactly two hexadecimal digits (0–9, A–F), as in %20 for a space. A bare % at the end, or % followed by something like %2G, is not a valid sequence, so the decoder cannot know what character it stands for. This tool reports the exact character position of the bad sequence so you can fix that one spot.
- What is double-encoding, and why should I care?
- Double-encoding happens when an already-encoded value is encoded again: %20 becomes %2520, because the % itself is encoded as %25. The server then decodes once and gets %20 as literal text instead of a space. If you encode a value that already contains %XX sequences, this tool warns you before it happens; if a decode result still contains % sequences, it may need one more decode pass.
- How do I encode a whole list of values at once?
- Tick “Process each line separately”, paste one value per line, and every line is encoded or decoded on its own while the line breaks stay in place. Each line is treated as an independent value, so a % in one line cannot break the others.
- Can I type in the result box?
- Yes. The two boxes stay in sync both ways: type in the input and the result updates; type in the result and the input updates in the reverse direction. It is the fastest way to check a round trip — encode a value, then edit the result and watch the original come back.
Privacy
URLs are where secrets live: API keys in query strings, session tokens in redirect links, personal names in shared searches. Pasting those into a server-side encoder sends them to a stranger’s log file — and several of the best-known encoders process input on their servers by default, with a local mode you have to opt into. This tool does the opposite: everything runs in your browser from the first keystroke, and closing the tab leaves nothing behind.
Worked example: decoding a real link
Here is a link very much like the ones that arrive in bug reports — it works, but nobody can read it. Paste it into the tool in Decode + Full URL mode and see what it says before reading on:
https://example.com/search?q=caf%C3%A9%20%26%20th%C3%A9&lang=fr
The decoded version is https://example.com/search?q=café & thé&lang=fr: the query was “café & thé”, in French. The %C3%A9 pairs are the two UTF-8 bytes of é, %20 is the space, and %26 is the ampersand inside the search term — the one that must stay encoded, because a raw & there would split the query into a second parameter. Try the same string in Component mode and the ? and & between parameters decode too, so the address falls apart into plain text. Same input, same decoder — the mode is the difference.
One more check: encode the decoded value “café & thé” in Component mode and you get caf%C3%A9%20%26%20th%C3%A9 back — exactly the string you started with. That round trip is the proof the encoding is correct. If the original does not come back, something was encoded twice, or in the wrong mode, and now you know where to look.
Share this tool
Copy the link below and paste it anywhere — a chat message, an email, a document. Whoever opens it gets the same free tool, with no account and nothing to install.