URL Encoder / Decoder
Quickly sanitize query parameters and prepare links for safe browser usage.
The Science of Percent Encoding
Percent-encoding, also known as URL encoding, is a mechanism for encoding information in a Uniform Resource Identifier (URI) under certain circumstances. It is essential for sharing complex data through web addresses.
Why is it needed?
Certain characters have special meanings in URLs (like `?`, `&`, or `=`). If you need to include these as literal text, they must be "escaped" into their hex-based percent equivalents (e.g., a space becomes `%20`).
How URL Encoding Works
URLs can only contain a limited set of characters. Spaces, ampersands, question marks, and non-English letters all have special meaning or aren't allowed at all, so they must be converted into a safe form called percent-encoding. URL encoding replaces each unsafe character with a percent sign followed by its hexadecimal byte value — a space becomes %20, for example.
When you need to encode
Any time you build a URL from user input or dynamic data, encoding protects you. Query-string values, search terms, file names, and anything with spaces or symbols should be encoded so the browser and server interpret the address correctly rather than truncating it or misreading a parameter boundary.
Encoding versus decoding
Encoding takes readable text and makes it URL-safe; decoding reverses it back into the original characters. You encode when constructing a link and decode when reading a value out of one — for instance, turning %40 back into the @ sign you see in an email address inside a query parameter.
Reserved characters to watch
Some characters are 'reserved' because they structure the URL itself: the question mark starts the query, the ampersand separates parameters, the hash marks a fragment, and the slash separates path segments. When those characters appear inside a value rather than as structure, they must be encoded to avoid breaking the link.
Quick tips
- Space encodes to %20 (or + inside a query string in some contexts).
- Ampersand (&) becomes %26 — important so it isn't read as a new parameter.
- Encode the value, not the whole URL, so you don't break the real structure.
- URL encoding is about safety and correctness, not security or secrecy.
Frequently Asked Questions
Common questions about the URL Encoder & Decoder.