URL Encoding: What Happens to Special Characters

Oct 12, 2026
URL Encoding: What Happens to Special Characters

Why spaces become %20, what that plus sign in links means, and how encoding prevents broken URLs across the web.

URLs are restricted to a small character set, so anything unusual gets translated into percent-encoding. Understanding this prevents mysteriously broken links.

The Translation System

Characters outside the safe set become a percent sign followed by two hex digits: a space becomes %20, plus becomes %2B, slash becomes %2F. The browser translates them back when reaching the server — invisible in normal use until something goes wrong.

The Classic Plus-Sign Trap

In query strings, a literal plus is read as a space by many systems. A secret or token containing + must be sent as %2B or it arrives corrupted — a classic cause of mysterious authorization failures in API and cron URLs.

Practical Prevention

Use proper URL encoding functions in code, avoid raw special characters in manually built URLs, and test links with unusual values before publishing. When a link mysteriously fails, inspect its encoding first — the cause is frequently there.

Frequently Asked Questions

Why do some links look full of percent signs?

They contain encoded non-ASCII or special characters — functionally normal.

Does encoding affect SEO?

Encoded URLs work fine; consistent canonical forms prevent duplicate versions.

Do all systems encode identically?

The standard is universal, but plus-versus-%20 handling varies — stick to %20 for spaces in new work.

Copy a URL containing your name or a special character and inspect its percent-encoded form — the translation becomes intuitive instantly.