URL Encoder/Decoder
Encode or decode URLs and query strings for safe use in web addresses.
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
Encode — query string
Encode — full URL
Encode — UTF-8 / emoji
Decode — query string
Decode — full URL
Decode — input has nothing to decode
Decode — malformed input
Frequently Asked Questions
When should I URL-encode strings?
What is the difference between encodeURI and encodeURIComponent?
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.
A URL encoder/decoder converts special characters to and from percent-encoded format so they can be safely included in URLs and query strings.
How to Use This Calculator
Select encode or decode mode and enter your text. Encoding replaces special characters with percent-encoded values (e.g., space becomes %20). Decoding reverses the process.
Understanding the Formula
URL encoding replaces unsafe characters with a % followed by two hex digits representing the character's ASCII/UTF-8 byte value. Safe characters (A-Z, a-z, 0-9, -, _, ., ~) are not encoded.
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.
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.
Assumptions & Limitations
- Encoding uses encodeURIComponent, which encodes all characters except A-Z, a-z, 0-9, and - _ . ~.
- Multi-byte UTF-8 characters produce multiple %XX sequences (e.g. a single emoji may expand to 12 characters).
- This tool encodes individual values; full URLs with path separators and query delimiters should be encoded component by component.