URL Encoder / Decoder
Encode or decode URLs, URI parameters, and query strings with support for standard and component modes.
Input Text / URL
Output Result
About the URL Encoder / Decoder
URLs can only be sent over the Internet using the standard ASCII character set. Unsafe characters (such as spaces, ampersands, question marks, and non-ASCII glyphs) must be transformed into valid percent-encoded representations (%20, %26).
Our URL Encoder/Decoder runs fully client-side to instantly encode raw text into web-safe URL strings, or reverse percent-encoded strings back into readable text.
How the Calculations Work
Unsafe characters are replaced with a "%" followed by two hexadecimal digits representing their UTF-8 byte value.
encodeURIComponent(str) / decodeURIComponent(str)
Variables & Definitions
- Input: Raw string or percent-encoded query
- Output: Standardized RFC 3986 encoded or decoded string
https://example.com?query=hello world&lang=en encodes space as %20.
Key Terms Explained
Percent-Encoding
A mechanism for encoding characters in a Uniform Resource Identifier (URI) using a "%" prefix.
encodeURIComponent
Encodes all special characters including & , / : ; = ? @ to allow safe inclusion in query strings.
Practical Tips & Pitfalls to Avoid
Encode individual query values, not the whole URL structure
Using encodeURIComponent on a full URL will escape the colon and slashes in https://.
Frequently Asked Questions
Web servers use reserved characters like ? and & to identify query parameters. Encoding prevents parameters from conflicting with protocol delimiters.