URL Encode & Decode
URL encoding (percent-encoding) replaces each unsafe character with a % and the two hex digits of its UTF-8 bytes, so a space becomes %20 and an emoji becomes four escapes. The example “Café menu: 50% off & שלום 😀” encodes to Caf%C3%A9%20menu%3A%2050%25%20off%20%26%20%D7%A9%D7%9C%D7%95%D7%9D%20%F0%9F%98%80 in Component mode. Pick Component for a single value such as a query parameter, Whole URL to keep a complete address intact, or Form for application/x-www-form-urlencoded, where a space is + (“hello world” becomes hello+world). Decoding reverses it, reports a broken sequence such as %ZZ by position instead of failing, and spots text that was encoded twice (%2520). Paste a full URL into the breakdown to see its parts: the example has 4 query parameters and 2 path segments. Nothing leaves your browser.
Updated Runs in your browser: nothing you enter is uploadedHow this tool works
Your text is processed on this device and never uploaded. It is not saved either: reload the page and it is gone.
Encodes everything except letters, digits and - _ . ! ~ * ' ( ). Use it for one value, such as a query parameter.
Result
27 characters became 81 characters.
This text looks encoded twice (it contains %25 followed by hex digits), so the result still has escapes in it.
URL breakdown
Split into 2 path segments and 4 query parameters.
- Protocol
- https
- Host
- example.com
- Port
- 8080
- Path
- /search/caf%C3%A9%20menu
- Fragment
- section-2
Path segments
| # | Decoded | As written |
|---|---|---|
| 1 | search | search |
| 2 | café menu | caf%C3%A9%20menu |
No path segments.
Query parameters
| # | Key | Value |
|---|---|---|
| 1 | q | hello world |
| 2 | tag | a |
| 3 | tag | b |
| 4 | emoji | 😀 |
No query parameters.
Reserved and unsafe characters
| Character | Name | Percent-encoded | Component | Whole URL | Form |
|---|---|---|---|---|---|
| (space) | Space | %20 | %20 | %20 | + |
| ! | Exclamation mark | %21 | kept | kept | %21 |
| " | Double quote | %22 | %22 | %22 | %22 |
| # | Hash (fragment start) | %23 | %23 | kept | %23 |
| $ | Dollar sign | %24 | %24 | kept | %24 |
| % | Percent sign | %25 | %25 | %25 | %25 |
| & | Ampersand | %26 | %26 | kept | %26 |
| ' | Apostrophe | %27 | kept | kept | %27 |
| ( | Opening parenthesis | %28 | kept | kept | %28 |
| ) | Closing parenthesis | %29 | kept | kept | %29 |
| * | Asterisk | %2A | kept | kept | kept |
| + | Plus | %2B | %2B | kept | %2B |
| , | Comma | %2C | %2C | kept | %2C |
| / | Slash | %2F | %2F | kept | %2F |
| : | Colon | %3A | %3A | kept | %3A |
| ; | Semicolon | %3B | %3B | kept | %3B |
| = | Equals sign | %3D | %3D | kept | %3D |
| ? | Question mark | %3F | %3F | kept | %3F |
| @ | At sign | %40 | %40 | kept | %40 |
| [ | Opening square bracket | %5B | %5B | %5B | %5B |
| ] | Closing square bracket | %5D | %5D | %5D | %5D |
Non-ASCII characters are encoded as UTF-8 bytes
| Character | Name | Code point | Percent-encoded |
|---|---|---|---|
| é | Latin small e with acute | U+00E9 | %C3%A9 |
| € | Euro sign | U+20AC | %E2%82%AC |
| א | Hebrew letter alef | U+05D0 | %D7%90 |
| 中 | Chinese character “middle” | U+4E2D | %E4%B8%AD |
| 😀 | Grinning face emoji | U+1F600 | %F0%9F%98%80 |
How to URL encode or decode text
- Choose Encode or Decode. Pick the direction, then paste or type your text. The result updates as you type.
- Pick the mode. Component encodes a single value. Whole URL keeps : / ? # & = so a full address still works. Form is for form data, where a space is written as +.
- Check the messages. A broken sequence such as %ZZ is listed with its position and kept as typed. If the text was encoded twice, press “Decode again”.
- Copy the result. Use Copy to put the result on the clipboard. To inspect a whole link, paste it into the URL breakdown.
Frequently asked questions
- What is the difference between encodeURI and encodeURIComponent?
- encodeURIComponent encodes every character except letters, digits and - _ . ! ~ * ' ( ), so it is right for one piece of a URL such as a query value. encodeURI additionally keeps ; , / ? : @ & = + $ # because they give a URL its structure, so it is meant for a complete address. Using encodeURI on a value leaves & and = unescaped and breaks the query string.
- Should a space be %20 or +?
- %20 is correct everywhere in a URL. + means a space only in application/x-www-form-urlencoded data, which is how HTML forms and URLSearchParams write a query string. In a URL path a + is a literal plus sign, so decode with Form mode only for form data and query strings.
- How are emoji and Hebrew or other non-English text encoded?
- The text is converted to UTF-8 and each byte becomes a %XX escape. “é” is %C3%A9 (two bytes), “א” is %D7%90 and an emoji such as 😀 is %F0%9F%98%80 (four bytes). Decoding joins the bytes back into the same character.
- What does a malformed sequence like %ZZ or %E0%A4%A mean?
- A % must be followed by two hex digits, and the bytes together must form valid UTF-8. “%ZZ” and a trailing “%A” are not escapes, and “%E0%A4” is the start of a three-byte character that was cut off. Browsers’ decodeURIComponent throws an error for these; this tool lists each one with its position, keeps it as typed, and decodes the rest.
- What is double encoding?
- Encoding text that is already encoded turns each % into %25, so a space becomes %2520 instead of %20. One round of decoding then gives %20, not a space. When the tool sees %25 followed by two hex digits and the result still holds escapes, it offers “Decode again”.
- Is “already decoded” text safe to decode?
- Yes. Characters that are not part of an escape pass through unchanged, so decoding plain text returns it as it was. A lone % in ordinary text (“100% sure”) is reported and kept.
- Why does encoding a whole URL change my % signs?
- encodeURI, like every mode here, turns % into %25 because it cannot tell a literal percent from the start of an escape. If your URL is already encoded, decode it first or leave it as it is, otherwise it ends up double-encoded.
- How does the URL breakdown work?
- It passes your text to the browser’s URL parser, which needs an absolute URL (a scheme such as https: first). Protocol, host, port, path segments, the query parameters in their original order (repeated keys included) and the fragment are shown decoded. A relative link such as /path?x=1 is explained instead of guessed at.
- Is my text sent anywhere?
- No. Encoding, decoding and the breakdown run in your browser and nothing is uploaded or stored; reload the page and it is gone. The only thing the site records, if you allow analytics, is that a button was used, never any of the text.
How it works
Encoding calls the browser’s encodeURIComponent (Component mode) or encodeURI (Whole URL mode). Form mode starts from encodeURIComponent, writes a space as + and also encodes ! ' ( ) ~, which matches how URLSearchParams serializes. Unpaired surrogates, which cannot be written as UTF-8, are replaced by U+FFFD first. Decoding is a small parser of its own so errors can be located: each %XX becomes a byte, runs of bytes are decoded as strict UTF-8 (no overlong forms, surrogates or values above U+10FFFF), and anything invalid stays as typed and is listed with its character position. Whole URL decoding leaves the escapes for ; / ? : @ & = + $ # alone, like decodeURI; Form decoding also turns + into a space. The breakdown uses the standard URL parser and URLSearchParams, so it applies the same rules as the browser, including its default ports and punycode for international host names.
Sources
More free tools
- Base64 Encode & DecodeEncode text or a file to Base64 and decode it back, with correct UTF-8 for emoji and any language, URL-safe and MIME variants. Runs in your browser.
- HTML Entity Encoder & DecoderEscape text for safe HTML or decode named, decimal and hex character references the way browsers do, with all 2,231 standard names. Runs in your browser.
- JSON Formatter & ValidatorValidate JSON with the exact line and column of any error, then pretty-print, minify or sort keys. Big numbers keep every digit. Runs in your browser.
- URL Slug GeneratorTurn titles into clean URL slugs: hyphen or underscore, accents to ASCII, optional stop-word removal and a max length. Batch mode warns about duplicates.
- Regex TesterTest JavaScript regular expressions: highlighted matches, capture groups, replacements with $1 or $<name>. Stops runaway patterns. Runs in your browser.
- QR Code GeneratorTurn a link, text, Wi-Fi login, email or phone into a QR code. Set error correction, size and colors, then download PNG or SVG. Made on your device.