URL Encoder Decoder

Encode URLs to make them web-safe by converting special characters to percent-encoded format, or decode URL-encoded strings back to readable text. Essential for web development, API work, and handling URLs with special characters.

Updated June 2026 · How this works

How It Works
The formula, explained simply

URL encoding, also known as percent encoding, converts special characters in URLs into a format that can be safely transmitted over the internet. When you type a URL with spaces or symbols like @, &, or ?, these characters have special meanings in web protocols and need to be encoded to avoid confusion.

The encoding process replaces each special character with a percent sign (%) followed by two hexadecimal digits representing the character's ASCII value. For example, a space character becomes %20, an @ symbol becomes %40, and a question mark becomes %3F. This URL encoder decoder handles both directions - converting readable text to encoded format and vice versa.

Modern web browsers automatically encode URLs when you type them in the address bar, but developers working with APIs, query parameters, or programmatic URL generation often need manual control over this process. The decoder function reverses the process, converting percent-encoded strings back to human-readable format for debugging or display purposes.

When To Use This
Right tool, right situation

Use URL encoding when constructing URLs programmatically, especially for query parameters containing user input or data with special characters. This is essential for search forms, API requests with parameters, and any situation where you're building URLs dynamically in code.

Decoding becomes necessary when processing URL parameters on the server side, debugging encoded URLs, or displaying user-friendly versions of encoded strings in logs or interfaces. Web developers frequently use URL decoding when analyzing traffic logs or troubleshooting API calls.

The tool is particularly valuable for testing API endpoints, preparing data for web forms, and ensuring proper URL formatting before making HTTP requests. If you're working with international characters or symbols in URLs, proper encoding prevents broken links and ensures cross-platform compatibility.

Common Mistakes
Why results sometimes look wrong

A common mistake is encoding URLs that are already encoded, creating double-encoding like %2520 (which represents an encoded space %20 that got encoded again). Always check if your input is already encoded before applying additional encoding.

Another frequent error occurs when manually constructing encoded URLs by only encoding spaces but forgetting other special characters like &, =, or ?. These characters have specific meanings in URL structure, so leaving them unencoded in query parameters can break URL parsing.

When decoding, be careful with malformed input containing incomplete percent sequences like %2G or %A. These will cause decoding errors because G is not a valid hexadecimal digit. Always validate that percent-encoded strings use proper format before attempting to decode them.

The Math
Worked examples and deeper derivation

URL encoding follows the ASCII character encoding standard where each character has a numeric value from 0 to 127. Special characters are converted to their hexadecimal representation using base-16 numbering (digits 0-9 and letters A-F).

For example, the space character has ASCII value 32. Converting 32 to hexadecimal gives 20, so the encoded form is %20. The @ symbol has ASCII value 64, which converts to hexadecimal 40, resulting in %40. Letters and numbers (A-Z, a-z, 0-9) plus some symbols like hyphens and underscores are considered 'unreserved' and don't require encoding.

The decoding process reverses this by reading the two hexadecimal digits after each % sign, converting them back to decimal, and then to the original character. This mathematical transformation ensures reliable data transmission while maintaining the original meaning of the text.

Encoding a search URL
Operation: Encode, Input: 'search?q=cats & dogs'
Returns 'search%3Fq%3Dcats%20%26%20dogs' with special characters safely encoded for URL use.
Decoding an API parameter
Operation: Decode, Input: 'name%3DJohn%20Doe%26age%3D25'
Returns 'name=John Doe&age=25' converting percent-encoded characters back to readable format.
Encoding email address
Operation: Encode, Input: 'user@domain.com'
Returns 'user%40domain.com' with the @ symbol properly encoded as %40.

Common questions

How do I encode a URL with special characters?
Select 'Encode' from the operation dropdown, paste your URL or text containing special characters, and the tool will convert spaces to %20, @ symbols to %40, and other special characters to their percent-encoded equivalents for safe URL transmission.
What does percent encoding mean in URLs?
Percent encoding represents special characters in URLs using a % symbol followed by two hexadecimal digits. For example, a space becomes %20, an @ symbol becomes %40. This encoding ensures URLs work correctly across different systems and browsers.
Why can't I decode my URL encoded string?
Decoding fails when the input contains malformed percent encoding, such as incomplete sequences like %2 (missing second digit) or invalid hexadecimal characters. Ensure your encoded string uses proper format with % followed by exactly two valid hex digits (0-9, A-F).

Need something this doesn't cover?

Suggest a tool — we'll build it →