URL Encoder Decoder
Free URL Encoder Decoder for tools. Free online tool with accurate results using verified formulas.
Formula
Encode: output = encodeURIComponent(input) | Decode: output = decodeURIComponent(input)
Encoding applies RFC 3986 percent-encoding to unsafe URL characters; decoding reverses valid percent-encoded sequences back to plain text.
Worked Examples
Example 1: Encoding a Search Query Before Appending It to a URL
Problem:You want to pass the raw string search?q=blue shoes&size=10 as a single query parameter value. Pasted directly into a URL it would break, because the question mark would start a new query section and the ampersand would split it into separate parameters.
Solution:Click Encode. Each reserved character is replaced by a percent sign plus its two-digit hexadecimal byte value: the question mark becomes %3F, each equals sign becomes %3D, the space becomes %20, and the ampersand becomes %26. Letters, digits, and the hyphen are unreserved and pass through untouched.
Result:search%3Fq%3Dblue%20shoes%26size%3D10 - now safe to drop into a parameter such as ?query=search%3Fq%3Dblue%20shoes%26size%3D10
Example 2: Decoding a Fully Escaped URL From a Log File
Problem:A server access log or a redirect parameter contains https%3A%2F%2Fexample.com%2Fpath%3Fa%3D1%26b%3D2 and you need to read the original address it points to.
Solution:Paste the string and click Decode. Every percent triplet is converted back to the byte it represents: %3A becomes a colon, %2F becomes a forward slash, %3F becomes a question mark, %3D becomes an equals sign, and %26 becomes an ampersand. Note that the slashes were escaped at all because the URL was encoded as a component value rather than as a whole address.
Result:https://example.com/path?a=1&b=2
Frequently Asked Questions
How does URL encoding work?
URL encoding (percent-encoding) converts characters into a format that can be transmitted over the Internet. It replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits.
Why do I need to encode URLs?
URLs can only be sent over the Internet using the ASCII character-set. If a URL contains special characters (like spaces, &, #), they must be encoded to avoid breaking the URL structure or query parameters.
What is the difference between encodeURI and encodeURIComponent?
This tool uses `encodeURIComponent`, which encodes characters like `/`, `?`, `&` that have special meaning in a URL. `encodeURI` would leave those intact, assuming you are encoding a full URL, not just a parameter.
Can I decode a URL here?
Yes, simply paste the encoded text and click 'Decode' to revert it to human-readable text.
What happens if I decode an invalid URL?
The tool will display an 'Invalid encoded URL' error if the input contains malformed percent-encoding sequences.