What is URL Encoding?
URL Encoding (also known as percent-encoding) is a mechanism for converting characters into a format that can be safely transmitted over the Internet. Because URLs can only contain a limited set of ASCII characters, special characters like spaces, ampersands (&), or quotation marks must be converted.
For example, a space cannot exist in a raw URL. The encoder converts the space into %20. This guarantees that web browsers and servers interpret your web addresses exactly as intended, preventing broken links and bad API requests.
How to Encode & Decode
- Select Mode: Use the tabs at the top to choose between Encode (converting normal text to URL format) or Decode (reverting URL format back to text).
- Enter Text: Paste your source string into the left panel.
- Instant Conversion: The tool automatically processes the string in real-time as you type.
- Copy Result: Click the Copy button in the right panel to grab the formatted string.
Key Developer Features
- 100% Client-Side Privacy: Uses the browser's native JavaScript engine to process strings. Your API keys or sensitive URLs are never uploaded to our servers.
- Smart Swapping: When you switch tabs, your current output safely transfers to the input so you can instantly verify encoding loops.
- Error Detection: Instantly alerts you if you attempt to decode an improperly formatted or malformed percent-encoded string.
Frequently Asked Questions (FAQ)
Which characters are not encoded?
The unreserved ASCII characters that do not need to be percent-encoded are alphanumeric characters (A-Z, a-z, 0-9), hyphens (-), periods (.), underscores (_), and tildes (~).
Why is decoding failing?
Decoding fails if the string contains a malformed percent-encoding sequence, such as a % sign that is not followed by two valid hexadecimal digits. Ensure the URL snippet you pasted is complete.
What's the difference between encodeURI and encodeURIComponent?
This tool uses encodeURIComponent, which encodes almost everything (including ?, =, &, and /). It is designed to encode specific parameters to be injected into a URL, ensuring complete structural safety.
Is a plus sign (+) or %20 used for spaces?
While older application/x-www-form-urlencoded standards use a plus sign (+) for spaces in query strings, modern percent-encoding strictly uses %20. This tool outputs the modernized %20 format.