jq Playground

Evaluates a jq-style filter expression against JSON entirely client-side. This supports a practical subset of jq: identity, field/index access, the .[] stream operator, a fixed set of builtins (length, keys, values, type, first, last, sort, reverse, min, max, add), and | pipes between them, not the full jq language. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-24

Overview

Introduction

jq is the standard command-line tool for slicing and filtering JSON, but installing it isn't always an option, and its full language is large.

This tool implements a practical, well-defined subset of jq's filter syntax that runs entirely in the browser, covering the accessors and builtins people reach for most often.

What Is jq Playground?

A jq-style filter evaluator supporting identity (.), field access (.name), index access (.[0]), the .[] stream operator, a fixed list of builtins, and | pipes chaining segments together.

It is explicitly not a full jq implementation, there's no arithmetic, string interpolation, object/array construction, conditionals, or user-defined functions.

How jq Playground Works

The filter is split on | into segments, each segment is either a recognized builtin name or an accessor chain tokenized into field/index/stream steps using a fixed grammar.

Segments are applied left to right against the running value (or, once .[] has streamed, against every item in the running array), and any segment that doesn't match the supported grammar produces an explicit unsupported-filter error rather than a silent wrong answer.

When To Use jq Playground

Use it for quick, common JSON filtering tasks, pulling a nested field, listing array items, counting entries, when you don't have jq installed or don't want to leave the browser.

It's also a fast way to sanity-check a simple jq-style expression before dropping it into a script that has real jq available.

Features

Advantages

  • Runs entirely client-side with no installation.
  • Covers the accessor patterns and builtins used in the vast majority of everyday jq one-liners.
  • Fails loudly with a specific message on unsupported syntax instead of silently misinterpreting it.

Limitations

  • No arithmetic, string interpolation, object/array construction (map, select with expressions, {} construction), conditionals, or custom functions, this is a fixed subset, not the jq language.
  • The builtin list is fixed to length, keys, values, type, first, last, sort, reverse, min, max, and add; anything else (e.g. select(), map(), sub()) is unsupported.

Examples

Extracting a nested field

Input

{"users":[{"name":"Ada"},{"name":"Grace"}]}

Output

[
  "Ada",
  "Grace"
]

Filter .users[].name streams each user object with .[] and then extracts .name from every streamed item.

Unsupported filter

Input

{"a":1}

Output

Unsupported jq expression. This tool supports: ., .field, .[n], .[], keys, length, values, type, first, last, sort, reverse, min, max, add, and | pipes.

A filter like .a + 1 uses arithmetic, which is outside this tool's supported subset, so it returns an explicit error instead of a wrong answer.

Best Practices & Notes

Best Practices

  • Build up a filter one pipe segment at a time, testing each step, since the tool reports exactly which point in the pipeline failed.
  • Use .[] before a field access (e.g. .items[].id) to pull the same field out of every array item at once.
  • Fall back to real jq or a script for anything involving arithmetic, conditionals, or object construction.

Developer Notes

The evaluator tracks a JqState with either a single running value or, once .[] has been hit, a streamed array of values; every subsequent step maps over that array instead of the single value, which keeps the streaming semantics correct without needing a generator-based evaluation model.

jq Playground Use Cases

  • Quickly pulling a nested field out of an API response without installing jq
  • Listing or counting items in a JSON array
  • Sanity-checking a simple jq expression before using it in a script with real jq

Common Mistakes

  • Assuming full jq syntax (select(), map(), string interpolation) will work, only the documented subset is supported.
  • Forgetting | between pipeline segments, e.g. writing .users[] .name instead of .users[] | .name.
  • Expecting arithmetic like .price * 1.1 to work, this subset has no arithmetic operators.

Tips

  • Start a filter with .[] to stream an array or object's values before chaining further accessors.
  • Check the FAQ for the exact builtin list if a filter you expect to work returns the unsupported-expression error.

References

Frequently Asked Questions