← Back
URL Encoder/Decoder
Encode or decode URLs
What is a URL Encoder/Decoder?
Converts special characters to percent-encoded format and decodes percent-encoded URLs back to readable text.
How It Works
URL encoding replaces unsafe characters with % followed by two hex digits. Space=%20, &=%26, ===3D, #=%23.
Example
"name=Riya Sharma&city=New Delhi" becomes "name%3DRiya%20Sharma%26city%3DNew%20Delhi" when encoded.
Pro Tips
- Use encodeURIComponent() for query parameter values; encodeURI() for full URLs in JavaScript.
- Spaces can be %20 or + in query strings; %20 is more universal across different contexts.
- Always encode user input before including in URLs to prevent injection attacks.
- Never double-encode - always decode first, then re-encode if needed.
FAQ
Why encode URLs?▼
URLs can only contain a limited character set - special chars must be encoded for safe transmission.
%20 vs + for spaces?▼
Both work in query strings; %20 is universal; + is only valid in query strings, not URL paths.
encodeURI vs encodeURIComponent?▼
encodeURI: encodes a full URL, preserves /:?&=. encodeURIComponent: encodes a value within a URL.
How to decode a URL?▼
Use decodeURIComponent() in JavaScript, or paste in this tool to see the human-readable version.