URL Encode / Decode

Paste text or a web address to percent-encode it, or switch to Decode to turn codes such as %20 and %26 back into readable characters. Results update as you type.

TechFreeNo sign-upWorks on phones
Direction

Encoded


–Characters changed
–Percent codes
–Length after
Spaces and plus signs–
Length–
Rule used–

This tool runs in your browser. Nothing you type is uploaded or saved, and there is nothing to install or sign up for.

What percent-encoding does to a web address

A web address can only carry a small set of characters safely. A space, a quote mark or a letter with an accent may be cut off, changed or misread on the way to the server. Percent-encoding fixes that by replacing each risky character with a percent sign and two hex digits that stand for its byte value. A space becomes %20 and an ampersand becomes %26.

Some characters are risky for a different reason: they already have a job. A question mark starts the query, an ampersand separates one setting from the next, and a hash sign starts the fragment. When one of those appears inside a value, such as a search for rock & roll, it has to be encoded or the address falls apart. This tool encodes text for you and decodes addresses that are already full of percent codes.

Steps for encoding and decoding

  1. Set Direction to Encode or Decode.
  2. Paste your text or address into Text or URL.
  3. When encoding, choose What to encode. Pick One value for a search term, a file name or anything that will sit inside a larger address. Pick A whole URL when you paste a complete address and want its structure left alone.
  4. Leave Spaces on %20 unless you are building form data, where a space is written as a plus sign.
  5. Press Copy result. Use result as input sends the answer back through the other direction, and Reset restores the example.

If the text contains a question mark, a table appears that splits the query string into names and values so you can read each setting on its own line.

Worked example: rock & roll/jazz = 100% fun

The page opens with the text rock & roll/jazz = 100% fun, set to encode as one value. The result is:

rock%20%26%20roll%2Fjazz%20%3D%20100%25%20fun

Nine of the 27 characters changed: five spaces, the ampersand, the slash, the equals sign and the percent sign. Each one turned into a three-character code, so the text grew from 27 to 45 characters.

Switch What to encode to A whole URL and the same text gives rock%20&%20roll/jazz%20=%20100%25%20fun. Now only six characters change, because the ampersand, slash and equals sign are treated as parts of the address and kept. With the form style for spaces, the first result becomes rock+%26+roll%2Fjazz+%3D+100%25+fun.

Which characters are changed, and why two modes exist

The URI standard, RFC 3986 (read December 2026), names a short list of characters that have no reserved purpose and never need encoding: uppercase and lowercase letters, decimal digits, hyphen, period, underscore and tilde. Everything else is either reserved for the structure of an address or not allowed as it stands.

This tool uses the two encoding functions built into your browser. Both leave the letters, digits and - _ . ! ~ * ' ( ) untouched. The whole-URL function also keeps the characters that hold an address together, which is why it must not be used on a single value.

CharacterOne valueWhole URL
space%20%20
%%25%25
&%26kept
+%2Bkept
/%2Fkept
:%3Akept
=%3Dkept
?%3Fkept
#%23kept
@%40kept

Characters outside plain English are first turned into UTF-8 bytes, and every byte gets its own code. The word café becomes caf%C3%A9, and a check mark becomes %E2%9C%93, three codes for one symbol.

Reading a query string

Paste https://example.com/search?q=cats%20and%20dogs&page=2#top with the direction on Decode. The decoded address reads https://example.com/search?q=cats and dogs&page=2#top, and the table lists two settings: q with the value cats and dogs, and page with the value 2. The part after the hash sign is not sent as a setting, so it is left out of the table.

This is useful for checking tracking links, for debugging a form, and for seeing exactly what a long shared link contains before you click it.

Mistakes that break links

  • Encoding twice. Encode %20 again and it becomes %2520, because the percent sign itself gets encoded. If a link shows %25 where you did not expect it, decode once and check.
  • Using the whole-URL mode for a value. An ampersand inside a search term stays as it is and splits your value in two. Encode each value on its own with One value.
  • Plus signs. In form data a plus sign means a space, but in the path of an address it is just a plus sign. Choose the Spaces setting that matches where the text came from.
  • A bare percent sign. Decoding 100% gives an error because the percent sign is not followed by two hex digits. Written correctly it is 100%25.
  • Old character sets. Codes such as %FF on their own are not valid UTF-8, so the tool reports them instead of guessing.

Percent-encoding makes text safe to transport. It does not hide it: anyone can decode an address, so never put passwords in one.

Practical tips for students and site builders

When you build a link by hand, write the fixed parts first, then encode each value separately and drop it in. For page addresses that people will read, it is better to avoid the problem and use a clean name made of lowercase words and hyphens, which the slug generator produces from any title. If the link is going on a poster or worksheet, turn the finished address into a code with the QR code generator.

Do not confuse this with other kinds of escaping. Text shown inside a web page needs entities such as &, which the HTML entity encoder writes, and binary data squeezed into text uses the Base64 encoder. More helpers like these sit with the other tech tools, and every calculator and converter is listed on the main tools page.

Frequently asked questions

What does %20 mean in a URL?

%20 is the percent-encoded form of a space. The number 20 is the hex value of the space character, so a decoder turns %20 back into a single space.

What is the difference between encoding one value and a whole URL?

Encoding one value changes every special character, including / ? : and the ampersand, so the value cannot break the address around it. Encoding a whole URL keeps those characters because they are part of the address structure and only fixes things like spaces.

Should a space be %20 or a plus sign?

Both are used. %20 works everywhere in an address, while the plus sign means a space only in form data and query strings. When in doubt, use %20.

How do I write a real percent sign in a URL?

Write it as %25. A percent sign that is not followed by two hex digits is not valid percent-encoding and will cause a decoding error.

Why did my link get %2520 in it?

The text was encoded twice. The first pass turned a space into %20 and the second pass turned the percent sign into %25, giving %2520. Decode it once to get back to %20.

How are accented letters and emoji encoded?

They are converted to UTF-8 bytes first, and each byte becomes one percent code. For example the e with an acute accent is two bytes and is written as %C3%A9.

Related tools

Browse all free tools →