Computers don't understand letters, they only understand numbers. So back in the early days of computers, someone sat down and associated each letter and punctuation mark they wanted to represent with a number (actually, many people did this, but we're only going to talk about one). This was called ASCII representation . In ASCII, the number associated with the space was 32, which in hexadecimal is 20 (numbers in computers are usually in hexadecimal). So that explains where the 20 comes from, but why is in the URL? It's because in the early days of the internet, they decided that URLs should only have a certain set of letters and punctuation allowed in them. Spaces weren't one of those. But people still wanted to communicate things like spaces in URLs, even though they couldn't actually put a space. So they decided that you could use a percent sign (%) plus the ASCII number of the thing you actually wanted. So wherever in a URL that you want to communicate a space, you can put "%20" and whatever program is looking at the URL will know that a space should go there. Answer from omnilynx on reddit.com
๐ŸŒ
DEV Community
dev.to โ€บ arenasbob2024cell โ€บ url-encoding-explained-what-20-3a-and-2f-actually-mean-8nh
URL Encoding Explained: What , :, and / Actually Mean - DEV Community
3 weeks ago - They're percent-encoded characters -- and understanding them will save you from some truly annoying debugging sessions. URLs can only contain a limited set of ASCII characters. Anything outside that set gets converted to its UTF-8 byte value, ...
๐ŸŒ
FullHost
fullhost.com โ€บ blog โ€บ what-does-20-mean-in-a-web-address
What Does Mean in a Web Address? | FullHost
December 10, 2020 - Every Web page on the Internet has a uniform resource locator, or URL, such as โ€œhttp://www.example.com/products.htmlโ€œ. A URL cannot contain a space, which presents a problem if an HTML file is named โ€œproducts and services.html.โ€ Spaces and other characters that arenโ€™t allowed in a ...
Discussions

ELI5: Why do URLs have %20 in them to represent a space?
Computers don't understand letters, they only understand numbers. So back in the early days of computers, someone sat down and associated each letter and punctuation mark they wanted to represent with a number (actually, many people did this, but we're only going to talk about one). This was called ASCII representation . In ASCII, the number associated with the space was 32, which in hexadecimal is 20 (numbers in computers are usually in hexadecimal). So that explains where the 20 comes from, but why is in the URL? It's because in the early days of the internet, they decided that URLs should only have a certain set of letters and punctuation allowed in them. Spaces weren't one of those. But people still wanted to communicate things like spaces in URLs, even though they couldn't actually put a space. So they decided that you could use a percent sign (%) plus the ASCII number of the thing you actually wanted. So wherever in a URL that you want to communicate a space, you can put "%20" and whatever program is looking at the URL will know that a space should go there. More on reddit.com
๐ŸŒ r/explainlikeimfive
386
9104
December 14, 2018
URL encoding the space character: + or ? - Stack Overflow
2009-10-27T23:36:09.207Z+00:00 ... Hi, I am confused too, When user submit the html form, how the form encode the space ? with which character? Is the result browser-dependent? 2012-11-07T06:34:46.027Z+00:00 ... And the URLEncoder.encode() method in Java converts it in + as well. More on stackoverflow.com
๐ŸŒ stackoverflow.com
encoding - The origin on why ' ' is used as a space in URLs - Stack Overflow
I am interested in knowing why ' ' is used as a space in URLs, particularly why was used and why we even need it in the first place. More on stackoverflow.com
๐ŸŒ stackoverflow.com
How to remove %20 in urls??
You're using spaces, the escape character is %20 for space. More on reddit.com
๐ŸŒ r/django
22
11
November 18, 2020
๐ŸŒ
Tutorialspoint
tutorialspoint.com โ€บ html โ€บ html_url_encoding.htm
HTML - URL Encoding
The encoding notation replaces ... common special characters is a white space. You can't type a space in a URL directly. A space position in the character set is 20 hexadecimals....
๐ŸŒ
Reddit
reddit.com โ€บ r/explainlikeimfive โ€บ eli5: why do urls have %20 in them to represent a space?
r/explainlikeimfive on Reddit: ELI5: Why do URLs have in them to represent a space?
December 14, 2018 - Now we split our fingers into two groups of four. We'd get 0010 and 0000. 0010 means 2, and 0000 means 0, so we would say that 32 converted to hexadecimal is 20. So when a URL wants to represent something like a space, it uses .
๐ŸŒ
Quora
quora.com โ€บ What-is-does-20-and-30-mean-in-URL
What is does and 0 mean in URL? - Quora
Answer (1 of 4): That's URL Percent Encoding. It's used to place characters in URLs that aren't typically allowed. The encoding is a percent sign followed by an ASCII value (in hexadecimal).
๐ŸŒ
Quora
quora.com โ€บ What-do-20-and-0a-mean-in-a-URL
What do and mean in a URL? - Quora
One way for information to travel forward from page to page in a website is to pass it as part of the URL. This would make it impossible to pass forward something with a space. One could not pass โ€œRed Shoes ...
๐ŸŒ
Codemia
codemia.io โ€บ knowledge-hub โ€บ path โ€บ url_encoding_the_space_character__or_20
URL encoding the space character + or %20?
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises
Find elsewhere
Top answer
1 of 6
540

From Wikipedia (emphasis and link added):

When data that has been entered into HTML forms is submitted, the form field names and values are encoded and sent to the server in an HTTP request message using method GET or POST, or, historically, via email. The encoding used by default is based on a very early version of the general URI percent-encoding rules, with a number of modifications such as newline normalization and replacing spaces with "+" instead of "%20". The MIME type of data encoded this way is application/x-www-form-urlencoded, and it is currently defined (still in a very outdated manner) in the HTML and XForms specifications.

So, the real percent encoding uses %20 while form data in URLs is in a modified form that uses +. So you're most likely to only see + in URLs in the query string after an ?.

2 of 6
450

This confusion is because URLs are still 'broken' to this day.

From a blog post:

Take "http://www.google.com" for instance. This is a URL. A URL is a Uniform Resource Locator and is really a pointer to a web page (in most cases). URLs actually have a very well-defined structure since the first specification in 1994.

We can extract detailed information about the "http://www.google.com" URL:

+---------------+-------------------+
|      Part     |      Data         |
+---------------+-------------------+
|  Scheme       | http              |
|  Host         | www.google.com    |
+---------------+-------------------+

If we look at a more complex URL such as:

"https://bob:[email protected]:8080/file;p=1?q=2#third"

we can extract the following information:

+-------------------+---------------------+
|        Part       |       Data          |
+-------------------+---------------------+
|  Scheme           | https               |
|  User             | bob                 |
|  Password         | bobby               |
|  Host             | www.lunatech.com    |
|  Port             | 8080                |
|  Path             | /file;p=1           |
|  Path parameter   | p=1                 |
|  Query            | q=2                 |
|  Fragment         | third               |
+-------------------+---------------------+

https://bob:[email protected]:8080/file;p=1?q=2#third
\___/   \_/ \___/ \______________/ \__/\_______/ \_/ \___/
  |      |    |          |          |      | \_/  |    |
Scheme User Password    Host       Port  Path |   | Fragment
        \_____________________________/       | Query
                       |               Path parameter
                   Authority

The reserved characters are different for each part.

For HTTP URLs, a space in a path fragment part has to be encoded to "%20" (not, absolutely not "+"), while the "+" character in the path fragment part can be left unencoded.

Now in the query part, spaces may be encoded to either "+" (for backwards compatibility: do not try to search for it in the URI standard) or "%20" while the "+" character (as a result of this ambiguity) has to be escaped to "%2B".

This means that the "blue+light blue" string has to be encoded differently in the path and query parts:

"http://example.com/blue+light%20blue?blue%2Blight+blue".

From there you can deduce that encoding a fully constructed URL is impossible without a syntactical awareness of the URL structure.

This boils down to:

You should have %20 before the ? and + after.

Source

๐ŸŒ
ESO
eso.org โ€บ ~ndelmott โ€บ url_encode.html
HTML URL-encoding Reference
Below is a reference of ASCII characters in URL-encoding form (hexadecimal format).
๐ŸŒ
W3Schools
w3schools.com โ€บ tags โ€บ ref_urlencode.ASP
HTML URL Encoding Reference
Click the "URL Encode" button to see how the JavaScript function encodes the text. Note: The JavaScript function encodes space as . Your browser will encode input, according to the character-set used in your page. The default character-set in HTML5 is UTF-8.
๐ŸŒ
CanSpace Solutions
canspace.ca โ€บ home โ€บ what does %20 mean in a web address?
What Does Mean in a Web Address? - Canada's Leading Web Hosting and Domain Name Provider
June 19, 2025 - Each code corresponds to a specific character based on a standard called ASCII (American Standard Code for Information Interchange). The space character is number 32 in ASCII, and its hexadecimal version is 20...
๐ŸŒ
Wikipedia
en.wikipedia.org โ€บ wiki โ€บ Percent-encoding
Percent-encoding - Wikipedia
3 weeks ago - Since the publication of RFC 1738 in 1994 it has been specified that schemes that provide for the representation of binary data in a URI must divide the data into 8-bit bytes and percent-encode each byte in the same manner as above. Byte value 0x0F, for example, should be represented by , but byte value 0x41 can be represented by A, or A. The use of unencoded characters for alphanumeric and other unreserved characters is typically preferred, as it results in shorter URLs.
Top answer
1 of 3
69

It's called percent encoding. Some characters can't be in a URI (for example #, as it denotes the URL fragment), so they are represented with characters that can be (# becomes %23)

Here's an excerpt from that same article:

When a character from the reserved set (a "reserved character") has special meaning (a "reserved purpose") in a certain context, and a URI scheme says that it is necessary to use that character for some other purpose, then the character must be percent-encoded. Percent-encoding a reserved character involves converting the character to its corresponding byte value in ASCII and then representing that value as a pair of hexadecimal digits. The digits, preceded by a percent sign ("%") which is used as an escape character, are then used in the URI in place of the reserved character. (For a non-ASCII character, it is typically converted to its byte sequence in UTF-8, and then each byte value is represented as above.)

The space character's character code is 32:

> ' '.charCodeAt(0)
32

Which is 20 in base-16:

> ' '.charCodeAt(0).toString(16)
"20"

Tack a percent sign in front of it and you get %20.

2 of 3
3

Because URLs have strict syntactic rules, like / being a special path separator character, spaces not being allowed in a URL and all characters having to be a certain subset of ASCII. To embed arbitrary characters in URLs regardless of these restrictions, bytes can be percent encoded. The byte x20 represents a space in the ASCII encoding (and most other encodings), hence %20 is the URL-encoded version of it.

๐ŸŒ
Reddit
reddit.com โ€บ r/django โ€บ how to remove %20 in urls??
r/django on Reddit: How to remove in urls??
November 18, 2020 -

Can anyone help me figure out how to remove %20 from the urls

Example:

Currently my link is like this :-https://localhost/Django%20Tutorial%/hello%20world/

But i wanted it like this:-https://localhost/DjangoTutorial/helloworld/

Sorry if it is a basic question! I just can't figure it out, i googled it but did not get a correct answer.

We all are soo blessed to have a community like this in reddit. There are many really good people who spend their time to help us out when we are stuck at something!! Thank you so much for doing that!!

๐ŸŒ
Quora
quora.com โ€บ What-is-the-20-we-see-in-many-URLs
What is the ' ' we see in many URLs? - Quora
Answer (1 of 5): It represents a space in text. The percent sign is a marker that the hexadecimal code for a character follows, and 20 is the ASCII code for a space. The URL parser, the bit of code that reads the URL which may include more ...
๐ŸŒ
Blooberry
blooberry.com โ€บ indexdot โ€บ html โ€บ topics โ€บ urlencoding.htm
URL Encoding - BlooBerry
URL Encoding ยท URL Encoding (or: 'What are those " " codes in URLs?') ยท = Index DOT Html by Brian Wilson =
๐ŸŒ
DEV Community
dev.to โ€บ lico โ€บ understanding-how-spaces-are-encoded-20-with-encodeuri-vs-with-url-2d6c
Why Spaces Are Encoded: with encodeURI and +(plus) with URL / Differences Between encodeURI and URL - DEV Community
November 28, 2024 - The URL API encodes according to RFC3986, which is a more recent URI specification. If you need to achieve this behavior with encodeURI, refer to this. - encodeURIComponent encoding for RF3986). The URLSearchParams encodes following the rule of the percent encoding. According to the documentation, it replaces spaces with '+'. While I couldn't find the specification in RFC for this behavior, MDN's encodeURIComponent documentation states:
๐ŸŒ
ITU Online
ituonline.com โ€บ itu online โ€บ tech terms definitions โ€บ what is url encoding
What Is URL Encoding - ITU Online IT Training
June 7, 2024 - Hexadecimal Conversion: Convert ... (โ€ โ€œ) has an ASCII code of 32. In hexadecimal, 32 is represented as โ€œ20โ€. Therefore, a space in a URL is encoded as โ€œ โ€....
๐ŸŒ
TiddlyWiki
talk.tiddlywiki.org โ€บ developers
URL encoding using a `+` instead of ` ` for a space - #49 by Scott_Sauyet - Developers - Talk TW
September 14, 2023 - Would there be any interest from the community โ€“ and any support from the core team โ€“ for changing the URL fragment encoding to allow + instead of to encode a space? Itโ€™s simply a matter of prettier URLs, but to me โ€ฆ
๐ŸŒ
IP Address Lookup
iplocation.net โ€บ url-encodes
URL Encoding | Percent Encoding
URL encoding is also known as percent encoding. Characters that are not allowed in a URL are replaced with a โ€œ%โ€ symbol followed by two hexadecimal digits that represent the ASCII code of the character.