URL Encode & Decode
Encode or decode URLs and query strings instantly. Handles special characters, Unicode, and percent-encoding.
Advertisement
Component mode uses encodeURIComponent β encodes all special characters including / ? # & =. Best for query parameter values.
Advertisement
How to Use the URL Encoder/Decoder
This URL encoding tool helps you safely encode special characters in URLs and query strings, or decode percent-encoded URLs back to readable text. It's essential for web developers working with APIs, form data, and URL parameters.
To encode: Paste any text or URL containing special characters into the input field with "Encode" mode selected. The tool will convert all special characters to their percent-encoded equivalents, making the string safe for use in URLs.
To decode: Switch to "Decode" mode and paste a percent-encoded string. The tool will convert it back to human-readable text, resolving all %XX sequences to their original characters.
URL encoding is critical when building query strings for APIs, constructing redirect URLs, or handling user input that will be included in URLs. Without proper encoding, special characters like spaces, ampersands, and equals signs can break URL parsing and cause unexpected behavior in web applications.
Frequently Asked Questions
What is URL encoding (percent-encoding)?
URL encoding, also called percent-encoding, replaces unsafe or special characters in a URL with a '%' followed by their hexadecimal value. For example, a space becomes '%20' and an ampersand '&' becomes '%26'. This ensures URLs are valid and can be transmitted correctly across the internet.
Which characters need to be URL-encoded?
Characters that are not letters (A-Z, a-z), digits (0-9), or the unreserved characters (- _ . ~) should be percent-encoded in URLs. Reserved characters like &, =, ?, /, #, and @ have special meaning in URLs and must be encoded when used as data values rather than delimiters.
What's the difference between encodeURI and encodeURIComponent?
encodeURI() encodes a complete URI, preserving characters that have special meaning in URLs (like :, /, ?, #, &). encodeURIComponent() encodes everything except letters, digits, and a few special characters, making it suitable for encoding query parameter values. This tool uses encodeURIComponent for thorough encoding.
How does URL encoding handle Unicode characters?
Unicode characters are first encoded to UTF-8 bytes, then each byte is percent-encoded. For example, the emoji 'π' becomes '%F0%9F%98%80' (four UTF-8 bytes, each percent-encoded). This tool fully supports Unicode text including emojis and international characters.
Is my data safe when using this URL encoder?
Yes. All encoding and decoding happens entirely in your browser using JavaScript's built-in encodeURIComponent() and decodeURIComponent() functions. No data is transmitted to any server, making it safe for encoding sensitive URLs, API keys, and authentication tokens.