URL Encoder & Decoder

URL Encoding

URL encoding (percent encoding) replaces unsafe characters with a % followed by two hex digits. For example, a space becomes %20 and & becomes %26.

encodeURIComponent encodes everything except A-Z a-z 0-9 - _ . ! ~ * ' ( ). Use this for encoding individual URL parameters.

encodeURI preserves URL structure characters (: / ? # [ ] @ etc.) and only encodes characters that aren’t allowed in a URI. Use this for encoding a complete URL.