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:
| 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 A to Z, a to z, 0 to 9 and the characters - _ . ! ~ * ' ( ). Everything else is encoded, including space, / ? : # & = + and %. 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 a truncated sequence such as %E0%A4%A cannot be read, so the output box shows an error message instead of text.
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.
Only the value. This tool uses encodeURIComponent rules, which escape 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.
The table on the right is a general reference for characters that some systems escape. The tool itself follows the browser's encodeURIComponent, which keeps ! ' ( ) * ~ - _ . as they are. If a strict system insists on %21 and similar codes, replace those characters by hand.
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.