---
title: "jq Playground: Run jq Online in Your Browser | Prettify"
description: Run jq queries online on your own JSON. A jq engine with 192
  builtins runs in your browser, so nothing is uploaded. Pro tool; one free try
  per day.
url: https://prettify.tools/jq-playground
---

# jq Playground: Run jq Online

Load a JSON document, then filter, reshape, and total it with jq without installing anything. Prettify has its own jq engine that runs in your browser, and it matches jq 1.7 for the features its docs list. The box on this page loads and checks your JSON; the jq panel in the editor runs the queries.

## What this jq playground does

jq is a query language for JSON. A jq expression reads a stream of values and returns a stream of values, so one query can select records, rename fields, group rows, and compute totals. Prettify runs jq on your device, with its own engine rather than a WebAssembly port of the jq command.

Here is how the work splits. The box above checks and formats the JSON you paste; it does not run jq filters. The jq panel runs in the editor at /app/editor. It is a Pro tool, and Free users get one free try of it per day.

## What the jq panel gives you

The panel evaluates your expression as you type. The Source pane shows your document and the Result pane shows the output as a stream, the way the jq command prints it.

- The engine registers 192 builtin names, from select, map, and group\_by to date functions and the @csv and @base64 formats.
- Quick buttons, a Guide of example expressions, and a Wizard help you build a query without remembering the syntax.
- Assignment operators such as |= and += change values and return the whole document.
- You can define your own functions with def, and bind several variables at once with destructuring.
- Copy puts the whole result stream on the clipboard, in the text the jq command would print.
- Apply writes the result back to the document, after you confirm the replacement.
- JSON numbers stay exact when a query only reads or copies them, even large integers and long decimals.

## How to run jq online

Start with the box on this page if you want a quick check of your JSON, then move to the editor to query it. The steps below follow that path, from the first paste to a result you can copy or apply.

1. Paste your JSON into the box, or select Try an example. The box accepts up to 512 KB.
2. Read the result panel. It shows a one-line summary and the formatted JSON, or the line and column of the first error.
3. Select Open in full editor. If the JSON has an error, the button reads Fix it in the editor.
4. In the editor toolbar, select jq in the Transform group. You can also press Cmd+K (Ctrl+K on Windows and Linux) and run Query / Transform.
5. Type a jq expression. The Result pane updates as you type and shows a count, such as 2 results.
6. Select Copy to copy the output, or select Apply and confirm to replace the document with it.

## Worked example: total sales per customer

This document holds three orders. The query groups them by customer, then builds one object per group with the customer name and the sum of its totals.

```
# Input
{
  "orders": [
    { "id": 1001, "customer": "Acme", "status": "shipped", "total": 120.5 },
    { "id": 1002, "customer": "Globex", "status": "pending", "total": 80 },
    { "id": 1003, "customer": "Acme", "status": "shipped", "total": 45.25 }
  ]
}

# Query
.orders
| group_by(.customer)
| map({ customer: .[0].customer, total: (map(.total) | add) })

# Result
[
  { "customer": "Acme", "total": 165.75 },
  { "customer": "Globex", "total": 80 }
]
```

## Reading the result

group\_by(.customer) turns the order list into one array per customer. map then runs once for each of those arrays. Inside it, .\[0].customer takes the name from the first order, and map(.total) | add sums the totals of that group.

This query returns one array, so the pane title reads 1 result. If you run .orders\[] | select(.status == "shipped") instead, you get two separate objects, and the title reads 2 results. Apply would then write a single array holding both.

## Common uses

Reach for jq when scrolling a tree is too slow and a spreadsheet is the wrong tool. These are the jobs people bring to a jq playground most often, and each one is a short query.

- Pull one field out of every record in an API response.
- Filter a long array down to the items that match a status, a date, or a threshold.
- Total, count, or average a field, grouped by another field.
- Rewrite a config file, for example set every price or rename every key.
- Test a filter before you paste it into a shell script or a CI step.

## Where Prettify jq differs from the jq command

The engine covers normal jq use, and its docs list the differences. A query has one input document, so inputs produces nothing. The env and $ENV values are empty objects, because the browser has no process environment. Very deep recursion in your own functions ends with an error.

Regular expressions use the JavaScript engine, not Oniguruma. A field name used on an array, such as .items.price, maps over the elements instead of raising an error. Number output follows JSON, so infinite prints as null.

## Free and Pro

The jq panel is part of Pro, a one-time purchase of US$19.99 with lifetime access and no subscription. Free users can open a Pro tool and select Try it free today. That gives one free try of each Pro tool until the end of the local day. The inline box on this page, the Tree, Raw, and Table views, and format conversion stay free.

## Frequently asked questions

### Does the box on this page run my jq filter?

No. The box loads your JSON, checks that it parses, and shows it formatted. To run a jq filter, open the document in the editor and use the jq panel.

### Is the jq playground free?

The jq panel is a Pro tool. Free users get one free try of it per day. Pro costs US$19.99 once, with lifetime access and no subscription.

### Is this the real jq?

It is a custom engine, not a port of the jq command. It matches jq 1.7 for the features its docs list, and it names its differences, such as regular expressions that use the JavaScript engine.

### Is my JSON uploaded when I run a query?

No. The jq engine runs on your device, and Prettify does not save your queries to disk. Your document leaves the device only if you create a share link.

### Can I save the result of a query?

Yes. Copy puts the output on the clipboard. Apply replaces the document with the result after you confirm, and History lets you return to an earlier version.

### Does jq change my large numbers?

Not when a query only reads or copies them. Arithmetic, sums, and comparisons convert a number to a floating-point value first, and the Result pane then shows a note that the result is approximate.

## Related tools

- [JSON Viewer with Tree, Table, and Diagram Views](https://prettify.tools/json-viewer)
- [JSON Editor Online](https://prettify.tools/json-editor)
- [JSON Formatter: Prettify and Pretty Print JSON](https://prettify.tools/json-formatter)
- [SQL Playground: Query a CSV with SQL](https://prettify.tools/sql-playground)
- [XPath Tester and Playground](https://prettify.tools/xpath-playground)
- [JSONL Viewer for JSONL and NDJSON Files](https://prettify.tools/jsonl-viewer)

## Structured data

```json
{
  "@context": "https://schema.org",
  "@type": "SoftwareApplication",
  "name": "Prettify",
  "url": "https://prettify.tools",
  "description": "Multi-format data viewer, editor, and query engine for JSON, YAML, CSV, XML, Mermaid, Markdown, MDX, HTML, and SVG",
  "applicationCategory": "DeveloperApplication",
  "operatingSystem": "Web, macOS, Windows, Linux",
  "offers": [
    {
      "@type": "Offer",
      "price": "0",
      "priceCurrency": "USD",
      "description": "Free tier with core features"
    },
    {
      "@type": "Offer",
      "price": "19.99",
      "priceCurrency": "USD",
      "description": "Pro: lifetime access to all features"
    }
  ],
  "publisher": {
    "@id": "https://prettify.tools/#organization"
  }
}
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "@id": "https://prettify.tools/#organization",
  "name": "Prettify",
  "legalName": "Off Leash Labs",
  "url": "https://prettify.tools/",
  "logo": {
    "@type": "ImageObject",
    "url": "https://prettify.tools/icon-512.png",
    "width": 512,
    "height": 512
  },
  "contactPoint": {
    "@type": "ContactPoint",
    "contactType": "customer support",
    "email": "offleashlabs@gmail.com",
    "availableLanguage": "English"
  }
}
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "WebPage",
      "@id": "https://prettify.tools/jq-playground",
      "url": "https://prettify.tools/jq-playground",
      "name": "jq Playground: Run jq Online in Your Browser | Prettify",
      "description": "Run jq queries online on your own JSON. A jq engine with 192 builtins runs in your browser, so nothing is uploaded. Pro tool; one free try per day.",
      "isPartOf": {
        "@type": "WebSite",
        "name": "Prettify",
        "url": "https://prettify.tools"
      }
    },
    {
      "@type": "FAQPage",
      "mainEntity": [
        {
          "@type": "Question",
          "name": "Does the box on this page run my jq filter?",
          "acceptedAnswer": {
            "@type": "Answer",
            "text": "No. The box loads your JSON, checks that it parses, and shows it formatted. To run a jq filter, open the document in the editor and use the jq panel."
          }
        },
        {
          "@type": "Question",
          "name": "Is the jq playground free?",
          "acceptedAnswer": {
            "@type": "Answer",
            "text": "The jq panel is a Pro tool. Free users get one free try of it per day. Pro costs US$19.99 once, with lifetime access and no subscription."
          }
        },
        {
          "@type": "Question",
          "name": "Is this the real jq?",
          "acceptedAnswer": {
            "@type": "Answer",
            "text": "It is a custom engine, not a port of the jq command. It matches jq 1.7 for the features its docs list, and it names its differences, such as regular expressions that use the JavaScript engine."
          }
        },
        {
          "@type": "Question",
          "name": "Is my JSON uploaded when I run a query?",
          "acceptedAnswer": {
            "@type": "Answer",
            "text": "No. The jq engine runs on your device, and Prettify does not save your queries to disk. Your document leaves the device only if you create a share link."
          }
        },
        {
          "@type": "Question",
          "name": "Can I save the result of a query?",
          "acceptedAnswer": {
            "@type": "Answer",
            "text": "Yes. Copy puts the output on the clipboard. Apply replaces the document with the result after you confirm, and History lets you return to an earlier version."
          }
        },
        {
          "@type": "Question",
          "name": "Does jq change my large numbers?",
          "acceptedAnswer": {
            "@type": "Answer",
            "text": "Not when a query only reads or copies them. Arithmetic, sums, and comparisons convert a number to a floating-point value first, and the Result pane then shows a note that the result is approximate."
          }
        }
      ]
    }
  ]
}
```
