Why URLs Have Strange Characters
You have probably seen URLs like this: https://example.com/search?q=hello%20world. That %20 is a space character that has been URL-encoded. The browser cannot put a literal space in a URL, so it replaces it with a percent sign followed by the hexadecimal code for space (20 in hex = 32 in decimal = the ASCII code for space).
URL encoding (also called percent-encoding) is the mechanism that allows URLs to contain characters that would otherwise be illegal or ambiguous in a URL.
Characters That Must Be Encoded
URLs are defined by RFC 3986, which specifies a limited set of characters that are allowed without encoding:
Unreserved characters (always safe): A-Z, a-z, 0-9, hyphen (-), period (.), underscore (_), tilde (~)
Reserved characters (have special meaning): : / ? # [ ] @ ! $ & ' ( ) * + , ; =
Everything else — spaces, accented characters, Chinese characters, emoji, angle brackets, curly braces — must be percent-encoded.
Some reserved characters must also be encoded when used as data rather than as URL structure. For example, & separates query parameters, so a literal ampersand in a parameter value must be encoded as %26.
How Percent-Encoding Works
The encoding process converts each byte of the character's UTF-8 representation into %XX where XX is the hexadecimal byte value.
Single-byte characters (ASCII):
- Space (byte 0x20) →
%20 <(byte 0x3C) →%3C@(byte 0x40) →%40
Multi-byte characters (UTF-8):
é(bytes 0xC3 0xA9) →%C3%A9你(bytes 0xE4 0xBD 0xA0) →%E4%BD%A0
Common URL Encoding Issues
Double encoding. If text is encoded twice, %20 becomes %2520 (the % itself gets encoded). This happens when encoding is applied at multiple layers. The decoded result is %20 instead of a space.
Plus signs vs %20. In HTML form submissions (application/x-www-form-urlencoded), spaces are encoded as + instead of %20. Both representations mean "space" but in different contexts. This legacy behavior causes confusion.
Non-ASCII characters. Modern browsers display non-ASCII characters in the address bar (like https://example.com/日本語) but send the encoded version (%E6%97%A5%E6%9C%AC%E8%AA%9E) in the actual HTTP request.
When You Need URL Encoding
Building API requests. When constructing URLs programmatically, query parameter values must be encoded. A search query containing & or = will break the URL structure if not encoded.
Passing data in URLs. Redirect URLs, callback URLs, and deep links often contain other URLs as parameter values. The embedded URL must be encoded so its special characters do not interfere with the outer URL.
Debugging. When a URL is not working as expected, decoding it reveals what the server actually receives. An unexpected %2F (encoded /) in a path segment behaves differently from an actual /.
How to Use the Toobits URL Encoder
Paste text into the input field to see the URL-encoded result instantly. Switch to decode mode to convert percent-encoded URLs back to readable text. The tool handles UTF-8 encoding correctly, supports both %20 and + space encoding, and runs entirely in your browser.