Parse query string

Parse URL query parameters into ordered names and repeated values.

freeworks offlinenothing uploaded
ToolQuery String Parser
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

The query is split at ampersands, percent-decoded with form rules, and repeated names remain multiple values. A bare name can produce an empty value, and plus signs become spaces.

  • URLSearchParams matches browser and form behavior.
  • Insertion order remains visible.

Worked example

Parse Query String
Parse a URL query string into individual key-value pairs
Input
											?page=1&limit=20&sort=name
										
Output
												page = 1
limit = 20
sort = name
											

When to use this

Filter UIs, analytics tags, and form servers parse query strings.

Edge cases

  • Plus decodes to space under form rules.
  • Repeated keys must not be overwritten.
  • A key without equals differs from an absent key.

References