To URL decode, replace each %XX with the byte it names and read the bytes as UTF-8; to encode, do the reverse for every character outside A–Z, a–z, 0–9 and – . _ ~. For example, café menu becomes caf%C3%A9%20menu, because é is the two bytes C3 A9 and a space is 20.
About this tool
Links break when a query value carries a space, an ampersand or a letter outside ASCII. This page percent-encodes text the way RFC 3986 describes and decodes it back. Encode mode offers three styles: a query value, where a space is %20 and even / ? & = are escaped; form data, where a space becomes + as an HTML form sends it; and a whole URL, which keeps the colon, slashes, ? and & so the link still opens. Decode mode turns %XX codes into readable text and can read + as a space. Each result shows how many percent escapes it holds. One limit: decoding assumes UTF-8, so very old links written in Latin-1 or Shift_JIS bytes are rejected rather than shown as garbled letters.
How to use it
Choose Encode or Decode
Encode turns plain text into %XX codes; Decode turns codes back into text.
Paste or open your text
Type into the box or open a .txt file; it is read in your browser and the result updates as you type.
Pick the encoding style
Query value for one parameter, Form data for + spaces, Whole URL to keep a full link working.
Set the plus rule when decoding
Leave 'Read + as a space' on for query strings; turn it off when a + means a real plus sign.
Examples
An accented capital A
Mode
Encode
Text to encode
À
Encode as
Query value
ResultResult: %C3%80
Percent escapes: 2
Result length: 6
Query value (RFC 3986): every character except A–Z a–z 0–9 – . _ ~ becomes UTF-8 bytes written as %XX; a space becomes %20.
2 percent escapes; 1 characters in, 6 out.
À is two bytes in UTF-8, C3 and 80, so it becomes two percent escapes.
A query string from a link
Mode
Decode
Encoded text or URL
caf%C3%A9+menu%3F
Read + as a space
Yes
ResultResult: café menu?
Percent escapes: 3
Result length: 10
Each + was read as a space first (form data rule).
Each %XX was read as one byte and the bytes were read as UTF-8 text.
3 percent escapes; 17 characters in, 10 out.
The + is read as a space, %C3%A9 is the two UTF-8 bytes of é and %3F is a question mark.
A search phrase as form data
Mode
Encode
Text to encode
red shoes size 9
Encode as
Form data
ResultResult: red+shoes+size+9
Percent escapes: 0
Result length: 16
Form value: every character except A–Z a–z 0–9 – . _ ~ becomes UTF-8 bytes written as %XX, then each space (%20) is written as +.
0 percent escapes; 16 characters in, 16 out.
HTML forms send each space as a plus sign, which is how most search boxes put words in the address bar.
How it is calculated
encoded character = % + two hex digits for each UTF-8 byte (RFC 3986 §2.1); unreserved A–Z a–z 0–9 - . _ ~ stay as they are
Each character is first turned into its UTF-8 bytes: one byte for ASCII, two for é or À, three for most Chinese characters, four for an emoji. In Query value style every byte that is not an unreserved character is written as % plus two upper-case hex digits, so a space is %20 and & is %26; the characters ! ' ( ) * are escaped as well, which JavaScript's encodeURIComponent leaves alone. Form data applies the same rule and then writes %20 as +, following the WHATWG application/x-www-form-urlencoded serializer. Whole URL leaves the reserved delimiters : / ? # [ ] @ ! $ & ' ( ) * + , ; = untouched. Decoding reverses it: each %XX becomes a byte and the byte sequence must be valid UTF-8, otherwise the tool reports which part is broken.
Do not use it to hide data; percent-encoding is readable by anyone and is not encryption.
For binary files or images in a URL, use Base64 or a data URL instead.
Links in a legacy code page such as Windows-1252 will not decode, since UTF-8 is assumed.
Common mistakes
Encoding a whole link in Query value style turns https:// into https%3A%2F%2F and breaks it.
Encoding twice gives %2520 instead of %20; decode once more to recover the text.
Reading + as a space in a path, where + is a literal plus sign.
Leaving a bare % in a value; it must be written as %25.
Frequently asked questions
How do I URL decode a string?
Switch to Decode and paste the string. Every %XX pair is read as one byte, and the bytes are read as UTF-8, so %C3%A9 becomes é and %20 becomes a space. If the result still contains %25 or other codes, the string was encoded twice; paste the result back in and decode again.
How do I URL encode a space?
Inside a path or a query value, a space is %20, the hex code of byte 0x20. In form data sent by an HTML form, and in many search URLs, a space is written as + instead. Pick Query value for %20 or Form data for +; both decode back to the same space.
How do I URL encode and decode in JavaScript?
Use encodeURIComponent(value) for one query value and decodeURIComponent(text) to reverse it; encodeURI keeps the slashes and ? of a full link. Note that encodeURIComponent leaves ! ' ( ) * alone, while this page escapes them as RFC 3986 suggests. URLSearchParams writes spaces as +, like the Form data style here.
How do I URL encode and decode in Python?
Import urllib.parse. quote(text, safe='') gives the Query value result, quoteplus(text) gives the Form data result with + for spaces, and unquote or unquoteplus reverse them. By default quote keeps / unescaped, so pass safe='' when encoding a single parameter.
How do I URL encode in Java?
java.net.URLEncoder.encode(text, StandardCharsets.UTF8) follows the form rule, so spaces become + and * stays as it is. For %20 spaces, replace + with %20 in the output, or build the link with java.net.URI. URLDecoder.decode(text, StandardCharsets.UTF8) reverses it and treats + as a space.
What does %3D mean in a URL decode?
%3D is the byte 0x3D, the equals sign. It shows up when a value itself contains = so that it is not mistaken for the separator between a parameter name and its value; Base64 tokens ending in == often appear as %3D%3D.
Cite this tool
Using this tool in an assignment, article or report? Copy a citation, or a link for your website.