URL Encoder/Decoder - Encode URLs Online
Encode and decode URL components safely for web development
What is URL Encoding?
URL encoding (percent-encoding) converts special characters in URLs to a format that can be safely transmitted over the internet. Characters like spaces, symbols, and non-ASCII text are converted to %XX format where XX is the hexadecimal value.
Why URL Encoding Matters
- 🌐 Web Standards: URLs can only contain specific ASCII characters
- 🔗 Link Safety: Prevent broken links with special characters
- 🔍 Search Parameters: Safely pass data in query strings
- 📱 Cross-Platform: Ensure URLs work across all browsers and systems
Common Characters That Need Encoding
| Character | Encoded | Use Case |
|---|---|---|
Space |
%20 |
File names, search queries |
& |
%26 |
Query parameters |
? |
%3F |
URLs with question marks |
# |
%23 |
Fragment identifiers |
+ |
%2B |
Mathematical expressions |
@ |
%40 |
Email addresses in URLs |
= |
%3D |
Form data values |
Real-World Examples
Search Queries
Before: https://example.com/search?q=hello world
After: https://example.com/search?q=hello%20world
File Paths with Spaces
Before: https://cdn.example.com/images/my photo.jpg
After: https://cdn.example.com/images/my%20photo.jpg
International Characters
Before: https://example.com/café
After: https://example.com/caf%C3%A9
When to Use URL Encoding
✅ Query Parameters — Always encode values in ?key=value pairs
✅ Form Data — When submitting forms via GET/POST
✅ File Names — URLs pointing to files with special characters
✅ API Endpoints — Passing user input as URL parameters
✅ Social Sharing — URLs shared on social media platforms
Features
🚀 Instant Encoding/Decoding — Real-time results as you type
🌐 Full URL Support — Handle complete URLs or individual components
📝 UTF-8 Compatible — Properly encode international characters
📋 One-Click Copy — Copy results instantly to clipboard
🔄 Bidirectional — Encode to percent-encoding or decode back to text
Developer Tips
JavaScript
// Encoding
const encoded = encodeURIComponent("hello world & more");
// Result: "hello%20world%20%26%20more"
// Decoding
const decoded = decodeURIComponent("hello%20world%20%26%20more");
// Result: "hello world & more"
PHP
// Encoding
$encoded = urlencode("hello world & more");
// Decoding
$decoded = urldecode("hello%20world%20%26%20more");
Common Mistakes to Avoid
❌ Double Encoding — Don't encode already-encoded URLs
❌ Encoding Entire URLs — Only encode the parameter values, not the whole URL
❌ Forgetting Form Data — Always encode form values before submission
❌ Mixed Encoding — Use consistent encoding throughout your application
Ready to encode or decode URLs?