encoding & security suite

URL Encoder & Decoder Online

Encode text into URL-safe percent-encoded strings or decode encoded parameters. Safely handles special characters and query strings.

|
raw text / encoded input 0 chars
output result 0 chars

The Uniform Resource Locator (URL) is the address mechanism for resources on the World Wide Web. However, because network protocols and servers are optimized for ASCII characters, the URL standard reserves certain characters for routing and syntax, such as ? for query strings, = for key-value structures, and & for parameter dividers. When query strings contain these characters as data, they must be escaped. This process, known as URL encoding, converts unsafe symbols into ASCII percent sequences.

The Mechanics of Percent Encoding

Percent-encoding (defined in RFC 3986) replaces non-ASCII characters and reserved symbols with a percent symbol (%) followed by the character\'s two-digit hexadecimal byte value. For instance, the space character (ASCII 32) translates to %20. The ampersand (ASCII 38) translates to %26. When processing non-ASCII unicode characters, like ü or emojis, the encoder first translates the characters into UTF-8 bytes and then encodes each byte, resulting in strings like %C3%BC.

Form Encoding and the Plus Sign

A common point of confusion is the use of the plus sign (+) to represent spaces. In standard URLs, a space must be encoded as %20. However, the HTML specification defines form submissions using the application/x-www-form-urlencoded media type, which converts spaces into plus signs (+) inside query strings. When decoding, engines must recognize whether a plus sign indicates a literal plus symbol or an encoded space, depending on the context of the query string.

Worked Example: URL Encoding

Consider a query string containing spaces and reserved symbols: user=John Doe & Co.. If sent directly, the ampersand will be interpreted as a query parameter delimiter, splitting the value incorrectly. Encoding the string replaces spaces and ampersands, producing a safe URL parameter:

user%3DJohn%20Doe%20%26%20Co.

frequently asked questions

Why do URLs need to be encoded? +

URLs are sent over the internet using the ASCII character set. Any character outside this set (like spaces, symbols, and non-English text) or characters with special meaning in URLs (like ?, &, or =) must be encoded to prevent web servers and browsers from misinterpreting them.

What is percent-encoding? +

Percent-encoding replaces unsafe characters with a percent sign (%) followed by the two-digit hexadecimal representation of the character's UTF-8 byte. For example, a space is encoded as %20, and an ampersand is encoded as %26.

What is the difference between encoding spaces as %20 or +? +

Historically, the application/x-www-form-urlencoded media type defined that spaces in query parameters are encoded as plus signs (+). In URL paths, however, spaces must be encoded as %20. Our encoder supports toggling this option.

Does this tool process my data on a server? +

No, all encoding and decoding operations run inside your browser. No text is sent to our servers, keeping your API keys and tokens completely safe.

Why does URL decoding fail sometimes? +

Decoding fails if the string contains a percent sign (%) that is not followed by two valid hexadecimal digits (e.g. %2G), which violates the percent-encoding standard.