%XX codes. It uses the browser's encodeURIComponent() function.%XX codes back into characters. It uses decodeURIComponent().+ becomes a space.If Encode or Decode fails, a message under the buttons says why, and the Output box is cleared. So you cannot copy an old result by mistake. Encode fails only in one rare case: the text has a broken character, such as half of an emoji copied from another program.
Encode the text a b&c=d/é and you get:
a%20b%26c%3Dd%2F%C3%A9
Each special character became a % sign and two hex digits. Characters outside English, like é, are first turned into UTF-8 bytes. Then each byte gets its own code. é is two bytes, so it becomes %C3%A9.
| Character | Encoded | Why it matters in a URL |
|---|---|---|
| space | %20 | A URL cannot contain a real space. |
& | %26 | Separates query parameters. |
= | %3D | Separates a parameter name from its value. |
? | %3F | Starts the query string. |
# | %23 | Starts the fragment. The browser does not send it to the server. |
/ | %2F | Separates path parts. |
+ | %2B | Many servers read a plain + in a query as a space. |
% | %25 | Starts every code, so it must be encoded itself. |
नमस्ते | %E0%A4%A8%E0%A4%AE... | 6 characters, 18 UTF-8 bytes, 54 characters when encoded. |
😀 | %F0%9F%98%80 | 4 UTF-8 bytes. |
Encode leaves these characters as they are: A-Z a-z 0-9 - _ . ~ ! ' ( ) *.
The last five (! ' ( ) *) are a known gap in encodeURIComponent. They are safe in most URLs. But a few strict systems, such as OAuth 1.0 signatures, need them encoded as well. In JavaScript you can add this step yourself:
encodeURIComponent(text).replace(/[!'()*]/g, c => '%' + c.charCodeAt(0).toString(16).toUpperCase())
This tool encodes everything that has a meaning in a URL, including :, /, ? and &. That is exactly right for a single value. It is wrong for a full address. Paste a full URL and you get this:
Input: https://example.com/search?q=red shoes&page=2 Output: https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dred%20shoes%26page%3D2
That output no longer works as a link. Instead, encode only the value and put it into the URL yourself. For the search term red shoes & socks:
Value: red shoes & socks Encoded: red%20shoes%20%26%20socks URL: https://example.com/search?q=red%20shoes%20%26%20socks&page=2
If you did not encode the value, the & would end the q parameter. The server would read q as red shoes and treat socks as a separate, empty parameter.
JavaScript has a second function, encodeURI(), for full URLs. It keeps : / ? & = # and only encodes things like spaces and non-English letters. This tool does not offer it. In the example above, encodeURI would give https://example.com/search?q=red%20shoes&page=2.
By default, a plus sign stays a plus sign. decodeURIComponent does not turn + into a space. So red+shoes decodes to red+shoes. But HTML forms and many query strings use + for a space. For that kind of text, turn on Treat + as space. Then red+shoes decodes to red shoes. A real plus sign in form text is written %2B, so it stays correct: a%2Bb+c decodes to a+b c. Leave the option off for other text, such as a path or a Base64 value, where + really means a plus sign.
Broken codes give an error. Decode stops with Invalid encoded string for any of these:
| Input | Problem |
|---|---|
100% | A % with nothing after it. A real percent sign must be written %25. |
%zz | zz is not a hex number. |
%E0%A4 | Only part of a character. The text was cut in the middle of a UTF-8 sequence. |
caf%E9 | Encoded as old Latin-1, not UTF-8. The UTF-8 form is caf%C3%A9. |
If one bad code appears anywhere in the input, nothing is decoded. When the problem is a % without two hex digits, the message tells you its position, counting from 1. Fix or remove that part, then try again.
Decode removes one layer at a time. %2520 decodes to %20, not to a space. That means the text was encoded twice. Press Decode again to remove the second layer.
%20 gives %2520, because the % is encoded again. This often happens when a library already encodes values and you encode them first as well. The server then sees %20 as text instead of a space.new URLSearchParams({q: "a b"}) in JavaScript writes q=a+b, with a plus. Python's urllib.parse.quote("a b/c") gives a%20b/c and keeps the slash, unless you pass safe="". Results that differ from this tool are often correct for their own purpose.Yes, if you turn on Treat + as space. It is off by default, because decodeURIComponent only decodes %XX codes and leaves + as it is. HTML forms and many query strings use + for a space, so turn the option on for text from a form or a query string. A real plus sign in that text is written %2B, so it stays a plus.
The input has a % that is not followed by two hex digits, such as 100% or %zz. Or it has a broken or non-UTF-8 byte sequence, such as caf%E9. One bad code stops the whole decode. The message shows where the first bad % is, so fix or remove it and try again.
You can, but the result will not work as a link. The tool encodes : / ? and the other URL characters too, so https:// becomes https%3A%2F%2F. Encode only the value you put into the URL, such as a search term.
Letters A to Z and a to z, digits, and the characters - _ . ~ ! ' ( ) *. Everything else, including spaces and all non-English letters, is turned into %XX codes of its UTF-8 bytes.
No. URL encoding keeps normal letters and digits as they are and only changes special characters into %XX codes. Base64 rewrites all of the data into a 64-character alphabet. Neither one is encryption.
No. Encoding and decoding use the encodeURIComponent and decodeURIComponent functions built into your browser, and the page does not send your text anywhere.