MentorMakers Login Sign up

Do More with MentorMakers

Free tools. Powerful features. Built for a smarter tomorrow.

  • 129 Free Tools
  • Most tools — no signup
  • Temporary files handled for processing
  • AI Assistant built in
  • Made in Pakistan 🇵🇰
Explore All Tools
Developer Tools & Technical Guides Sep 25, 2026 · 2 min read

URL Encoding Explained: Why %20 Appears in Links

Why URLs contain %20 and similar codes, what URL encoding is, and how to encode or decode a URL string correctly.

M By the Mentor Makers team
URL Encoding Explained: Why %20 Appears in Links

URLs are restricted to a specific set of safe characters. When a URL needs to contain anything outside that set — spaces, accented letters, special symbols, or characters from Urdu or other languages — percent-encoding converts each unsafe character to its safe equivalent.

How Percent-Encoding Works

Each character that isn't URL-safe is replaced by %XX, where XX is the hexadecimal value of the character's ASCII (or UTF-8) code.

CharacterEncoded
Space%20
!%21
#%23
$%24
&%26
+%2B
/%2F (in query strings; in paths it means a separator)
?%3F
@%40
=%3D

When You See It

  • Search queries: a Google search for "web design Lahore" becomes ...q=web+design+Lahore or ...q=web%20design%20Lahore in the URL.
  • Form submissions: form data with special characters gets encoded before transmission.
  • File names in URLs: a file named "My Report 2026.pdf" becomes My%20Report%202026.pdf.
  • API parameters: values passed to APIs are often URL-encoded to ensure safe transmission.

Reserved vs Unreserved Characters

Unreserved (always safe, never encoded): A–Z a–z 0–9 - _ . ~

Reserved (have special meaning in URLs): : / ? # [ ] @ ! $ & ' ( ) * + , ; =

Reserved characters are encoded when used as data rather than their structural role. For example, a / in a filename parameter is encoded as %2F so it isn't interpreted as a URL path separator.

Non-ASCII Characters

Urdu and other non-ASCII scripts in URLs use UTF-8 encoding where each byte of the UTF-8 representation is percent-encoded. The Urdu word for "books" (کتابیں) might appear in a URL as a sequence of %D9%... codes.

Encoding and Decoding

Use URL Encoder/Decoder to:

  • Encode a string or URL component for safe use in a URL.
  • Decode percent-encoded URLs to readable form.
  • Debug encoded query strings and parameters.

For Base64 encoding (a different encoding used for binary data in text contexts), see what is Base64 encoding.

URL Encoding in Pakistan Context

Urdu text in URLs — used by Urdu-language websites and news portals — appears heavily encoded because each Urdu character requires multiple UTF-8 bytes, each percent-encoded. A URL like https://example.com/اردو-خبر actually transmits as a long string of %D8%... codes. Modern browsers display the decoded (readable) version in the address bar, but the underlying transmission uses the encoded form. When building URLs programmatically in PHP, urlencode() and rawurlencode() handle this automatically for query strings and path segments respectively.

#url encoding #percent encoding #url decode

Frequently Asked Questions

What does %20 mean in a URL?

It's the URL-encoded representation of a space character. Spaces aren't valid in URLs, so they're replaced by %20 (the hexadecimal value of the space character's ASCII code).

Why can't URLs contain spaces?

URLs were designed to work across every system on the internet, many of which interpret spaces as delimiters. Percent-encoding makes any character safe to include.

What is the difference between %20 and +?

Both represent spaces in different contexts. %20 is standard URL encoding (used in path segments). The + sign represents a space in query string parameters in some older systems. In modern practice, %20 is generally safer and more universally correct.

Can I put any character in a URL by encoding it?

Yes. Percent-encoding allows any character by using its hexadecimal byte value(s) preceded by %. Unicode characters outside ASCII use multi-byte sequences.

Try it yourself

Do it in seconds Free

Every tool on MentorMakers is free — or just tell the AI Assistant what you need.

Browse all tools

0 Comments

Log in to comment

← Back to blog

Advertisement
Processing your file…
This can take a few seconds for larger files.
Bookmark this page
Press Ctrl+D for quick access next time