All Tools

URL Encoder / Decoder

Encode and decode URLs and URI components online

Input

Output

encodeURI vs encodeURIComponent:
encodeURI encodes a full URL but preserves : / ? # [ ] @ ! $ & ' ( ) * + , ; =
encodeURIComponent encodes everything except A-Z a-z 0-9 - _ . ~ — use this for query parameter values.

How URL Encoding Works

URL encoding (percent-encoding) replaces unsafe characters with a % followed by two hexadecimal digits representing the character's UTF-8 byte value.

Common Encodings

When to Use

Frequently Asked Questions

What is URL encoding?
URL encoding replaces unsafe ASCII characters with a '%' followed by two hex digits. For example, a space becomes %20. This ensures URLs are transmitted correctly.
What is the difference between encodeURI and encodeURIComponent?
encodeURI encodes a full URI but preserves characters like :, /, ?, #, &. encodeURIComponent encodes everything except letters, digits, and - _ . ~ making it ideal for query parameter values.
When should I use URL encoding?
Use URL encoding when passing special characters in query parameters, form data, or any text that will be part of a URL to prevent breaking the URL structure.