Encode or decode URL strings with support for encodeURIComponent and encodeURI modes
encodeURIComponent encodes all special characters including : / ? # [ ] @ ! $ & ' ( ) * + , ; =
URL encoding (percent-encoding) converts characters into a format that can be safely transmitted over the Internet. Special characters are replaced with a percent sign (%) followed by two hexadecimal digits.
Use URL encoding when including special characters in URLs, query parameters, form data, or any context where certain characters have reserved meanings.
encodeURIComponent encodes all special characters and is ideal for encoding query parameter values. encodeURI preserves URI structure characters and is suitable for encoding a full URI.
Space becomes %20, exclamation mark becomes %21, ampersand becomes %26, equals sign becomes %3D, question mark becomes %3F, and hash becomes %23.