URL decode and encode online
URL decode turns caf%C3%A9%20%26%20bar back into café & bar. Encode text safely for a link, or split a long URL into readable parts. Nothing leaves your browser.
Result
The result appears here as you type.
How to use it
- Pick Decode, Encode or Split a URL into parts.
- Paste your text. For encoding, choose whether it is a single value, a whole URL or a form body.
- Copy the result. In split mode, the scheme, host, port, path and fragment are listed, and the query parameters appear as a decoded table.
How percent-encoding works
A URL may only contain a small set of ASCII characters. Anything else is written as % followed by two hex digits for each byte, after the text is turned into UTF-8 bytes (RFC 3986, section 2.1). A space is one byte, %20. The letter é is two bytes in UTF-8, so it becomes %C3%A9; the Turkish İ becomes %C4%B0, so İstanbul is %C4%B0stanbul.
Decoding reverses it: every %XX becomes a byte, and the bytes are read as UTF-8. Hex digits may be upper or lower case; RFC 3986 says encoders should write upper case, as this tool does.
Which characters get encoded
RFC 3986 splits characters into three groups. What happens to them depends on where in the URL they appear.
| Group | Characters | In a query value |
|---|---|---|
| Unreserved | A–Z a–z 0–9 - . _ ~ | Never encoded |
| Reserved, general delimiters | : / ? # [ ] @ | Encoded, or they split the URL |
| Reserved, sub-delimiters | ! $ & ' ( ) * + , ; = | Encoded, or & and = break the parameters |
| Everything else | Space, %, ", <, non-ASCII letters | Always encoded |
Which encoding to choose
- A query value or path segment encodes everything except the unreserved characters, so
&,=and/inside a value cannot break the URL:a+b=cbecomesa%2Bb%3Dc. Use it for almost everything. It matches JavaScript’sencodeURIComponent, plus! ' ( ) *, which that function leaves alone. - A whole URL keeps the characters that give a URL its structure, such as
/ ? & = #, and encodes spaces and non-ASCII characters, likeencodeURI:https://example.com/a b?q=çbecomeshttps://example.com/a%20b?q=%C3%A7. It cannot protect an&that belongs inside a value; encode such values one by one. - A form body is what an HTML form sends as
application/x-www-form-urlencoded: like a query value, but spaces become+, as the WHATWG URL Standard specifies.
Common codes you will see
These come up in logs, redirects and tracking links. A literal percent sign is always %25.
| Code | Character | Code | Character |
|---|---|---|---|
%20 | space | %3D | = |
%2F | / | %3A | : |
%26 | & | %3F | ? |
%2B | + | %23 | # |
%25 | % | %40 | @ |
Double encoding, plus signs and other traps
Double encoding. Encode text twice and the % itself gets encoded: a space becomes %2520, because %25 is the percent sign. RFC 3986 warns against encoding or decoding the same string more than once. If decoding once still leaves codes like %20, the value was encoded twice; decode the result again.
Plus signs. Servers decode + in a query string as a space, because HTML forms send spaces that way. A real plus sign is sent as %2B. Untick “Treat + as a space, as HTML forms send it” when decoding a path or anything that did not come from a form.
Errors. A % must be followed by two hex digits. The tool names the position of a broken code such as %G1 or a lone %. If the codes are valid but do not form UTF-8, the text was encoded in another character set, such as Windows-1254 on older Turkish sites.
Length. No standard fixes a maximum URL length; HTTP (RFC 9110) recommends that software support at least 8,000 octets. Long Base64 values in URLs are best made URL-safe first with the Base64 encoder. To turn a title into a clean path segment without any codes, use the slug generator; for & and other HTML codes, use HTML entities.
Related tools
Questions people ask
How do I decode a URL?
Choose Decode and paste the URL or the encoded text. Every %XX code is turned back into its character as you type; copy the result.
What is %20 in a URL?
A space. 20 is the hex code of the space character, so %20 stands for one space. In a form body or query string a space may also appear as +.
What do %3D and %3A mean?
%3D is the equals sign (=) and %3A is the colon (:). They are encoded when they are part of a value, so they do not split the URL.
What is the difference between encodeURI and encodeURIComponent?
encodeURI leaves the characters that structure a URL, such as / ? & and #, untouched. encodeURIComponent encodes them too, so it is the right choice for a single value.
Why do I get “not a valid percent code”?
A % must be followed by two hex digits. A lone % or something like %G1 cannot be decoded. A literal percent sign is written %25.
Can it decode Turkish characters?
Yes, when they were encoded as UTF-8, which every modern browser does: %C4%B1 is ı and %C5%9F is ş.
Is my URL sent anywhere?
No. Everything runs in your browser.