ToolBoxOnline
Developer

Why URLs Use Percent Signs The History of URL Encoding

A space in a URL becomes %20. An ampersand becomes %26. Why percent signs? It goes back to the early internet, RFC 1738, and a simple rule about safe characters. Here's the story.

url encodingpercent encodingURL historyRFC 1738web standards

You copy a link with spaces in it. The browser shows %20 where each space should be. A filename with an ampersand becomes & on the wire and %26 in the URL. Why percent signs? Why not underscores or dashes? The answer is a decision made in 1994 that every URL still follows. An URL encoder applies the rule; here is where the rule came from.

The History of Percent Encoding

1994: RFC 1738 defines the URL. The early web needed a way to put arbitrary text into a URL, but URLs had reserved characters — /, ?, &, = — that had structural meaning. Spaces were not allowed at all. The standard chose a simple escape: a percent sign followed by two hexadecimal digits, one per byte. %20 means "byte 0x20," which is a space. %26 means "byte 0x26," which is an ampersand. Why percent? It was not used by any other character in URLs, so it was safe as a marker. A percent told the reader "the next two characters are a byte code, not literal text." It survives because it works. Every language, every browser, every server implements the same rule. The URL encoder applies it on demand. The HTML entities tool handles the parallel problem for HTML — where & plays the same escaping role. The text to slug tool is the modern alternative for readable URLs. The percent sign is the escape hatch. Two hex digits are the byte. Together they let a URL carry any text, safely.

Tools mentioned in this article

Share this tool