URL Encoder / Decoder

Encode URLs and query strings with encodeURIComponent or encodeURI, and decode percent-encoded strings back to readable text. Supports batch encoding of multiple lines. All in-browser, no data uploaded.

Quick load:
▶ Encode — Text to URL-encoded
◀ Decode — URL-encoded to Text

encodeURIComponent vs encodeURI — When to Use Which?

FunctionEncodesPreservesUse Case
encodeURIComponentAll special charactersA-Z a-z 0-9 - _ . ! ~ * ' ( )Query parameter values, form data, API keys
encodeURIMost special characters; , / ? : @ & = + $ # and aboveFull URLs, redirect URIs, base URLs
Rule of thumb: Use encodeURIComponent for query parameter values (it encodes &, =, ?, #). Use encodeURI for full URLs that you want to keep structurally intact. Read the URL Encoding Guide for a complete explanation.

Common URL Encoding/Decoding Examples

API Query Params: search=hello world becomes search=hello%20world. Always use encodeURIComponent for parameter values to avoid & breaking the query string.
International URLs: Chinese, Japanese, Korean, Arabic, and other non-ASCII characters are percent-encoded as UTF-8 byte sequences: 世界 becomes %E4%B8%96%E7%95%8C.
OAuth Redirect URIs: When registering redirect URIs in OAuth 2.0, the entire URL must be encodeURIComponent-encoded once more for the query parameter: redirect_uri=https%3A%2F%2Fexample.com%2Fcallback.
Double Encoding: Some APIs require double-encoding. E.g., %20 becomes %2520. Watch out for this common debugging pitfall.

Reserved Characters Reference

CharacterEncodedNameUsed In
!%21Exclamation markFragment identifiers (preserved by both)
#%23Number sign / hashFragment separator (preserved by encodeURI)
$%24Dollar signSub-delims (preserved by encodeURI)
&%26AmpersandQuery param separator (preserved by encodeURI)
'%27ApostropheSub-delims (preserved by both)
( )%28 %29ParenthesesSub-delims (preserved by both)
*%2AAsteriskSub-delims (preserved by both)
+%2BPlus signQuery param separator (preserved by encodeURI)
,%2CCommaSub-delims (preserved by encodeURI)
/%2FSlashPath separator (preserved by encodeURI)
:%3AColonScheme / port separator (preserved by encodeURI)
;%3BSemicolonSub-delims (preserved by encodeURI)
=%3DEquals signKey-value separator (preserved by encodeURI)
?%3FQuestion markQuery string start (preserved by encodeURI)
@%40At signAuthority delimiter (preserved by encodeURI)
space%20SpaceAlways encoded (never + in URL encoding)

Related Tools