URL Encode/Decode
Encode or decode URLs and query string parameters.
What Is URL Encoding?
URL encoding (also called percent-encoding) is the process of converting characters into a format that can be safely transmitted in a URL. Since URLs can only contain a limited set of characters (letters, digits, and a few special characters), any other characters β including spaces, unicode characters, and reserved symbols β must be encoded as percent-encoded sequences like %20 for space or %C3%A9 for "Γ©".
URL encoding is defined by RFC 3986 and is fundamental to how the web works. Every time you submit a form, click a link with query parameters, or make an API request, URL encoding ensures that special characters don't break the URL structure. Without encoding, a search query like "cats & dogs" would be misinterpreted because & is a reserved delimiter in URLs.
This tool provides both encodeURIComponent (for encoding individual values like query parameters) and encodeURI (for encoding full URLs while preserving structural characters). It also decodes percent-encoded strings back to readable text. A swap button lets you quickly reverse operations. All processing happens in your browser β your URLs and data stay private.
How to Encode and Decode URLs
- Enter your text or URL β Paste the text, query parameter value, or full URL you want to encode or decode into the input field.
- Choose the operation β Click "Encode Component" to encode a value for use in a query parameter, "Encode URI" to encode a full URL while preserving its structure, or "Decode" to convert percent-encoded text back to readable form.
- View and copy the result β The encoded or decoded output appears in the right panel. Click "Copy" to copy it to your clipboard.
- Swap input and output β Click the "β Swap" button to move the result back to the input and automatically apply the reverse operation (encode β decode).
Key Features
- Two encoding modes β
encodeURIComponentencodes everything exceptA-Z a-z 0-9 - _ . ! ~ * ' ( ), perfect for query parameter values.encodeURIpreserves URL structure characters like: / ? # [ ] @ ! $ & ' ( ) * + , ; =, ideal for encoding full URLs. - Decode percent-encoding β Convert
%20,%3D,%26, and other percent-encoded sequences back to their original characters. Handles multi-byte UTF-8 sequences for international characters and emoji. - Smart swap β The swap button moves output to input and automatically applies the reverse operation, making it easy to encode and then verify by decoding.
- Error handling β Clear error messages when encountering invalid percent-encoded sequences (e.g., incomplete
%Eor invalid byte sequences). - Quick reference card β Built-in comparison of
encodeURIComponentvsencodeURIshowing exactly which characters each function encodes. - 100% client-side β Your URLs, query parameters, and data never leave your browser. No server involved.
Common Use Cases
- Building API query strings β Encode parameter values before adding them to URLs. For example, encoding a search term like "price > $100" to
price%20%3E%20%24100for safe inclusion in a query string. - Debugging encoded URLs β Decode percent-encoded URLs from server logs, analytics tools, or browser address bars to see the actual parameter values being passed.
- Encoding form data β URL-encode form values for
application/x-www-form-urlencodedcontent type, used in POST requests and URL query strings. - Handling international characters β Encode non-ASCII characters (accented letters, CJK characters, emoji) for safe transmission in URLs and API requests.
- Constructing redirect URLs β Encode a full URL as a parameter value in a redirect URL, ensuring nested URLs don't break the outer URL's structure.
Frequently Asked Questions
π This tool runs entirely in your browser. No data is sent to any server.