Our free online URL Encoder & Decoder converts special characters to percent-encoded format and decodes them back. Essential for web developers working with query strings, API parameters, and internationalized URLs.
URL encoding, also known as percent-encoding, converts characters into a format that can be transmitted over the Internet. URLs can only contain a limited set of ASCII characters. Characters outside this set must be encoded as %XX where XX is the hexadecimal value.
Reserved Characters: ! # $ & ' ( ) * + , / : ; = ? @ [ ]
Unsafe Characters: Space, < > " { } | \ ^ ` ~
Non-ASCII: Any character outside the basic ASCII set (including Unicode)
encodeURI: Encodes a complete URI, preserving characters with special meaning (: / ? # etc.)
encodeURIComponent: Encodes a URI component (like a query parameter), encoding ALL special characters including : / ? #
Query Parameters: Encoding user input in URL parameters
API Requests: Ensuring special characters don't break API calls
Form Submissions: application/x-www-form-urlencoded data
Bookmarks: Encoding page state in shareable URLs
Space → %20 (or + in query strings)
& → %26
= → %3D
? → %3F
# → %23
/ → %2F
URLs can only use the ASCII character set. The safe characters are: A-Z, a-z, 0-9, and - _ . ~ All other characters should be percent-encoded for reliable transmission.
1. Convert the character to its UTF-8 byte sequence
2. Convert each byte to hexadecimal
3. Prefix each hex value with %
Example: € → UTF-8: E2 82 AC → %E2%82%AC
Scheme: http:// or https:// (not encoded)
Authority: user:pass@host:port (@ and : have special meaning)
Path: /path/to/resource (/ separates segments)
Query: ?key=value&key2=value2 (& and = have special meaning)
Fragment: #section (not sent to server)
• Always encode user-provided data in URLs
• Use encodeURIComponent for query parameter values
• Use encodeURI only for complete URLs
• Decode URLs before displaying to users
• Be aware of double-encoding issues