πŸ”— URL Encode / Decode

Encode or decode URLs and special characters.

Encode
Decode
Plain Text
Encoded

What is URL encoding?

URL encoding (percent-encoding) converts characters into a format that can be transmitted over the Internet. URLs can only contain ASCII characters, so special characters, spaces, and Unicode must be encoded using % followed by hex values.

Common encodings

CharacterEncodedDescription
(space)%20Space character
!%21Exclamation mark
#%23Hash/pound
$%24Dollar sign
&%26Ampersand
+%2BPlus sign
=%3DEquals sign
@%40At sign

encodeURIComponent vs encodeURI

encodeURIComponent encodes everything except: A-Z a-z 0-9 - _ . ! ~ * ' ( ). Use this for query parameter values.
encodeURI preserves URL structure characters like : / ? # [ ] @ ! $ & ' ( ) * + , ; =. Use this for encoding a complete URL.