Encoding / Decoding

URL Encode / Decode

Percent-encode or decode URLs.

Encode type:
Original Text/URL
URL Encoded Result
Result will be shown here

What is URL Encoding?

URL encoding (percent-encoding) converts special characters to %XX format. Since URLs can only use ASCII characters, non-ASCII characters and reserved characters must be encoded for safe transmission.

Encoding Methods

  • encodeURIComponent: Encodes URL parameter values, encodes most special characters (recommended for values)
  • encodeURI: Encodes entire URL, preserves URL structure characters (: / ? # @)
  • Full Encode: Encodes all non-alphanumeric characters, strictest encoding

Use Cases

  • Query Parameters: Ensure values don't break URL structure
  • API Requests: Encode special characters in parameters
  • Cross-system Transfer: Ensure data passes correctly between systems
  • Debugging: Decode encoded URLs to see original content

Frequently Asked Questions

encodeURIComponent or encodeURI — which one?
Use encodeURIComponent for parameter values — it encodes =, &, ?, and / so the value cannot break the URL structure. Use encodeURI for a complete URL, since it preserves structural characters (: / ? #). The classic mistake is encoding a value with encodeURI, letting a bare & split it into two parameters.
Should a space be %20 or +?
It depends on the context: inside application/x-www-form-urlencoded (HTML forms and most backend query parsers) a space is +; in RFC 3986 URLs it must be %20, which is what encodeURIComponent produces. When parameters break across systems, + versus %20 confusion is usually the culprit.
Why does decoding produce the � replacement character?
The byte sequence is not valid UTF-8: the content was encoded as GBK but decoded as UTF-8, or the % sequences got double-processed (%2520 → %20 → space). Audit the encoding assumptions along the whole chain; the tool’s strict encoding modes help pinpoint where it breaks.