URL Encode/Decode
Encode or decode URL strings with proper URL encoding.
Input
Output
About URL Encode/Decode
URL encoding converts special characters to percent-encoded format. Use this tool to encode or decode URL strings.
Common Use Cases:
- Encoding URLs with special characters
- Encoding form data for URLs
- Decoding encoded URLs
- Preparing data for URL parameters
Frequently Asked Questions
URL encoding (percent-encoding) replaces unsafe characters with a % followed by their hexadecimal ASCII code. Characters that must be encoded include: spaces (→ %20), & (→ %26), = (→ %3D), + (→ %2B), / (→ %2F), ? (→ %3F), # (→ %23), and non-ASCII characters like accented letters and emoji. Safe characters that don't need encoding are letters, digits, and - _ . ~
Both %20 and + represent spaces in URLs, but in different contexts. %20 is used in the path component of a URL (e.g., /my%20page). The + sign represents a space only in the query string component (e.g., ?q=hello+world), following the older "application/x-www-form-urlencoded" convention. Our encoder uses %20 for all spaces, which is safe in all URL contexts.
Use encodeURIComponent() in JavaScript (or equivalent in other languages) whenever you include user-provided values in a URL — search terms, usernames, file names, or any dynamic data. Failing to URL-encode can break links if the data contains &, =, or / characters, and can create security vulnerabilities (open redirect, parameter injection) if the data contains # or ? characters.