Mode Reference

encodeURIComponent encodes everything except letters, digits, - _ . ! ~ * ' ( ). Use for query parameter values.
encodeURI encodes everything except valid URL characters. Use for full URLs.
Form Data like encodeURIComponent but encodes spaces as + (HTML form submission format).

About This Tool

URL encoding (also called percent-encoding) converts characters that are not allowed in URLs into a %XX format where XX is the hexadecimal ASCII code. This tool supports both encodeURIComponent() (encodes everything except unreserved characters) and encodeURI() (preserves the URL structure). It also decodes percent-encoded strings back to readable text. Commonly used when constructing query parameters, handling form submissions, and working with API requests.

How to Use

  1. Select Encode or Decode mode.
  2. Paste your URL or text into the input field.
  3. Choose between Component encoding (for individual query values) or Full URL encoding (preserves /, ?, &).
  4. The encoded/decoded result appears instantly. Click Copy to copy it.

Frequently Asked Questions

When should I use encodeURIComponent vs encodeURI?

Use encodeURIComponent() when encoding individual query parameter values it encodes &, =, and +. Use encodeURI() when encoding a full URL it preserves the structural characters like ://, /, and ?.

Why does a space become %20 or +?

%20 is the standard percent-encoding for space per RFC 3986. The + notation for spaces comes from the older application/x-www-form-urlencoded format used by HTML forms. Both are valid in query strings; %20 is preferred in modern APIs.

Can this decode double-encoded URLs?

Yes paste a double-encoded string and click Decode twice. Each decode pass removes one layer of encoding. Double encoding is common when URLs are embedded inside other URLs.