Build Percent-Encoded Query String – Spaces, &, =, and Keys

Local only

Demonstrate form-url-encoded output for spaces and reserved characters in both keys and values.

43 chars · 1 line

80 chars · 5 lines

3 parameters3 unique keys

Query builder percent encoding

How Build Query encodes spaces and reserved characters

URLSearchParams applies application/x-www-form-urlencoded serialization when VetaTool builds the query. Reserved & and = characters are percent-encoded, while spaces are emitted as + in both names and values. 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. Enter JSON containing spaces or reserved characters.
  2. Build the query and inspect %26, %3D, and + in the output.
  3. Parse the result back if you want to confirm the original strings are recovered.

Encoding protects query structure

A literal & inside a value must not start a new parameter, and a literal = must not become a structural separator. URLSearchParams percent-encodes those characters automatically.

Spaces use + under form-style query serialization, which Parse mode later decodes back to spaces.

Reserved characters in keys and values

The generated query safely encodes delimiters and spaces.

JSON object

{"a&b":"x=y & z","space key":"hello world"}

Built query string

a%26b=x%3Dy+%26+z&space+key=hello+world

Common questions

Frequently asked questions

Why are spaces emitted as +?

URLSearchParams uses form-url-encoded query serialization, where spaces are represented by +.

Why does & become %26?

A raw ampersand separates parameters, so a data ampersand must be encoded.

Are parameter names encoded too?

Yes. Keys and values both go through URLSearchParams serialization.

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