> 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.
Other Languages
References
How we make sure
We check this tool with the automated test suites linked below. Example checks are shown in their original language.
- Verification method
- Compare RFC 3986 encoding and full UTF-8 byte escapes, then decode mixed unescaped Unicode.
- Comparison reference
- Native encodeURIComponent plus explicit RFC 3986 reserved-character assertions.
- Verification scope
- These samples and boundaries do not prove correctness for every input.
Test source and cases (select a file to read it)
-
legacy-reliability.test.js
- Percent encoding: UTF-8 URI component output agrees with the native URI codec
These checks cover the listed examples and boundaries, not every possible input. Round trips and checks using the same library are not independent verification.