🔗 Web Tool

URL Encoder & Decoder

Encode special characters in URLs or decode percent-encoded strings. Essential for web development, API testing, and debugging query parameters.

encodeURIComponent
encodeURI (full URL)

                    

                    

What Is URL Encoding?

URL encoding (also called percent encoding) replaces unsafe ASCII characters with a % followed by their hexadecimal value. This is necessary because URLs can only contain a limited set of characters from the ASCII set. Characters like spaces, &, =, and non-ASCII characters must be encoded for proper URL handling.

When to Use encodeURI vs encodeURIComponent

Function Encodes Preserves Use Case
encodeURI Spaces, non-ASCII :/?#[]@!$&'()*+,;= Encoding complete URLs
encodeURIComponent All special chars Only A-Z, 0-9, - _ . ~ Encoding query parameters

Common Characters and Their Encoded Values

Character Encoded Character Encoded
Space %20 or + & %26
= %3D ? %3F
# %23 / %2F
@ %40 : %3A

FAQ

What's the difference between %20 and + for spaces?

%20 is the standard URL encoding for space. The + sign is only used in query strings (application/x-www-form-urlencoded format). In path segments, always use %20.

Do I need to encode the entire URL?

No. Only encode individual parameter values using encodeURIComponent(). If you encode the entire URL with encodeURIComponent, it will also encode the slashes and colons, breaking the URL structure.