URL Encoder/Decoder
Encode and decode URL strings for safe web usage
URL Encoder/Decoder handles three related transformations in one place: percent-encoding for URI components, percent-encoding for full URIs, and HTML entity encoding or decoding. It updates the result as you type, so it works well for quick debugging and copy-paste cleanup.
All processing runs locally in your browser. Your files and text are not sent to Tool-web's server.
How to Use
- Enter the text or URL fragment to transform
- Choose encode or decode mode
- Pick component, full URI, or HTML entities mode
- Review or copy the result
Features
- Encode special characters
- Decode percent-encoded strings
- Component, full URI, and HTML entities modes
- Instant conversion with byte counts
- Copy and download output
Tips for getting URL Encoder/Decoder right
- Encode user-supplied values individually, not whole URLs — encoding an entire URL double-escapes its separators
- Space encodes to %20 in paths but + in form-encoded bodies; they are not interchangeable
- Decode suspicious links before opening them to see where they actually point
- Use the byte counters when you need to understand how much an encoded string expands
Worked example
| Input | Encoded | Why |
|---|---|---|
| coffee & tea | coffee%20%26%20tea | & separates params — must be escaped inside a value |
| a/b | a%2Fb | / delimits path segments |
| 100% | 100%25 | % itself introduces escapes |
| héllo | h%C3%A9llo | UTF-8 bytes encoded one by one |
Common failure modes
- Unencoded & inside a value splits it into two parameters server-side
- Double-encoding turns e into %2520 — usually caused by encoding twice
- Decoding untrusted input then rendering it raw invites XSS; decode for reading, not injecting
When to use each encoding mode
Component mode is for one piece of a URL, like a search term or path segment. Full-URI mode keeps structural separators intact while still escaping unsafe characters. HTML entities mode is for text headed into HTML, not for URLs themselves. Picking the wrong mode causes most encoding bugs.
Real-World Use Cases
- Encoding query-parameter values before adding them to a URL
- Decoding a copied percent-encoded link so you can inspect it safely
- Comparing component encoding with full-URI encoding to avoid over-escaping separators
- Converting special characters into HTML entities for markup contexts
- Checking how non-ASCII text expands in bytes after encoding
Best Practices
- Use component mode for individual path segments or query values rather than whole URLs
- Use full-URI mode only when you need to preserve separators like `:` and `/`
- Treat HTML entities as markup escaping, not as a replacement for URL encoding
- Use swap mode to round-trip a result and confirm it decodes back to the original text
- Check the byte counts when the encoded form will be stored, transmitted, or logged
Common Mistakes to Avoid
- Encoding an entire URL when only one parameter value needed encoding
- Decoding untrusted text and then injecting it into HTML or JavaScript without escaping
- Expecting HTML entity encoding to behave exactly like URL percent-encoding
- Double-encoding input by repeatedly running component mode on already encoded text
- Ignoring byte growth when encoded text is headed into a storage or transport limit
Troubleshooting
- If a URL breaks after encoding, confirm you did not encode separators that should stay literal
- If decode mode errors out, the input may be malformed or partially encoded
- If text looks over-escaped, compare component mode and full-URI mode side by side
- If markup still renders incorrectly, use HTML entities mode rather than percent-encoding
- If a pasted link remains unreadable, decode once and stop before you accidentally reverse valid escapes twice
Frequently Asked Questions
When do I need URL encoding?
What encoding modes are available?
Can I encode just the query string?
Privacy & Security
Encoding runs locally in your browser. Query strings stay on your device.
Tips & Best Practices
- Encode user-supplied values individually, not whole URLs — encoding an entire URL double-escapes its separators
- Space encodes to %20 in paths but + in form-encoded bodies; they are not interchangeable
- Decode suspicious links before opening them to see where they actually point
- Use the byte counters when you need to understand how much an encoded string expands
Comments
0/1000
Explore more SEO Tools
Browse all tools in the SEO Tools collection.