Percent-Encoded Ampersand in Query String – Use %26 Inside Values

Local only

Keep an ampersand inside a query value by encoding it as %26.

19 chars · 1 line

27 chars · 3 lines

1 parameter1 unique keys

Query string percent encoding

How do I keep an ampersand inside one query parameter?

A raw ampersand separates query parameters. Percent-encode it as %26 when the ampersand belongs to the value itself. This tool is free to use. No account or payment is required.

Last updated

What you can do here

  • Browser-native URLSearchParams behavior
  • Full URL and raw query parsing
  • Repeated parameter preservation
  • JSON object to query construction
  • Browser-local processing

Steps

  1. Paste the query into Parse to JSON.
  2. Look for raw & characters that belong inside a value.
  3. Encode those value characters as %26 before constructing the URL.

& is query syntax until it is encoded

In application/x-www-form-urlencoded query data, & separates one name/value pair from the next.

URLSearchParams decodes %26 back to & after parameter boundaries have already been identified, so the character stays inside the value.

Ampersand inside one value

%26 survives parameter splitting and decodes back to &.

Query string

?value=fish%26chips

Parsed JSON

{
  "value": "fish&chips"
}

Common questions

Frequently asked questions

Why can’t I use a raw ampersand in the value?

Because & is the separator between query parameters.

What does %26 decode to?

It decodes to a literal ampersand character.

Should I encode the whole URL?

Usually encode the individual component or embedded value, not the entire already-structured URL.

Debugging a specific Query String issue? Browse Query String troubleshooting.