What Is URL Encoding %20? Why It Appears in Links

By Toolinga Editorial Team · Updated · 7 min read

You paste a link into a chat message and instead of a clean address see something like https://example.com/my%20file.html. It still works when clicked, but the %20 in the middle looks like a glitch. It is not. If you have ever wondered what is url encoding %20, the short answer is simple: %20 is how a space is written inside a URL, and url encoding is the system that makes that translation possible.

Every web address has to follow strict rules about which characters it may contain, and a space is not one of them. So whenever a file name or search term containing a space ends up in a URL, the space becomes %20. Once you grasp this one idea, a whole family of strange-looking links and broken downloads suddenly makes sense.

Why URLs Can't Contain Spaces

A URL is not just a label. It is an instruction your browser, a server, and every computer in between must read in exactly the same way. Spaces cause problems because a space is used as a separator in many places on the internet: it marks the end of one thing and the start of another.

Imagine a URL with a raw space, such as https://example.com/my file.html. Pasted into an email or document, the software may treat the address as ending at the space, so only https://example.com/my becomes clickable. The rest is left behind as plain text, and the link breaks. Even when software keeps the whole thing together, a server receiving a raw space must guess where the address ends — a recipe for errors.

Spaces are the most common problem character because file names routinely contain them: "my file.html", "summer photos.zip", "final report.pdf". The moment such a file is shared as a link, its spaces need handling. Url encoding is the standard solution: every character not allowed in a URL is replaced by a safe, three-character code. The rule comes from the internet standard RFC 3986, which defines how URLs are written: letters, digits, and a small set of punctuation marks may appear directly, and everything else must be percent-encoded.

What Is URL Encoding %20? The % System Explained

Url encoding, also called percent-encoding, works like this: each character that cannot appear directly in a URL is replaced by a percent sign (%) followed by two hexadecimal digits. Hexadecimal is a base-16 number system using the digits 0–9 and the letters A–F, and those two digits identify the character's code value. A space has the code value 32 in decimal, which is 20 in hexadecimal — hence %20.

Here are the most common encodings you will meet:

  • %20 — a space
  • %2F — a forward slash (/)
  • %3F — a question mark (?)
  • %26 — an ampersand (&)
  • %3D — an equals sign (=)
  • %25 — a percent sign itself (%)

That last one matters: because % is the escape character, a literal percent sign must itself be encoded as %25. Otherwise a browser reading %20 could not tell whether you meant "a space" or "the characters percent, two, zero". Every % followed by two hex digits always means exactly one encoded character, which is what makes the system unambiguous.

Non-ASCII characters follow the same system in two steps: first the character is converted into its UTF-8 bytes, then each byte is percent-encoded. The letter é becomes two bytes in UTF-8, C3 and A9, so it appears in a URL as %C3%A9. That is why a page about a café might have a URL containing caf%C3%A9 — simply "café" in a form every browser and server can read safely.

Characters You Must Encode

RFC 3986 divides characters into two groups: unreserved characters, which may appear exactly as they are, and everything else, which must be encoded when it appears as data rather than as part of the URL's structure.

The unreserved characters are the letters A–Z and a–z, the digits 0–9, and just four punctuation marks: hyphen (-), underscore (_), period (.), and tilde (~). These never need encoding. If your file name or slug uses only these characters, its URL will look exactly like the original text — one reason clean, hyphenated slugs are so popular.

Then there are the reserved characters, which have special jobs inside a URL: / separates path segments, ? starts the query string, & separates query parameters, and = separates a parameter name from its value. When one of these appears as ordinary data — an & inside a search term, for example — it must be encoded, or the browser will mistake it for structure. A search for "fish & chips" that left the & raw would be read as two separate parameters instead of one term.

Beyond those, any character outside the basic ASCII set — accented letters, characters from other scripts, emoji — must be percent-encoded via UTF-8. So the practical rule is simple: if a character is not a letter, digit, hyphen, underscore, period, or tilde, and it is not doing a structural job in the URL, encode it. When in doubt, encode: an encoded character is always safe, while a raw special character can silently change a link's meaning. Just do not encode the structural characters themselves — encoding the slashes in a path would send the link somewhere entirely different.

A Before-and-After Example

The easiest way to understand url encoding is to watch it happen: three realistic examples showing original text and the encoded URL that results.

Example 1: a file name with a space. You upload a document called "my file.html" to your website. The raw file name cannot go into a link as-is, so the space becomes %20:

  • Before: https://example.com/my file.html
  • After: https://example.com/my%20file.html

The second version is a valid, clickable link that works in emails, documents, and chat messages; the first risks breaking at the space.

Example 2: a search query with special characters. Suppose someone searches for "café & tea = breakfast". The query string must encode the space, the ampersand, the equals sign, and the accented é:

  • Before: https://example.com/search?q=café & tea = breakfast
  • After: https://example.com/search?q=caf%C3%A9%20%26%20tea%20%3D%20breakfast

Notice what each code does: %C3%A9 is the é, %20 is each space, %26 keeps the & from splitting the query into pieces, and %3D keeps the = from being read as a new parameter boundary. Without encoding, the server would receive garbled parameters; with it, the full phrase arrives intact.

Example 3: decoding a link you received. Reading encoded URLs works in reverse: if a friend sends you https://example.com/summer%20photos.zip, decoding %20 back to a space tells you the file is called "summer photos.zip".

Encode or Decode Instantly

Now that you know what is url encoding %20 and how the percent system works, you never need to encode or decode URLs by hand. Paste a file name, search phrase, or messy link full of % codes into a free URL encoder and decoder and get the result in a second: spaces to %20, accented characters to their UTF-8 codes, and encoded URLs back to readable text.

This matters far beyond fixing one broken link. Developers encoding form data, marketers building tracking links with query parameters, and anyone sharing files with spaces in their names all rely on the same conversion. Getting it right means links that work everywhere: in emails that wrap lines and in browsers that parse addresses strictly.

The same idea applies to other formats, too. For instance, Base64 encoding is another way of converting data into a safe, transmittable text form, used for embedding data in web pages and emails: different encoding, same principle.

The next time you spot %20 in a link, you will know it is not an error. It is a space, translated into the only language every part of the web agrees on — exactly what is url encoding %20 all about. Encode before you publish, and your links will simply work.

What does %20 mean in a URL?

%20 is the percent-encoded form of a space. Since spaces are not allowed directly in URLs, any space in a file name, page title, or search term becomes %20 so the link stays valid and clickable.

What is url encoding %20 used for?

Url encoding converts characters not allowed in a URL into a safe % plus two hexadecimal digits format. %20 specifically represents a space, while other codes cover / (%2F), ? (%3F), & (%26), and = (%3D).

Why do some URLs use + instead of %20 for spaces?

In the query string of a URL, form data traditionally encodes a space as +. In the path part, a space is always %20. Both are valid in their own context, but %20 is the general, standard encoding for a space.

How do I decode a URL with %20 and other codes?

Paste the URL into a URL decode tool, which converts %20 back to spaces and restores accented characters like é from codes such as %C3%A9 — that is what is url encoding %20 in action.

Related guides

What Is SHA-256 Hash Used For? A Simple Guide

Learn what is SHA-256 hash used for — passwords, downloads, and blockchains — with a real example and a free hash generator.

November 8, 2026

What Is Unix Timestamp? A Simple Guide

What is Unix timestamp? Learn what those 10-digit numbers mean, how to read them, and how to convert any timestamp to a date.

November 7, 2026

What Is UUID Used For? Random IDs Explained

What is UUID used for? Learn where these random IDs appear, why databases rely on them, and how UUID v4 works — plus a free…

November 2, 2026

How to Test Regex Online: A Practical Beginner's Guide

Learn how to test regex online with live examples: email and date patterns, greedy-match fixes, and a free tester that highlights…

November 1, 2026