URL Encoder
Encode special characters in URLs using percent-encoding (encodeURIComponent). Instantly convert spaces, symbols, and Unicode for safe use in query strings.
Tip: Press Ctrl+Enter to encode.
What is URL encoding?
URLs can only contain a limited set of ASCII characters. Percent-encoding (also called URL encoding) converts characters outside that set into a %XX format, where XX is the hexadecimal value of the UTF-8 byte representing the character.
encodeURIComponent vs encodeURI
- encodeURIComponent — encodes everything except letters, digits, and
- _ . ! ~ * ' ( ). Use this for encoding individual query parameter values (what this tool does). - encodeURI — encodes everything except characters that are valid in a complete URI (including
: / ? # @ & = +). Use this only when encoding an entire URL.
Common URL Percent-Encoded Characters Table
Standard reserved characters that must be percent-encoded when used within query parameter values according to RFC 3986:
| Character | Percent-Encoded | RFC 3986 Meaning in URLs |
|---|---|---|
Space | %20 (or +) | Separator |
! | %21 | Sub-delimiter |
# | %23 | Fragment identifier |
$ | %24 | Sub-delimiter |
% | %25 | Escape character for hex encoding |
& | %26 | Parameter separator |
+ | %2B | Query encoding for space / plus |
/ | %2F | Path segment delimiter |
: | %3A | Scheme / port delimiter |
= | %3D | Query key-value separator |
? | %3F | Query string prefix |
@ | %40 | User info delimiter |
Frequently Asked Questions
What is percent-encoding (URL encoding)?
URLs only permit a restricted subset of ASCII characters (RFC 3986). Any character outside this set, including spaces, symbols, and Unicode characters, is converted into % followed by its two-digit hexadecimal byte value.
What is the difference between encodeURIComponent and encodeURI?
encodeURI leaves structural URL characters like '/', ':', and '?' intact, whereas encodeURIComponent encodes them, making it ideal for query string parameter values.
How are spaces handled in URL encoding?
Standard percent-encoding replaces spaces with '%20'. In some application/x-www-form-urlencoded forms, '+' is used instead, but '%20' is universally safe across query parameters.
Is any data sent to a server?
No. All string encoding runs entirely client-side using JavaScript in your browser without telemetry or server round-trips.