URL Encode/Decode

Encode and decode URLs with encodeURI and encodeURIComponent

encodeURI — leaves /?:@&=+$# intact

encodeURI preserves URL-structural characters: / ? : @ & = + $ #

encodeURIComponent encodes all special characters — use for query parameter values

What is URL Encoding?

URL encoding converts special characters in a URL into percent-encoded format (e.g., spaces become %20) so they can be safely transmitted over the internet. This tool supports both encodeURI (which preserves URL structure characters) and encodeURIComponent (which encodes everything), plus their decoding counterparts.

How to Use This URL Encoder/Decoder

  1. Select the mode: Encode URI, Decode URI, Encode Component, or Decode Component.
  2. Type or paste your URL or query string into the input area.
  3. The encoded or decoded result appears instantly in the output area.
  4. Use the copy button on either pane to copy the value to your clipboard.

Common Use Cases

  • Encoding query parameter values containing special characters
  • Decoding percent-encoded URLs for debugging or inspection
  • Preparing URLs for embedding in HTML or JavaScript
  • Testing API endpoints with encoded path segments
  • Converting international characters (Unicode) for URL-safe transmission

Frequently Asked Questions

What is the difference between encodeURI and encodeURIComponent?
encodeURI preserves URL-structural characters like / ? : @ & = + $ #, making it suitable for full URLs. encodeURIComponent encodes all special characters and should be used for individual query parameter values.
Why do spaces become %20 instead of +?
The + encoding for spaces is specific to the application/x-www-form-urlencoded format used in HTML form submissions. Standard URL encoding uses %20 as defined by RFC 3986, which is what encodeURI and encodeURIComponent produce.
Can I encode a full URL with encodeURIComponent?
You can, but it will break the URL structure by encoding slashes, colons, and other delimiters. Use encodeURI for full URLs and reserve encodeURIComponent for individual parameter values.