URL Encoder & Decoder
Encode and decode URL strings for safe transmission in web addresses. Convert special characters to percent-encoded format or decode URLs back to readable text. Essential for working with query parameters, API endpoints, and web development.
Recommended Settings
URL Encoding Best Practices
- •Always encode user input before adding it to query parameters or URLs
- •Spaces become %20 (or + in query strings), special chars get percent-encoded
- •Encoding prevents URL injection attacks and ensures proper URL parsing
- •Use encodeURIComponent for query values, encodeURI for full URLs
- •Don't double-encode - encoding already-encoded strings creates errors
Common Use Cases & Characters
- •Reserved characters (? & = # /) must be encoded when used as data, not structure
- •International characters (é, ñ, 中文) require encoding for URL compatibility
- •Decode URLs received from APIs or query strings for display or processing
- •Form data in POST requests is automatically URL-encoded by browsers
- •Email addresses, full names, and addresses in URLs need encoding
Pro Tips
- •This tool uses encodeURIComponent - the safest option for most use cases
- •Encoded URLs are safe to paste into browsers, send via email, or store in databases
- •Reserved characters like / ? # & = have special meaning and get encoded to %XX
- •Decoding transforms %20 back to spaces, %40 to @, and other percent sequences
Most Popular
encodeURIComponent for query parameters, encodeURI for full URL paths
How It Works
Paste your text or URL into the input field
Click 'Encode' to convert special characters to percent-encoding (%XX format)
Or click 'Decode' to convert percent-encoded strings back to readable text
The result appears below with a copy button for easy use
Paste the encoded URL into your browser, API call, or application
100% Private
Files never leave your device. All processing happens locally in your browser.
Lightning Fast
Powered by Pure JavaScript for optimal performance on modern browsers.
Secure
No data collection, no tracking, no sign-up required.
Frequently Asked Questions
What's the difference between URL encoding and Base64?
URL encoding (percent encoding) is specifically designed for URLs and only encodes characters that are unsafe in URLs (like spaces, &, =). Base64 encodes all data into a completely different alphabet (A-Z, a-z, 0-9, +, /). Use URL encoding for query parameters, Base64 for binary data.
Why do some characters become %20 or %40?
Percent encoding uses %XX where XX is the hexadecimal ASCII code. Space is ASCII 32 (hex 20), so it becomes %20. @ is ASCII 64 (hex 40), so it becomes %40. This preserves the original character while making it URL-safe.
Can I encode a full URL?
Yes, but be careful! This tool uses encodeURIComponent which encodes slashes and colons. That's perfect for query parameter values but will break URLs like https://example.com. For full URLs, use encodeURI (which preserves :// and /) or encode only the specific parts that need it.
What happens if I decode something that's not encoded?
If you try to decode plain text that's not URL-encoded, it will usually pass through unchanged. However, if the text contains percent signs followed by hex digits (like %20), those will be decoded even if they weren't originally intended as encoding.
Do I need to encode URLs before sending them to APIs?
It depends on your HTTP library. Most modern libraries (fetch, axios, etc.) automatically encode query parameters if you pass them as objects. You only need manual encoding if you're building URL strings yourself or debugging encoded values.