URL Encode / Decode

Percent-encode special characters in URLs or query strings, and decode them back instantly.

URL Encode / Decode
Mode:

📐 How to Use

  1. Paste your text or URL in the input box.
  2. Choose "Full URL" to encode a complete URL (preserves :, /, ?, &, =, #).
  3. Choose "Component" to encode a query value — also encodes &, =, + and other structural characters.
  4. Switch to the Decode tab to convert a percent-encoded string back to plain text.

🎯 When to Use This

  • Building a search link that carries a user's phrase needs Component mode, otherwise an ampersand inside the phrase truncates the parameter.
  • Marketers assembling UTM tags with spaces and symbols in a campaign name encode the value before dropping it into a tracking link.
  • Debugging a sign-in redirect whose return address is nested inside another URL means decoding one layer at a time to see what was passed.
  • Reading a server access log full of percent sequences becomes practical once the path is pasted into the decode tab.

❓ Frequently Asked Questions

QDifference between encodeURI and encodeURIComponent?
encodeURI encodes a full URL and preserves structural characters (/, ?, &, =, :, #). encodeURIComponent encodes a single URL component (e.g. a query value) and also encodes those structural characters.
QWhy does a space become %20?
In URL encoding (RFC 3986), spaces are replaced with %20. In HTML form encoding they become +, but %20 is the standard for URLs.

ℹ️ About This Tool

Percent-encoding replaces a byte with a percent sign and two hex digits, but which bytes need replacing depends on where the string will sit. A slash is structure inside a path and data inside a query value. An ampersand separates parameters, so one belonging to a value must be encoded or the parameter splits. The strict rule breaks a whole address; the loose rule corrupts a single value.

The two modes map onto that distinction. Component, the default, uses encodeURIComponent and leaves only letters, digits and - _ . ! ~ * ' ( ) untouched. Full URL uses encodeURI, which also preserves the reserved set ; / ? : @ & = + $ , # so a complete address stays usable. Decoding runs decodeURIComponent and shows an error rather than partial output when a sequence is malformed. Everything runs in the browser.

⚠️ Notes & Limits

  • Decoding treats a plus sign as a literal plus, so query strings written in HTML form encoding, where a plus means a space, need that substitution first.
  • Full URL mode leaves ? # and & alone, so a literal question mark inside a path segment or value is not encoded; switch to Component for single values.
  • A malformed sequence such as a bare percent or %ZZ makes decoding fail outright and show an error instead of returning the text partially decoded.
  • Percent-encoding operates on bytes, so each non-ASCII character becomes its UTF-8 bytes and one accented letter expands into two percent groups.