What Does %20 Mean in a URL? Every Common Encoded Character

What Does %20 Mean in a URL? Every Common Encoded Character

%20 in a URL means a space. URLs can't contain spaces or many special characters, so browsers replace them with a % sign and the character's code in hexadecimal. This is called percent-encoding or URL encoding. So my%20file.pdf is really my file.pdf.

Decode any URL instantly: paste it into the free URL Encoder & Decoder and click Decode.

Open the URL Decoder

Why URLs use %20 instead of spaces

A URL is only allowed to use a small set of characters: letters, numbers and a few symbols like -, _, . and ~. Some other characters have a special job. For example, ? starts the query string, & separates parameters and # starts the page fragment.

When your text contains a space or one of those special characters as normal text, it must be encoded so the browser doesn't misread it.

Common URL-encoded characters

CharacterEncodedWhy it is encoded
space%20 (or + in form data)Spaces are not allowed
!%21Reserved in some contexts
"%22Not allowed
#%23Starts a fragment
$%24Reserved
%%25Starts an encoding
&%26Separates parameters
'%27Reserved in some contexts
( )%28 %29Reserved in some contexts
+%2BCan mean a space in queries
,%2CReserved
/%2FSeparates path parts
:%3ASeparates scheme and port
;%3BReserved
=%3DSeparates key and value
?%3FStarts the query string
@%40Separates user info
[ ]%5B %5DReserved for IPv6

Non-English characters

Letters outside basic English, such as Urdu, Arabic, Hindi or accented letters, are first turned into UTF-8 bytes, and each byte is encoded. That is why one letter can become several codes. For example, the Urdu letter ا becomes %D8%A7, and é becomes %C3%A9. Browsers often show the readable version in the address bar but send the encoded one.

%20 vs +: what is the difference?

Both can mean a space, but in different places:

If you need a real plus sign in a query, encode it as %2B.

Double encoding: when you see %2520

%2520 means a URL was encoded twice. The first pass turned the space into %20, then the second pass turned the % into %25. This usually happens when code encodes a value that was already encoded. Decode once with the URL Decoder to see the original, and fix the code so it encodes only once.

How to encode and decode in code

LanguageEncode (space to %20)Decode
JavaScriptencodeURIComponent(value)decodeURIComponent(value)
PHPrawurlencode($value) (use urlencode for +)rawurldecode($value)
Pythonurllib.parse.quote(value, safe='') (use quote_plus for +)urllib.parse.unquote(value)

Three details catch people out:

The full background, with more examples, is in URL Encoding Explained.

Should you use spaces in file names and slugs?

No. Use hyphens. /how-to-take-a-screenshot is cleaner than /how%20to%20take%20a%20screenshot, and easier to share. The URL Slug Generator turns any title into a clean slug, and How to Create an SEO-Friendly URL Slug explains the rules.

Paste text or a link and encode or decode it in one click. Tick the whole-URL option to keep : / ? # & intact.

Encode or decode a URL

Frequently asked questions

What does %20 mean in a link?

It is an encoded space.

What does %2F mean?

It is an encoded forward slash (/).

Is %20 bad for SEO?

It works, but hyphens are cleaner and easier to read. Avoid spaces in URLs you create.

How do I remove %20 from a URL?

Decode it to read it. To get rid of it for good, rename the file or page with hyphens instead of spaces.

Related articles

← All guides