> percent | url | rfc3986 <
// Percent encoding - Convert characters to %XX format for URLs and URIs
Standards Compliant
Follows RFC 3986 specification for URI percent encoding.
Full Unicode
Correctly handles UTF-8 encoded Unicode characters and emojis.
Encoding Options
Choose between standard or full encoding for all characters.
>> technical info
How Percent Encoding Works:
Percent encoding replaces unsafe ASCII characters with a percent sign (%) followed by two hexadecimal digits representing the character's byte value. UTF-8 characters are encoded as multiple %XX sequences.
Example:
"Hello World!" → Hello%20World%21
Why Use Percent Encoding:
- >URL and URI encoding
- >Form data submission
- >Query string parameters
- >Path components in URLs
- >HTTP headers and cookies
>> frequently asked questions
What is percent encoding?
Percent encoding (also called URL encoding) is a mechanism for encoding information in a URI by replacing unsafe ASCII characters with a '%' followed by two hexadecimal digits.
When should I use percent encoding?
Use percent encoding when including special characters in URLs, query parameters, form data, or any context where certain characters have special meaning and need to be escaped.
What's the difference between encodeURI and encodeURIComponent?
encodeURI encodes a complete URI, preserving characters like :/?#[]@. encodeURIComponent encodes everything except unreserved characters (A-Z, a-z, 0-9, -, _, ., ~).
Why does space become %20 or +?
In URLs, spaces are encoded as %20. In form data (application/x-www-form-urlencoded), spaces can be encoded as + for historical reasons. Both are valid but used in different contexts.