%20 · %C3%A9 · encodeURIComponent
URL encoder and decoder
URL encoding replaces unsafe characters with % and two hex digits: a space becomes %20 and é becomes %C3%A9. Choose encode, decode or parse, then type or paste your text.
- a b&c=d → a%20b%26c%3Dd
- é → %C3%A9
- € → %E2%82%AC
- 😀 → %F0%9F%98%80
Everything runs in this tab and nothing is uploaded. Non-ASCII text is converted to UTF-8 before it is escaped.
Scanned by NortonTM Safe Web
At a glance
- Price
- No charge
- Account
- None needed
- Standards
- RFC 3986 (URI), WHATWG URL Standard
- Modes
- Encode, decode and parse
- Character set
- UTF-8
- Upload
- None — the text stays in your browser tab
Percent-encoding of common characters
Each cell is produced by the encoder and decoder on this page. The symbol ␣ stands for a space.
| Character | encodeURIComponent | encodeURI | Form (+ for space) |
|---|---|---|---|
| ␣ | %20 | %20 | + |
| ! | ! | ! | %21 |
| " | %22 | %22 | %22 |
| # | %23 | # | %23 |
| $ | %24 | $ | %24 |
| % | %25 | %25 | %25 |
| & | %26 | & | %26 |
| ' | ' | ' | %27 |
| ( | ( | ( | %28 |
| ) | ) | ) | %29 |
| * | * | * | * |
| + | %2B | + | %2B |
| , | %2C | , | %2C |
| / | %2F | / | %2F |
| : | %3A | : | %3A |
| ; | %3B | ; | %3B |
| = | %3D | = | %3D |
| ? | %3F | ? | %3F |
| @ | %40 | @ | %40 |
| [ | %5B | %5B | %5B |
| ] | %5D | %5D | %5D |
| ~ | ~ | ~ | %7E |
| é | %C3%A9 | %C3%A9 | %C3%A9 |
| € | %E2%82%AC | %E2%82%AC | %E2%82%AC |
| 😀 | %F0%9F%98%80 | %F0%9F%98%80 | %F0%9F%98%80 |
| Escape | decodeURIComponent | decodeURI | Form |
|---|---|---|---|
| %2F | / | %2F | / |
| %3F | ? | %3F | ? |
| %23 | # | %23 | # |
| %20 | ␣ | ␣ | ␣ |
| %2B | + | %2B | + |
| %41 | A | A | A |
How to encode or decode a URL
Choose a mode
Pick Encode to escape text, Decode to read escaped text, or Parse to split a whole URL into protocol, host, path, query and fragment.
Choose a method
For one value, such as a query parameter, use the component method. For a complete address, use the whole-URL method. Use the form method for data sent by an HTML form.
Paste and copy
Type or paste your text. The result updates as you type and has a Copy button. A broken % sequence is reported with its position.
How percent-encoding works
Percent-encoding (RFC 3986) writes a byte as % followed by two hexadecimal digits. Text is first converted to UTF-8, so é is 2 bytes (%C3%A9), € is 3 bytes (%E2%82%AC) and 😀 is 4 bytes (%F0%9F%98%80). Letters, digits and - _ . ~ never need encoding. Reserved characters such as / ? # & = + and : have a job in a URL, so whether to encode them depends on where the text goes.
encodeURIComponent is for one piece of a URL, such as a query value: it encodes / ? # & = + and :. encodeURI is for a whole URL: it leaves those characters alone so the address keeps its structure. Form encoding (application/x-www-form-urlencoded) writes a space as + instead of %20 and also encodes ~ and ! ' ( ). Decoding rejects a % that is not followed by two hex digits and reports its position.
URL encoding questions
What is the difference between encodeURI and encodeURIComponent?
encodeURIComponent encodes everything except letters, digits and - _ . ! ~ * ' ( ), so it also encodes / ? # & = + and :. encodeURI keeps those characters so a whole URL still works. Use the component method for a value, such as a/b becoming a%2Fb, and encodeURI for a full address.
Why is a space %20 in one place and + in another?
%20 is the percent-encoding of a space and is valid anywhere in a URL. A + for a space belongs only to form encoding (application/x-www-form-urlencoded), the format of a query string sent by an HTML form. A real plus sign is %2B in both.
How do I encode Unicode characters in a URL?
Convert the text to UTF-8, then write each byte as %XX. é gives %C3%A9, € gives %E2%82%AC and 😀 gives %F0%9F%98%80. This page does that in every encode method.
Which characters must be encoded in a URL?
Spaces, double quotes, < and > and all non-ASCII characters are always encoded. Letters, digits and - _ . ~ never are. Reserved characters such as ? and & are encoded only when they are data and not part of the URL structure.
Why does decoding report an invalid percent sequence?
A % must be followed by two hexadecimal digits. 100% fails because nothing follows the %, and so does ab%zz. The page reports the position of the bad %. Escaped bytes that do not form valid UTF-8, such as %FF, are reported too.
Can this page split a URL into parts?
Yes. Parse mode uses the browser's URL parser to list the protocol, user name, host, port, path, query and fragment, and shows each query parameter with its decoded value. A password in a URL is reported as present and is never printed.