URL encoding (also called percent-encoding) converts characters that are not allowed in a URL into a format that can be transmitted over the internet. Each unsafe character is replaced by a % sign followed by two hexadecimal digits representing its UTF-8 byte value.
For example, a space becomes %20, an ampersand becomes %26, and a hash sign becomes %23.
&, =, or +Encoding uses the browser's built-in encodeURIComponent(), which encodes all characters except A–Z a–z 0–9 - _ . ! ~ * ( ). Single quotes and double quotes are also encoded for maximum compatibility.
Decoding uses decodeURIComponent() after converting any + signs to spaces, supporting both application/x-www-form-urlencoded and standard percent-encoded strings. Everything runs entirely in your browser — no data is sent to a server.
space → %20& → %26= → %3D+ → %2B/ → %2F? → %3F# → %23@ → %40