URL encode and decode
Spaces, &, =, #, ?, slashes and non-English letters are not allowed as-is inside a URL parameter, so they are percent-encoded: a space becomes %20, & becomes %26, and Hindi text becomes a string of %E0%A4… bytes. Use encodeURIComponent for a single value (query parameter, path segment) and encodeURI for a complete URL where the separators must stay.
Common encodings
| Character | Encoded | Character | Encoded |
|---|---|---|---|
| space | %20 (or + in forms) | & | %26 |
| = | %3D | ? | %3F |
| / | %2F | # | %23 |
| @ | %40 | : | %3A |
| ₹ | %E2%82%B9 | + | %2B |
Decode a link copied from WhatsApp or an email tracker to read it, or encode a message for a wa.me/?text= WhatsApp link.