Skip to main content
短.be

URL Encoding

The process of converting special characters in a URL into a format that can be transmitted over the internet using percent-encoded sequences.

Sep 16, 2025 · About 1 min read

URL Shortening

URL encoding, also known as percent encoding, is the process of converting characters that are not allowed in URLs into a universally accepted format. Special characters, spaces, and non-ASCII characters are replaced with a percent sign followed by two hexadecimal digits representing the character's ASCII or UTF-8 byte value. For example, a space becomes "%20" and an ampersand becomes "%26."

URL encoding is defined by RFC 3986, which specifies which characters are allowed in different parts of a URL. Unreserved characters (A-Z, a-z, 0-9, hyphen, period, underscore, tilde) can appear as-is, while reserved characters that have special meaning in URL syntax must be encoded when used as data rather than delimiters. Web standards books on Amazon explain these specifications.

In URL shortening, encoding is relevant in two contexts. First, the destination URL submitted for shortening may contain encoded characters that must be preserved during storage and redirect. Second, the short URL itself should avoid characters that require encoding, which is why most services restrict short codes to alphanumeric characters and hyphens.

Common pitfalls include double encoding (encoding an already-encoded URL), inconsistent encoding of Unicode characters, and failing to encode query parameter values. These issues can cause broken redirects or incorrect destination pages. Web development debugging books on Amazon cover troubleshooting techniques.

Share on XHatena

Was this article helpful?

Related Terms

Related Articles

FAQ

When is URL encoding necessary?
When URLs contain non-ASCII characters (like Japanese), spaces, or special characters (&, =, ?, etc.). Browsers handle encoding automatically, but explicit encoding is needed when building URLs programmatically.
What's the difference between URL encoding and decoding?
Encoding converts characters to percent notation (%XX), while decoding converts percent notation back to original characters. For example, spaces become %20 when encoded.

Ready to create a short URL?

Shorten a URL for Free