JSON Array Filter

Filter a JSON array by typed equality at a JSON Pointer path.

Processing stays in this browser. Inputs are not uploaded.

Use strict JSON up to 200,000 characters, 20,000 values and 64 nesting levels. Duplicate keys, unsafe integers, nonfinite numbers and nonzero values that underflow to zero are rejected. Decimal precision and numeric spelling may change.

Keep array items matching a typed value

Paste a top-level array, set JSON Pointer key and Match value (JSON), then choose Keep matching items. A pointer is evaluated relative to each array item. Leave it empty to compare whole items. The match field must itself contain JSON: use "2" for a string and 2 for a number.

Example: two matching scores

Load the example to set the pointer to /score and the match to 2. Ada and Max remain in their original order; Lin is removed. An empty result is the valid JSON array []. Repeated matching items are retained, because filtering does not deduplicate.

Exact comparison rules

Comparison is recursive and type-sensitive. Object key order is ignored, but array order, case, whitespace inside strings and Unicode representation matter. An absent path causes an item-indexed error instead of being treated as null. The entire input is checked before output is offered. This page does not evaluate JavaScript, regexes, inequalities or JSONPath expressions.

For a slash in a key use ~1; for a tilde use ~0. Array indices start at zero. See JSON Pointer Resolver to test a path on one item. Use JSON Array Sorter to order the selected items afterward.

Matching numbers and preserving source data

Numbers are compared after parsing, so 2, 2.0 and 2e0 match. Decimal precision may round distinct numeric spellings to the same value. Keep exact identifiers quoted. Filtering preserves parsed values, not the source whitespace or number spelling. Keep the original before replacing data used by another application.

Reader limits and output

Input supports 200,000 characters, 20,000 values and 64 nesting levels. Duplicate keys, unsafe integers, nonfinite numbers and nonzero values that underflow to zero are rejected. Other decimals use JavaScript floating-point precision. Formatting, escape spelling and negative zero may normalize; quote precision-sensitive data as strings. General output is capped at two million characters. Processing stays in the browser, and editing inputs or options clears stale results.

An empty array returns an empty result without resolving the pointer, since there are no items. For a nonempty array, every item must support the chosen pointer.