URL Encoder / Decoder
URLs can only contain a limited set of characters defined by the URI specification. When you need to pass special characters — spaces, ampersands, non-ASCII letters, or emoji — through a URL, they must be percent-encoded first. For binary-to-text encoding instead, see the Base64 Encoder / Decoder. This free online tool lets you encode plain text into a URL-safe format or decode an already-encoded string back to readable text. You can choose between Component mode, which encodes every special character for use inside a single query-string value, and Full URL mode, which preserves structural characters like colons and slashes. Need a clean, readable slug for your page URL? Try the Slug Generator. Character counts for both input and output are displayed so you can track size changes. Everything runs locally in your browser, so no data leaves your machine. Copy the result to your clipboard with a single click and paste it wherever you need it.
How to Use This Tool
- Choose the direction: Encode to convert plain text into a URL-safe string, or Decode to convert a percent-encoded string back to readable text.
- Select the mode: Component for encoding individual query-string values (encodeURIComponent), or Full URL for encoding a complete URL while preserving its structure (encodeURI).
- Paste or type your text into the input area and click the action button to see the result instantly.
- Click the copy button to place the result on your clipboard, ready to paste into your code, browser address bar, or API request.
Examples
Encoding a Query-String Value (Component Mode)
Input (plain text)
hello world & welcome=true
Output (encoded)
hello%20world%20%26%20welcome%3Dtrue
Encoding a Full URL with Non-ASCII Characters
Input (full URL)
https://example.com/search?q=cafe latte
Output (encoded, Full URL mode)
https://example.com/search?q=cafe%20latte
Decoding a Percent-Encoded String
Input (encoded)
price%3D19.99%26currency%3DUSD
Output (decoded)
price=19.99¤cy=USD
What This Tool Is Useful For
- Building API requests: Encode query-string parameters so special characters like ampersands and equals signs do not break the URL structure.
- Debugging redirect URLs: Decode encoded redirect or callback URLs to see the actual destination and query parameters in a readable format.
- Constructing mailto links: Encode subject lines and body text that contain spaces or special characters so the mailto link works correctly across email clients.
- Sharing links with special characters: Encode URLs that contain non-English characters, emoji, or spaces so they can be safely shared in messaging apps and social media.
- Form data troubleshooting: Decode application/x-www-form-urlencoded payloads from network inspector logs to read the original form values.
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 representing the character's byte value. For example, a space becomes %20 and an ampersand becomes %26. This ensures the URL is interpreted correctly by browsers and servers.
- What is the difference between encodeURIComponent and encodeURI?
- encodeURIComponent encodes almost every special character, including slashes, colons, and question marks. It is designed for encoding individual query-string values or path segments. encodeURI, on the other hand, leaves characters that are valid in a complete URL (such as ://?#&=) untouched. Use encodeURI when you have a full URL that just needs its non-ASCII characters encoded, and encodeURIComponent when you are encoding a single parameter value.
- When should I URL-encode my data?
- You should URL-encode data whenever you embed user input into a query string, form submission, or URL path segment. If the data contains characters like spaces, ampersands, equals signs, or non-ASCII characters, failing to encode them can break the URL or cause the server to misinterpret the request.
- Does this tool send my data to a server?
- No. All encoding and decoding happens entirely in your browser using built-in JavaScript functions. Nothing is transmitted to any server, so your data stays private.
- Can I decode a full URL with query parameters?
- Yes. Switch to Full URL mode and paste the entire encoded URL. The decoder will restore percent-encoded characters back to their readable form while preserving the URL structure. If you only need to decode a single query-string value, use Component mode instead.
More Developer Tools
Need to encode binary data as text? Base64 Encoder / Decoder. Working with JSON? JSON Formatter & Validator. Need a unique identifier? UUID Generator. Convert timestamps? Unix Timestamp Converter. Turn any URL into a scannable QR Code. Browse all utilities in the Developer Tools hub.
Related Tools
JSON Formatter
Format, validate, and beautify JSON data with syntax highlighting.
Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 strings back to plain text.
Password Generator
Generate strong, random passwords with customizable length and character sets.
UUID Generator
Generate random UUIDs (v4) and nil UUIDs instantly for your applications.