URL Encoder & Decoder

Percent-encode URLs or decode percent-encoded strings. Supports query strings, special chars, and Unicode.

Input
Output
Result appears here…

What is URL Encoding?

URL Encoding (also called percent-encoding) replaces unsafe ASCII characters with a % followed by two hex digits. It's required by RFC 3986 so URLs can be safely transmitted in HTTP requests.

encodeURIComponent vs encodeURI

  • encodeURIComponent β€” encodes everything except A-Z a-z 0-9 - _ . ! ~ * ' ( ). Use for query string values.
  • encodeURI β€” leaves URL-reserved chars (: / ? # [ ] @ ! $ & ' ( ) * + , ; =) alone. Use for complete URLs.

Example

Input: hello world?name=John&age=30
encodeURIComponent: hello%20world%3Fname%3DJohn%26age%3D30

FAQ

When should I use URL encoding?
Always encode values that go into a URL β€” query parameters, path segments, fragment identifiers β€” to prevent breakage with spaces, slashes, ampersands, and Unicode.
Why does + sometimes mean space?
In application/x-www-form-urlencoded (form submissions), + means space. Pure URL percent-encoding uses %20.