JSON query — filter a JSON array with simple field conditions

Paste a JSON array, write one condition per line such as status == open or tags contains billing, and get back the matching items as JSON and as a table.

Live demo · real result from this tool
Operators: == != > >= < <= contains startsWith endsWith matches in !in exists !exists. Fields can be paths like address.city.
Match
Matches2
Items searched
3

Matching items

[  {    "id": 1,    "name": "Asha",    "city": "Pune",    "score": 92.5,    "active": true  },  {    "id": 3,    "name": "Chen",    "city": "Taipei",    "score": 85.25,    "active": true  }]

Matches as a table

idnamecityscoreactive
1AshaPune92.5true
3ChenTaipei85.25true

Processed on your device — nothing is uploaded.

How to use JSON query

  1. Paste your data into JSON array. An object that contains an array also works; the first array inside it is used.
  2. Write Conditions (one per line) in the form field operator value, such as score > 80.
  3. Choose Match: All conditions (every line must be true) or Any condition (at least one).
  4. Read Matches and Items searched, then copy the Matching items or download the table as CSV.

With no conditions, every item is returned.

What it does and when to use it

When an API returns hundreds of records and you need the few that matter, scrolling and searching for text is slow and error-prone. Write the rule once and the tool lists exactly the items that pass. Typical uses: open tickets with a billing tag, orders over a value, users with no email address, log entries from a list of hosts, or products whose name matches a pattern.

Operators: ==, !=, >, >=, <, <=, contains, startsWith, endsWith, matches, in, !in (also written not in), exists and !exists. Fields can be paths such as address.city or items[0].sku. contains checks whether an array holds a value, or whether a string includes some text.

To select values by path rather than filter records, use the JSONPath tester. To filter and then sort or paginate, use the JSON array tools. The JSON to table view is handy for reading the full original list.

How it works

Each line is parsed into a field, an operator and a value. The value is read as JSON if possible, otherwise as plain text; for in and !in it is split on commas. Then every item in the array is tested, entirely in your browser. A comparison such as > is numeric when the field is a number, and text-based otherwise; a missing or null field never passes >, >=, < or <=. The matches keep their original order and are also shown as a table, with one column per key found.

Worked examples

Three support tickets (101 open/high/billing with no assignee, 102 closed/low/login, 103 open/medium/billing and refund, assigned to ben).

status == open
tags contains billing          →  Matches: 2  (tickets 101 and 103)

With Match set to Any condition:

assignee !exists
priority == high               →  Matches: 2  (102 has no assignee key, 101 is high)

Ticket 101 has "assignee": null, so it fails !exists and only matches because of its priority.

priority in high, medium
id >= 103                      →  Matches: 1  (ticket 103)

Limits and tips

  • An unreadable line, such as a ~ 1, stops the query with a message showing the expected form.
  • The tool reads the whole array into memory; very large exports may be slow to filter in a browser.

Frequently asked questions

Do I need quotes around text values?
No. status == open works, and so does status == "open". Quotes help when a value has leading or trailing spaces. Values that look like JSON, such as true, null, 42 or [1,2], are read as those types.
Is matching case-sensitive?
== and != compare exactly, so "Open" does not equal open. contains, startsWith and endsWith ignore case, and matches uses a regular expression with the i flag, so it ignores case too.
Why did "7" and 7 both match code == 7?
Equality is loose between plain values. A string and a number with the same text count as equal, which suits JSON from forms and CSV exports where numbers often arrive as strings. Use the JSON Schema validator if you need to enforce types.
What is the difference between null and a missing field?
field exists is true when the key is present, even if its value is null. field !exists is true only when the key is absent. To find nulls, write field == null.
Can I sort or pick fields as well?
Not here. This tool only filters. For sorting, keeping chosen fields and paging, use the JSON array tools, which accept the same conditions.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close