jeffbailey.us
jq Cheat Sheet: Filters, Operators, and Output Formats
Every entry below is a jq filter, what it returns, and a minimal example. Output shown came from jq 1.8.2.
For the guided version with explanations and larger worked examples, read the jq Cookbook.
## Run Any Entry Here
The runner holds the same `employees.json` used throughout this reference. Paste any filter from the entries below into the filter box and press Run.
Input JSON { "company": "Acme", "employees": [ { "id": 1, "name": "Ada Lopez", "email": "ada@acme.example", "dept": "Engineering", "age": 34, "salary": 145000, "skills": ["go", "sql"], "manager": null }, { "id": 2, "name": "Ben Okafor", "email": "ben@acme.example", "dept": "Engineering", "age": 28, "salary": 118000, "skills": ["python"], "manager": 1 }, { "id": 3, "name": "Chen Wu", "email": "chen@contractor.example", "dept": "Design", "age": 41, "salary": 99000, "skills": ["figma", "css"], "manager": 1 }, { "id": 4, "name": "Dana Smith", "email": "dana@acme.example", "dept": "Sales", "age": 25, "salary": 72000, "skills": [], "manager": 3 } ] }
jq filter
Run
Output
Press Run to execute this filter.
This runner needs JavaScript. Every filter here also works in a terminal with the sample file from Set Up jq and the Sample Data.