URL Encoder / Decoder

Percent-encode or decode URL text, for whole URLs or single components.

  • Runs locally in your browser
  • No upload required

Try it

Result
a%3D1%26b%3D2

Supported formats

Input
text
Output
text

Privacy

Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.

Processing
In your browser
Privacy level
Browser only

Percent-encoded the input using component rules.

How it works

  • Replaced characters that are unsafe in a URI with %XX or %UTF-8 sequences.
  • Produced the encoded value.
  • Component mode encodes reserved characters such as '&' and '='; whole-URL mode preserves the URL structure.

Methodology

  1. Percent-encode by replacing each byte that is not in the allowed set with %HH using uppercase hexadecimal digits.
  2. Reserve the RFC 3986 gen-delims and sub-delims in whole-URL mode, and encode them in component mode.
  3. Decode by validating every %HH escape before replacing it, so malformed input is rejected rather than partially decoded.

Usage

  1. Choose encode or decode.
  2. Choose component mode for query values, or whole-URL mode for a complete URL.
  3. Paste the value and read the result.

Examples

These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.

Encode a query value

jsonSelect to copy
{
  "mode": "encode",
  "value": "a=1&b=2",
  "component": true
}

Decode an escaped value

jsonSelect to copy
{
  "mode": "decode",
  "value": "caf%C3%A9",
  "component": true
}

Limitations

Why two modes exist

encodeURI and encodeURIComponent differ in which reserved characters they escape. Picking the wrong one either breaks a URL's structure or leaves a value ambiguous. Component mode is the safe default for values, which is why it is preselected.

Frequently asked questions

When should I use component mode?
Use it for any single query-string value or path segment. Use whole-URL mode only when you are encoding a complete, already-structured URL.

Sources

  1. RFC 3986: Uniform Resource Identifier (URI): Generic Syntax — IETF