Security guidetext→%xx

URL encoding: %20, + and double encoding

A link can only safely carry letters, digits and a few symbols. Anything else, like a space, an & or an é, is swapped for a % code so the link doesn’t break. That swap is URL encoding.

You copy a link and it comes out full of %20 and %3A. Or a search term arrives with + where the spaces should be. Here’s what those codes mean, and how to fix a link that’s been mangled.

How it works

Every character has a number. URL encoding writes that number in hexadecimal (base 16) after a % sign. A space is number 32, which is 20 in hexadecimal, so it becomes %20.

hello world & more
hello%20world%20%26%20more

Letters outside basic English take more than one code. é becomes %C3%A9, and an emoji can take four codes. That’s normal.

The codes you’ll see most

CharacterEncodedWhy it needs encoding
space%20 (or +)Links can’t contain spaces
&%26Separates values after the ?
=%3DJoins a name to its value
?%3FStarts the list of values
#%23Jumps to a spot on the page
/%2FSeparates folders in the path
:%3AFollows https
+%2BCan mean a space, so a real plus sign must be encoded
%%25Starts every code

Letters, digits and - _ . ~ never need encoding. They mean the same thing everywhere.

%20 or +?

Both stand for a space, but in different places:

  • %20 works anywhere in a link. It’s always safe.
  • + means a space only after the ?, where search terms and form values go. That’s how web forms send what you type. Search for “red shoes” and you’ll often see ?q=red+shoes.

So if you want an actual plus sign, like C++ or a phone number +44, it must be written as %2B. Otherwise it arrives as a space. This is one of the most common bugs in sign-up forms and email links.

Double encoding: what %2520 means

Double encoding happens when text that’s already encoded gets encoded again. The % in %20 is itself turned into %25, giving %2520.

my file.pdf
my%20file.pdf      ← encoded once (correct)
my%2520file.pdf    ← encoded twice

Visit the second link and the server looks for a file literally called my%20file.pdf, which doesn’t exist. You get a 404.

How to spot it: look for %25 followed by two more characters, like %2520, %253A or %252F.

How to fix it: decode the text once, and check it. If it still has % codes where you expect plain characters, decode it again. Then find the step that encodes twice. It’s usually a link builder or plugin encoding a value that someone already encoded by hand.

Encode the part, not the whole link

If you’re putting your own text into a link, encode just that text, not the finished link. Encoding a whole link turns its :// and ? into codes and breaks it.

Right:  https://example.com/search?q=fish%20%26%20chips
Wrong:  https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dfish%20%26%20chips

The one exception is when a whole link goes inside another link, such as a redirect. Then the inner link is encoded in full.

Encode or decode yours

The encode and decode tool converts text to and from URL encoding in both directions as you type. It also handles Base64 and HTML entities. Paste a mangled link to read it, or paste plain text to make it safe for a link. A + is read as a space when decoding, and %2B as a plus sign. Your text stays on your device.

Put it to work

Free, no sign-up, and everything you enter stays on your device.

More guides

All guides →