Encode special characters in a URL string to percent-encoded format, or decode a percent-encoded URL back to plain text.
Characters that must be percent-encoded in URLs. Encoding here escapes everything except letters, digits and - _ . ~ and works on UTF-8 text (so é becomes %C3%A9). Decoding converts only %XX sequences: a + stays a + (HTML form data uses + for a space, so replace those first if needed). Input is limited to 200,000 characters.
| Character | Encoded | Description |
|---|---|---|
| %20 | Space | |
| ! | %21 | Exclamation |
| # | %23 | Hash / Fragment |
| $ | %24 | Dollar |
| & | %26 | Ampersand |
| ' | %27 | Apostrophe |
| ( | %28 | Left paren |
| ) | %29 | Right paren |
| * | %2A | Asterisk |
| + | %2B | Plus |
| , | %2C | Comma |
| / | %2F | Forward slash |
| : | %3A | Colon |
| ; | %3B | Semicolon |
| = | %3D | Equals |
| ? | %3F | Question mark |
| @ | %40 | At sign |
| [ | %5B | Left bracket |
| ] | %5D | Right bracket |
Paste a whole link such as https://example.com/a b?x=1&y=2 into this tool and you get https%3A%2F%2Fexample.com%2Fa%20b%3Fx%3D1%26y%3D2, with the colon, slashes, question mark and equals signs all escaped, so it no longer works as an address. The reverse mistake, leaving a raw ampersand inside a value, quietly splits one parameter into two and loses data. Encode only the piece that needs it, such as a search term or a redirect target.
The text is first turned into UTF-8 bytes. Each byte outside the safe set becomes a percent sign followed by two hexadecimal digits of the byte value. The safe set, which this tool leaves as it is, is only A to Z, a to z, 0 to 9 and the four characters - _ . ~ (the unreserved characters of RFC 3986). Everything else is encoded, including space, / ? : # & = + and %, and also the marks ! ' ( ) * as %21 %27 %28 %29 %2A. A plain ASCII character therefore grows from 1 to 3 characters, é (2 bytes) becomes %C3%A9, the euro sign (3 bytes) becomes %E2%82%AC, and an emoji (4 bytes) becomes 12 characters.
Decoding goes the other way: every %XX is read as one byte, and the bytes are then read as UTF-8. Two details trip people up. A plus sign is not turned into a space, so hello+world%21 decodes to hello+world!, and the page notes this beside the reference table. And a truncated sequence such as %E0%A4%A cannot be read, so the output box turns red and shows a message instead of text. Decoding accepts either form of the marks, so %21 and a plain ! both come out as !.
Worked example: the input name=Tom & Jerry/café? is 22 characters. The = becomes %3D (hex 3D is 61), each space becomes %20, & becomes %26, / becomes %2F, é becomes %C3%A9 and ? becomes %3F. The result is name%3DTom%20%26%20Jerry%2Fcaf%C3%A9%3F, which is 39 characters: 15 untouched letters, 6 single-byte symbols at 3 characters each, and 6 for the é. The Output length counter on the page reads 39.
Here is one that uses the extra marks: Wow! (50% off*) is 15 characters and becomes Wow%21%20%2850%25%20off%2A%29, which is 29. The ! ( ) and * each take 3 characters, as do the two spaces and the percent sign. The tool accepts up to 200,000 characters of input.
Only the value. This tool escapes the separators too, so a complete address comes out unusable. Build the URL normally and run just the parameter value, such as a search phrase or a return address, through the encoder.
They are legal in URLs, so many encoders, including the browser's built-in encodeURIComponent, leave them as they are. This page escapes them as %21 %27 %28 %29 %2A so that the output is safe in every context and matches the reference table. A server decodes either form to the same character.
Percent-encoding uses %20. The plus-for-space habit belongs to HTML form submissions, and decoding here will not convert + back, so form-style data may need its plus signs replaced with spaces afterwards.
A percent sign must be followed by two hex digits, and multi-byte characters must have all of their bytes. A lone %, a cut-off %E2%82 or a stray %ZZ cannot be decoded. A literal percent sign belongs in the text as %25.
It is encoded again: %20 turns into %2520, because the percent sign itself is escaped. The Use as Input button makes this easy to do by accident. If a link shows %25 sequences, decode once more.
A single unpaired surrogate character, which can appear when text is cut in the middle of an emoji, is not valid UTF-8. The page then shows a red message instead of output. Remove the broken character and the rest encodes normally.