%20 is a space

%20 is a space.

Character" "
NameSpace
Encoded%20
Also seen as+
ReservedNo

Why it breaks things

A URL cannot contain a raw space. The rule comes from how URLs travel: in an HTTP request the URL sits on the first line, followed by a space and then the protocol version. A space inside the URL would split that line in the wrong place, so the server would read only part of your address.

Browsers hide this from you. Type a space into the address bar and the browser quietly replaces it with %20 before sending the request.

The trouble starts when a URL is built by a program instead of typed by a person. Paste a URL with a raw space into an email, a chat message, or a configuration file and it will often be cut in half at the space. That is why a file named blue shirt.jpg becomes blue%20shirt.jpg in a link.

Real examples

Without encoding

https://example.com/files/blue shirt.jpg

With encoding

https://example.com/files/blue%20shirt.jpg

The raw space cuts the link short. Many programs will only see the part up to 'blue'.

Without encoding

https://example.com/search?q=blue shirt

With encoding

https://example.com/search?q=blue+shirt

In a query string a plus sign is also read as a space, and is more common in search links.

Decode something

History

    Nothing yet.

    History stays in this browser. It is never sent to our server.

    Common questions

    Why do I sometimes see + instead of %20?
    Both mean a space, but in different places. HTML forms encode spaces as + inside the query string, which is the part after the question mark. Everywhere else a space is %20. In the path part of a URL, a + is a literal plus sign, not a space.
    Is %20 the same as a non-breaking space?
    No. %20 is a normal space, character 32. A non-breaking space is a different character and encodes as %C2%A0 in UTF-8.
    Can I just leave spaces in my URLs?
    Your browser will usually fix it for you, but nothing else will. Anything that passes the URL along as text — an email client, a chat app, a config file, a log parser — is likely to break it at the space.
    What is %2520?
    That is a space that went through an encoder twice. The percent sign in %20 got encoded again into %25, leaving %2520. Decode it twice to get a space back.