URL Encoder / Decoder
Encode special characters or decode URL-encoded text.
Common Encoded Characters
📘 How It Works
Percent Encoding Standard
URL encoding (percent-encoding) converts characters to the format %XX where XX is the hexadecimal ASCII value. Space becomes %20, @ becomes %40, etc.
Safe Characters
Letters (A-Z, a-z), digits (0-9), and some punctuation (-_.~) are 'safe' and pass through unchanged. All other characters need encoding for URL safety.
encodeURIComponent Function
JavaScript's encodeURIComponent() encodes everything except A-Z a-z 0-9 - _ . ! ~ * ' ( ). This is stricter than encodeURI() and safe for query parameters.
UTF-8 Handling
Non-ASCII characters (like é, 中, ñ) are first converted to UTF-8 bytes, then each byte is percent-encoded. This ensures international character support.
Decoding Process
decodeURIComponent() reverses the encoding, converting %XX sequences back to original characters. Invalid sequences throw errors that this tool catches gracefully.
💡 Common Use Cases
Query String Parameters
Encode values containing special characters (&, =, ?) for safe inclusion in URL query strings. Essential for search queries and filters.
API Requests
Encode data before sending to APIs via GET requests. Prevents malformed URLs and ensures proper parameter parsing.
Email Links
Create mailto: links with pre-filled subject and body. Encode spaces and special characters for reliable email client handling.
OAuth & Authentication
OAuth flows require URL-encoded redirect URLs and tokens. Proper encoding prevents authentication failures and security issues.
Form Data Debugging
Decode application/x-www-form-urlencoded data from form submissions. Debug and understand what data your forms are sending.
Analytics Tracking
Encode UTM parameters and campaign tracking values. Ensure spaces and special characters don't break analytics tracking.