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.