Skip to main content
ponderloop

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

Stays in your browser

Your text is processed on this device and never uploaded. It is not saved either: reload the page and it is gone.

Action
Mode

Encodes everything except letters, digits and - _ . ! ~ * ' ( ). Use it for one value, such as a query parameter.

Result

27 characters became 81 characters.

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

#DecodedAs written
1searchsearch
2café menucaf%C3%A9%20menu

Query parameters

#KeyValue
1qhello world
2taga
3tagb
4emoji😀

Reserved and unsafe characters

What each mode produces for a single character. “kept” means the character is left as it is. Computed with the same code as the tool.
CharacterNamePercent-encodedComponentWhole URLForm
(space)Space%20%20%20+
!Exclamation mark%21keptkept%21
"Double quote%22%22%22%22
#Hash (fragment start)%23%23kept%23
$Dollar sign%24%24kept%24
%Percent sign%25%25%25%25
&Ampersand%26%26kept%26
'Apostrophe%27keptkept%27
(Opening parenthesis%28keptkept%28
)Closing parenthesis%29keptkept%29
*Asterisk%2Akeptkeptkept
+Plus%2B%2Bkept%2B
,Comma%2C%2Ckept%2C
/Slash%2F%2Fkept%2F
:Colon%3A%3Akept%3A
;Semicolon%3B%3Bkept%3B
=Equals sign%3D%3Dkept%3D
?Question mark%3F%3Fkept%3F
@At sign%40%40kept%40
[Opening square bracket%5B%5B%5B%5B
]Closing square bracket%5D%5D%5D%5D

Non-ASCII characters are encoded as UTF-8 bytes

Every byte of the character’s UTF-8 form becomes one %XX escape, in all three modes.
CharacterNameCode pointPercent-encoded
éLatin small e with acuteU+00E9%C3%A9
€Euro signU+20AC%E2%82%AC
אHebrew letter alefU+05D0%D7%90
中Chinese character “middle”U+4E2D%E4%B8%AD
😀Grinning face emojiU+1F600%F0%9F%98%80

How to URL encode or decode text

  1. Choose Encode or Decode. Pick the direction, then paste or type your text. The result updates as you type.
  2. 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 +.
  3. 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”.
  4. 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

All toolsHome & DIY calculators