Developer

URL Encoding Explained: Why %20 Means Space and How Percent Encoding Works

URLs can only contain a limited set of characters. Everything else gets percent-encoded. Learn why this exists, what the encoding rules are, and how to encode and decode URLs instantly.

5 min readTOOLBeans Team
🔗

Free Tool

URL Encoder / Decoder

No account. No install. Runs in browser.

Open Tool

Why URLs Cannot Contain Every Character

A URL is text, but it is a specifically structured type of text. The URL specification RFC 3986 defines exactly which characters are safe to use directly: letters, digits and a small set of special characters including hyphen, underscore, period and tilde.

Characters outside this allowed set must be encoded before appearing in a URL. The reason is that many characters have structural meaning within URL syntax. The question mark separates the path from the query string. The ampersand separates query parameters from each other. The equals sign separates parameter names from values. The hash character starts a fragment identifier.

If your query parameter value contains an ampersand, the URL parser interprets it as the end of that parameter and the start of the next one. To include these characters as literal data rather than structural syntax, they must be encoded in a way that tells the parser they are data, not structure.

How Percent Encoding Works

Percent encoding replaces each unsafe character with a percent sign followed by the two-digit hexadecimal ASCII code for that character.

Space has ASCII code 32. In hexadecimal, 32 is 20. So space becomes %20. The process is mechanical: look up the ASCII code for the character, convert to two-digit hexadecimal, prepend a percent sign.

Common encodings worth knowing: space is %20, at sign is %40, colon is %3A, forward slash is %2F, question mark is %3F, equals sign is %3D and ampersand is %26.

Non-ASCII characters like accented letters, Chinese characters and emoji are first converted to their UTF-8 byte sequences, then each byte is percent-encoded separately. An emoji might produce several percent-encoded sequences in a URL.

The Two Types of URL Encoding

Percent encoding encodes everything not in the unreserved character set. Used for encoding entire URLs or individual URI components.

Form encoding is used for HTML form data submitted via GET or POST. Nearly identical to percent encoding but uses a plus sign instead of %20 for spaces. This is what browsers generate when submitting forms.

Both formats exist in real URLs. An API endpoint might use %20 for spaces in its path structure while form submissions use plus signs. Knowing the difference prevents subtle bugs when parsing or building URLs manually.

Practical Uses for URL Encoding

Building API requests requires encoding any query parameter values that might contain special characters before appending them to URLs. Most HTTP libraries handle this automatically, but understanding what is happening helps when debugging raw requests that arrive encoded.

Reading server logs shows encoded URLs throughout. Decoding them makes the actual paths and parameters readable.

Debugging redirect chains often involves URL-encoded destination URLs nested inside other URL parameters. Decoding these step by step reveals the actual redirect path.

Our URL Encoder and Decoder handles both encoding and decoding instantly. Paste a URL or text string and get the encoded or decoded result immediately.

Explore More Free Tools

TOOLBeans offers 39 free developer and PDF tools. No account needed.

Browse all 39 free tools

Related Topics

url encoding explainedurl encoder decoder online freepercent encoding guideurl encode onlinewhat is url encodingdecode url online freeurl percent encoding 2026

Frequently Asked Questions

Is URL Encoder / Decoder free to use?

Yes. URL Encoder / Decoder is completely free on TOOLBeans with no usage limits, no account and no credit card required.

Is my data safe when using TOOLBeans tools?

Browser-based tools run entirely in your browser so your data never leaves your device. PDF server tools process your file on a secure server and delete it immediately after conversion.

Do I need to install anything to use URL Encoder / Decoder?

No installation is required. URL Encoder / Decoder runs directly in your browser on any device, including mobile. Just visit TOOLBeans and start using it instantly.

How is TOOLBeans different from other online tools?

TOOLBeans offers 39 free tools with no paywalls, no account requirements and no usage limits. Browser tools process your data locally for maximum privacy.

🔗

Try it yourself

URL Encoder / Decoder

Everything in this article is available in the free tool. No account, no subscription, no install.

Open URL Encoder / Decoder