Encode special characters for URLs or decode percent-encoded strings. Supports full URLs, individual components, query strings, and Unicode characters. All processing happens in your browser.
Encode = encodeURIComponent (encodes everything except letters, digits,
- _ . ~ ).
encodeURI = preserves URL structure (: / ? # @ & etc.).
Examples
What is URL encoding?
URL encoding (also called percent-encoding) replaces special characters with a % followed by their
hex value. For example, a space becomes %20 and an ampersand becomes %26. This is
required because URLs can only contain a limited set of ASCII characters.
encodeURIComponent vs encodeURI
encodeURIComponent
Encodes everything except: A-Z a-z 0-9 - _ . ~
Use for: query parameter values, form data, individual path segments.
encodeURI
Preserves URL-safe characters: : / ? # [ ] @ ! $ & ' ( ) * + , ; =
Use for: encoding a full URL while keeping its structure intact.
Common encodings
| Character | Encoded | Character | Encoded |
|---|---|---|---|
| Space | %20 or + |
& |
%26 |
= |
%3D |
? |
%3F |
# |
%23 |
/ |
%2F |
@ |
%40 |
+ |
%2B |