URL Encoder/Decoder
Encode or decode URLs and query strings for safe use in web addresses.
Result
Fill in the fields above, then press Generate.
A URL encoder/decoder converts special characters to and from percent-encoded format so they can be safely included in URLs and query strings.
Examples
Encode — basic phrase
Mode: Encode. Input: "Hello World!". Output: "Hello%20World!". Space becomes %20; ! is a safe character so it is left alone.
Encode — query string
Mode: Encode. Input: "name=John Doe&city=New York". Output: "name%3DJohn%20Doe%26city%3DNew%20York". =, &, and spaces all need encoding when used inside a query parameter value.
Encode — full URL
Mode: Encode. Input: "https://example.com/path with spaces". Output: "https%3A%2F%2Fexample.com%2Fpath%20with%20spaces". Useful when embedding a URL inside another URL's parameter.
Encode — UTF-8 / emoji
Mode: Encode. Input: "café 🚀". Output: "caf%C3%A9%20%F0%9F%9A%80". The é is one character but two UTF-8 bytes; the rocket emoji is four bytes.
Decode — query string
Mode: Decode. Input: "name%3DJohn%20Doe%26city%3DNew%20York". Output: "name=John Doe&city=New York". Each %XX pair is converted back to its original character.
Decode — full URL
Mode: Decode. Input: "https%3A%2F%2Fvantacalc.com%2Fabout%2F". Output: "https://vantacalc.com/about/".
Decode — input has nothing to decode
Mode: Decode. Input: "www.example.com". Output: "www.example.com". A plain URL with no %XX sequences passes through unchanged — switch the mode to Encode if you wanted to make it URL-safe.
Decode — malformed input
Mode: Decode. Input: "%G". Output: "Error: Invalid URL-encoded string". %G is not a valid hex pair, so decoding fails. The Status field shows "Error".
Frequently Asked Questions
When should I URL-encode strings?
URL-encode any text that will be placed in a URL, especially query parameters, form data, and path segments. Characters like spaces, &, =, ?, and # have special meaning in URLs and must be encoded.
What is the difference between encodeURI and encodeURIComponent?
encodeURI encodes a full URI but preserves characters like : / ? # @ that are valid in a URL. encodeURIComponent encodes everything except A-Z, a-z, 0-9, and - _ . ~. Use encodeURIComponent for query parameter values.
Result
Your result appears here and follows you as you scroll.
Related Calculators
Quick Tips
- •Always encode query parameter values individually rather than encoding the entire URL, to preserve structural characters like ? and &.
- •Spaces can be encoded as %20 or + depending on context; %20 is correct for path segments while + is used in form submissions.
- •Bookmark this tool for quick debugging when API requests fail due to unencoded special characters in URLs.