URL Encode/Decode
This URL encoder and decoder handles percent-encoding for full URLs and query parameters. Supports both encodeURI and encodeURIComponent modes.
About URL Encode/Decode
The URL Encode/Decode tool helps developers and webmasters work with percent-encoded URLs quickly and accurately. Percent encoding is the standard mechanism defined in RFC 3986 for representing special characters in URLs, ensuring they are transmitted correctly across the internet.
Two Encoding Modes
This tool offers two encoding modes. Full URL encoding uses the equivalent of JavaScript's encodeURI function, which preserves characters that have special meaning in a complete URL such as colons, forward slashes, question marks, and hash symbols. Component encoding uses encodeURIComponent, which encodes nearly all special characters and is the correct choice for encoding individual query parameter keys and values.
Choosing the Right Mode
Understanding which mode to use is critical for building correct URLs. If you are encoding an entire URL that should remain navigable, use full encoding. If you are encoding a value that will be placed inside a query string parameter, use component encoding to ensure characters like ampersands and equals signs are properly escaped. For other encoding tasks, check out the Base64 encoder/decoder or the HTML entity encoder.
Decoding
The decoder handles both encoding formats transparently, automatically converting percent-encoded sequences back to their original characters. It correctly handles UTF-8 multi-byte sequences, so international characters, emoji, and other Unicode content decode properly.
Common use cases include preparing query parameters for API calls, debugging encoded URLs from server logs, building redirect URLs with encoded parameters, and converting human-readable text into URL-safe strings. All processing runs locally in your browser with no data sent to external servers.
Frequently Asked Questions
What is URL encoding?
URL encoding (also called percent encoding) replaces unsafe or reserved characters in a URL with a percent sign followed by two hexadecimal digits. For example, a space becomes %20 and an ampersand becomes %26. This ensures URLs are transmitted correctly across the internet.
What is the difference between full URL encoding and component encoding?
Full URL encoding (encodeURI) preserves characters that are valid in a complete URL such as colons, slashes, question marks, and hash symbols. Component encoding (encodeURIComponent) encodes everything except letters, digits, and a few special characters, making it suitable for encoding individual query parameter values.
When should I URL-encode my data?
You should URL-encode data whenever you include user input in URL query parameters, form submissions, or path segments. This prevents special characters from being misinterpreted as URL delimiters and protects against injection attacks.
Does URL encoding affect the functionality of my URLs?
No. Properly URL-encoded strings are decoded by web servers and browsers automatically. The encoded URL will function identically to the original, but special characters will be safely transmitted without being misinterpreted as part of the URL structure.