URL Encoder/Decoder
Percent-encode or decode text as you type: one value with encodeURIComponent or a whole URL with encodeURI, and an option to read + as a space. How it works
Use the URL Encoder/Decoder
About the URL Encoder/Decoder
Percent-encoding writes each unsafe byte as % and two hex digits: a space is %20 and é is %C3%A9. This tool has two encode settings. A value or path part (encodeURIComponent) escapes everything except A-Z a-z 0-9 - _ . ~ ! ' ( ) *. A whole URL (encodeURI) also keeps ; , / ? : @ & = + $ # so the link still works.
How each character is encoded
| Character | As a value or path part | In a whole URL |
|---|---|---|
| Space | %20 | %20 |
| ! | ! | ! |
| # | %23 | # |
| $ | %24 | $ |
| % | %25 | %25 |
| & | %26 | & |
| ' | ' | ' |
| ( | ( | ( |
| ) | ) | ) |
| * | * | * |
| + | %2B | + |
| , | %2C | , |
| / | %2F | / |
| : | %3A | : |
| ; | %3B | ; |
| = | %3D | = |
| ? | %3F | ? |
| @ | %40 | @ |
| [ | %5B | %5B |
| ] | %5D | %5D |
| ~ | ~ | ~ |
| é (e acute) | %C3%A9 | %C3%A9 |
| € (euro sign) | %E2%82%AC | %E2%82%AC |
What the tool outputs for each single character. Non-ASCII characters are written as their UTF-8 bytes. A space is always %20, never +.
How to use this tool
- Choose Encode or Decode.
- To encode, choose A value or path part for one parameter, or A whole URL for a complete link.
- To decode form data, tick Read + as a space.
- Type or paste the text. The output updates as you type; press the copy button to copy it.
Frequently asked questions
- Should I use encodeURIComponent or encodeURI?
- Use encodeURIComponent, the value setting, for one query value or path segment, and encodeURI, the whole-URL setting, for a complete link. Encoding https://example.com/a?b=c&d=e f as a value gives https%3A%2F%2Fexample.com%2Fa%3Fb%3Dc%26d%3De%20f, which no longer works as a link. As a whole URL it gives https://example.com/a?b=c&d=e%20f.
- Is a space %20 or +?
- The encoder always writes %20. A + stands for a space only in form data (application/x-www-form-urlencoded), so when you decode form data, tick Read + as a space: a+b%20c decodes to a b c, and to a+b c without the tick.
- Why does decoding give an error?
- A % must be followed by two hex digits that complete a valid UTF-8 sequence. %E0%A4%A is cut short and gives a message with an empty output, while %C3%A9 decodes to é. The output never keeps an older result.
- Why does encoding twice turn %20 into %2520?
- Both settings escape the % sign itself as %25, so an already-encoded %20 becomes %2520. Encode raw text once, or decode first.
- Does it handle accents, euro signs and emoji?
- Yes, as UTF-8 bytes: é is %C3%A9, € is %E2%82%AC and 😀 is %F0%9F%98%80. A lone half of an emoji cannot be encoded and gets a message.
Related Tools
View all toolsJSON Formatter
Paste JSON to format it with 2 spaces, 4 spaces or tabs, minify it or sort its keys. A syntax error is reported with its line, column and a caret under it.
JSON Path Query Tool
Test a JSONPath expression on your JSON and see the match count, each matching value and its path. Filters such as ?(@.price < 10) work. Up to 100 KB.
Base64 Converter
Encode text to Base64 or decode Base64 to text. UTF-8, standard and URL-safe alphabets, optional padding on decode, up to 250,000 characters.
UUID Generator
Generate 1 to 1,000 random v4 UUIDs, or time-based v1, or name-based v5 and v3 from a namespace and a name, and copy them. Repeats of v4 are very unlikely.
ULID Generator
Generate 1 to 500 ULIDs, 26-character IDs that sort by creation time, in upper or lower case, and decode any ULID to the date it was made.
HTML Entity Encoder
Encode text to HTML entities (& < > " ') or decode any of the 2,231 named references in the HTML standard and numeric ones such as é.