URL Encoder

Encode and decode URL components

Input
Output
Output will appear here...

Frequently Asked Questions

What is URL encoding?

URL encoding (percent-encoding) converts special characters into a format that can be transmitted over the internet. Characters like spaces, &, ?, and = are replaced with % followed by their hexadecimal value (e.g., space becomes %20).

When should I URL encode?

URL encode when passing data in query strings, form submissions, or any URL parameter. Special characters in URLs can break parsing or be misinterpreted by servers. Always encode user input before adding it to URLs.

What is the difference between encodeURI and encodeURIComponent?

encodeURI encodes a full URL but preserves characters like :, /, ?, and &. encodeURIComponent encodes everything except letters, digits, and - _ . ! ~ * ' ( ). Use encodeURIComponent for query parameter values.

Why do spaces become %20 or +?

In URL encoding, spaces become %20. In form data (application/x-www-form-urlencoded), spaces can also be represented as +. Both are valid, but %20 is more universally compatible across all URL contexts.