Encode and decode URLs using Full URL (encodeURI) or URL Component (encodeURIComponent) modes
Percent-encoding (also called URL encoding) replaces unsafe or reserved characters with a % sign followed by two hexadecimal digits representing the byte value in UTF-8. For example, a space becomes %20 and © becomes %C2%A9.
These characters have special meaning in a URI and must be percent-encoded when used as data (not as delimiters). encodeURIComponent() encodes all of them; encodeURI() preserves most of them.
:/?#[]@!$&'()*+,;=encodeURI() is designed for a complete URL and does not encode characters that are valid URI syntax (e.g. / : ? # @ ! $ & ' ( ) * + , ; =). encodeURIComponent() encodes everything except unreserved characters, making it safe for embedding values inside query strings or path segments.
We use cookies
We use Google Analytics to understand how visitors use this site. No personal data is sold or shared with third parties. Privacy Policy