URL Encoder/Decoder
Encode and decode URLs for safe transmission
Input
Output
Common URL Encodings
␣
%20
Space
!
%21
Exclamation
#
%23
Hash
$
%24
Dollar
&
%26
Ampersand
'
%27
Apostrophe
(
%28
Open Paren
)
%29
Close Paren
+
%2B
Plus
/
%2F
Slash
:
%3A
Colon
=
%3D
Equals
?
%3F
Question
@
%40
At
About URL Encoding
encodeURIComponent: Encodes all characters except: A-Z a-z 0-9 - _ . ! ~ * ' ( )
encodeURI: Encodes all characters except: A-Z a-z 0-9 ; , / ? : @ & = + $ - _ . ! ~ * ' ( ) #
Frequently asked questions
When should I use URL encoding?
Encode special characters when passing data in URLs, especially: spaces, &, =, ?, #, and non-ASCII characters. Always encode user input in query parameters to prevent errors and security issues.
What's the difference between encodeURI and encodeURIComponent?
encodeURI encodes a full URL, preserving :, /, ?, #, etc. encodeURIComponent encodes everything except letters, digits, - _ . ! ~ * ' ( ), suitable for encoding individual parameter values.
Why do I see %20 instead of spaces?
URLs cannot contain spaces. %20 is the percent-encoded representation of a space. Some systems use + for spaces in query strings, but %20 is more universally compatible.