When you send information through a web browser using web forms, APIs, or search engines, the data is attached to the Uniform Resource Locator (URL). Because URLs must be transmitted across various network layers safely, only a limited set of standard characters is allowed. Characters outside this set must be converted to a safe representation through URL encoding, commonly known as percent encoding.
URLs are defined by standard specifications to only contain letters, numbers, and a few punctuation marks. If you want to include characters that have special structural meanings in a URL (such as the question mark, ampersand, or space) as raw data, they must be formatted.
The encoding process replaces these unsafe characters with a percent sign (%) followed by the two-digit hexadecimal representation of their ASCII byte values. For example, a space is converted to %20, and an ampersand is converted to %26.
To convert raw text or binaries into binary-to-text representation instead, try our Base64 encoding converter tool. To estimate how fast these URLs transmit across networks, see our network bandwidth calculator.
Characters in a URL are divided into two main categories: - Unreserved: These characters have no special meaning and are never encoded. They include all letters (A-Z, a-z), digits (0-9), hyphens, periods, underscores, and tildes. - Reserved: These characters have special meanings under certain circumstances (like ? starting a query, or & separating parameters). If they are part of your actual query values, they must be encoded to prevent confusion.
For translating measurement values into different unit standards, check out our unit conversion solver. For standard arithmetic checks, use our everyday daily math helper.
- Spaces: A space can be encoded as either %20 (the standard percent code) or a plus sign (+). The plus sign is typically used in query strings, while %20 is used in file paths. - Non-ASCII Characters: Modern web browsers encode emojis and non-English alphabets (like Cyrillic or Chinese characters) using their UTF-8 multi-byte codes. For instance, the smiling emoji is represented by multiple percent-encoded bytes.
Furthermore, web systems distinguish between complete URL encoding and URL component encoding. Encoding a complete URL preserves structural characters (like the colon in the protocol or the slashes in the path), while component encoding translates all reserved characters (including slashes and colons), making the resulting string safe to pass as a single sub-parameter.
To check query string lengths or inflation ratios, try our relative ratio solver. To verify average string character counts across web parameters, try our group average finder.
Suppose you want to encode the query string: "hello world?x=1&y=2".
First, identify the special characters that need encoding: - The space becomes %20. - The question mark (?) becomes %3F. - The equals signs (=) become %3D. - The ampersand (&) becomes %26.
Now, replace these characters in the string: - "hello%20world%3Fx%3D1%26y%3D2"
This formatted string can now be safely appended to a web address without confusing the web server's routing parser.