URL Encoder/Decoder
Encode or decode URLs and query strings instantly. Handles special characters, Unicode, and percent-encoding. Free online URL tool — 100% browser-based.
About this tool
URL encoding (also known as percent-encoding) is a mechanism for encoding characters that have special meaning in URLs or that are not allowed in a URI. Special characters are replaced with a "%" sign followed by their hexadecimal value -- for example, a space becomes %20.
This tool uses JavaScript's built-in encodeURIComponent and decodeURIComponent functions, which correctly handle Unicode characters including emojis and non-Latin scripts. All processing happens in your browser -- nothing is sent to a server.
infoHow It Works
Characters that are not unreserved (A-Z, a-z, 0-9, -, _, ., ~) are replaced with percent-encoded sequences like %20 for a space.
Percent-encoded sequences (%XX) are converted back to their original characters. Invalid sequences will trigger an error.
Non-ASCII characters are first encoded as UTF-8 bytes, then each byte is percent-encoded. For example, a two-byte character becomes two %XX sequences.
table_chartCommon Encodings
lightbulbTip
Use encodeURIComponent for individual query parameter values. Use encodeURI only when encoding a full URL where you want to preserve :, /, and ? characters.
Frequently Asked Questions
What is URL encoding?
URL encoding (percent-encoding) replaces unsafe characters in a URL with a '%' followed by their hex value. For example, a space becomes '%20'. This ensures URLs are valid and can be transmitted correctly.
What's the difference between encodeURI and encodeURIComponent?
encodeURI encodes a full URL but preserves characters like :, /, ?, and #. encodeURIComponent encodes everything, making it suitable for individual query parameters. This tool uses encodeURIComponent for thorough encoding.
Does it handle Unicode characters?
Yes. The tool correctly encodes and decodes Unicode characters including emojis, accented characters, and non-Latin scripts using UTF-8 encoding.