Skip to content
Home
Dev Convert Generate Finance Calc Design Security Media

More categories

Productivity 23 Network Tools 18 Text Tools 16 SEO Tools 15 Education Tools 14 PDF Tools 10 Mockups 5

Learn and build

GuidesBlogAPI & MCPCheatsheetsChangelog All categories

Browse

401 tools · 15 categories

Start here

Popular tools New this week 18 All tools 401

Categories

Developer Tools 92 Converters 49 Finance Tools 31 Generators 31 Calculators 26 Design Tools 25 Media Tools 23 Productivity 23 Security Tools 23 Network Tools 18 Text Tools 16 SEO Tools 15 Education Tools 14 PDF Tools 10 Mockups 5

Learn and build

Guides Cheatsheets Blog REST API MCP server Changelog

No matches here.

Keep FindUtils free Sponsors fund new tools
  1. Cheatsheets
Guides Blog API & MCP
Sponsor
FindUtils
Sponsor
  1. Home
  2. Cheatsheets
  3. Programming
  4. jq Commands

Programming · Cheatsheet

jq Commands Cheatsheet

Pretty-print, select, map, and transform JSON on the command line

37 commands 7 sections

On this sheet

Basics 7 Arrays and objects 6 select and map 5 Transform 6 Sort and aggregate 6 Strings and CLI 6 Sources 1
Try it in the browser Convert between JSON and YAML formats instantly with syntax validation. Open JSON YAML Converter

No entry matches that filter.

Basics

  • jq . file.json Pretty-print JSON
  • jq -c . file.json Compact one-line JSON
  • jq -r .name file.json Raw string without quotes
  • jq .user.email file.json Read a nested field
  • jq .name // "unknown" Default when null or missing
  • jq .items[0] First array element
  • jq .items[-1] Last array element

Arrays and objects

  • jq .items[] Stream each array item
  • jq .items[1:4] Slice array indexes 1, 2, 3
  • jq keys List object keys
  • jq has("email") True if the key exists
  • jq length Length of array, object, or string
  • jq type JSON type of the input

select and map

  • jq ".[] | select(.active)" Keep matching objects
  • jq "map(.email)" Project one field into an array
  • jq "map(select(.score > 50))" Filter then keep an array
  • jq ".[] | select(has("email"))" Keep objects with a key
  • jq "select(.role == "admin")" Match a string field

Transform

  • jq "{name, id}" Build a smaller object
  • jq "del(.password)" Remove a field
  • jq ".count += 1" Update a number field
  • jq "to_entries" Object to key/value array
  • jq "from_entries" Key/value array to object
  • jq "flatten" Flatten nested arrays

Sort and aggregate

  • jq "sort_by(.name)" Sort objects by a field
  • jq "unique_by(.email)" Deduplicate by a field
  • jq "group_by(.team)" Bucket objects by a field
  • jq "map(.price) | add" Sum a numeric field
  • jq "min_by(.age)" Object with the lowest field
  • jq "max_by(.score)" Object with the highest field

Strings and CLI

  • jq -r ".name | ascii_downcase" Lowercase a string
  • jq -r "split("/")" Split a string into an array
  • jq -r "join(",")" Join an array into a string
  • jq "select(.msg | test("error"; "i"))" Regex match, ignore case
  • curl URL | jq . Pretty-print an HTTP JSON body
  • jq -n --arg n "$NAME" '{name:$n}' Build JSON from a shell variable

Sources

  • https://jqlang.org/manual/ jq manual: command-line filters and options. Browser playgrounds can support a smaller subset.

Related cheatsheets

  • Barcode Formats40 commands
  • JavaScript ES6+59 commands
  • Python Essentials59 commands

Guides that use these commands

  • JQ Playground Online: How to Query & Transform JSON with jq FiltersGuide · 12 min read
  • How to Convert an INI File to JSONGuide · 8 min read
  • How to Convert an ICS Calendar File to JSON in the BrowserGuide · 8 min read

Tools for this work

  • JSON YAML ConverterConvert between JSON and YAML formats instantly with syntax validation.
  • JSON to TypeScriptConvert JSON to TypeScript interfaces or type aliases with customizable options.
  • JSON to LiquidTurn JSON, JS, Python, PHP or YAML data, or a Handlebars, Mustache or Knap template, into Shopify Liquid.

From FindUtils

More to explore

Products and services from the team behind FindUtils.

Promote your tool
Featured product seeranks.com SeeRanks — transparent product discovery A public ranking board where paid placement is always labeled and every product keeps its earned position. View SeeRanks Public rank board #1 Sponsored #2 #3 #4 Paid placement is always labeled Free favicon tool emojifavicons.com Emoji Favicons Turn any emoji into a favicon with one HTML line. SVG, PNG or ICO, no sign-up. <link rel="icon" href=".../🦊.svg"> Create a favicon
FindUtils service findutils.com Articles for software tools A sourced article for your channels, or a sponsored FindUtils publication with editorial review. Compare packages Domain portfolio findutils.com Domain names for sale .com.dev.sh.app.io Unused names across dev tools, AI, PDF and commerce. Make an offer. Browse the list Playable ranking towerscore.io TowerScore — stack the skyline Play to climb, or buy a floor. Paid floors are labeled. Open TowerScore

Missing a tool you need?

Tell us what to build next. Most requests ship as a free browser tool, an API endpoint and an MCP tool.

Request a tool
FindUtils

Free, fast utilities that respect your data. Most tools process your files in the browser, so they never leave your device.

  • No sign-up for free tools
  • Most tools run in your browser
  • 349 tools on the REST API and MCP

Tools

DevelopersConvertPDFDesignSecurityAll tools →

Learn

GuidesBlogCheatsheetsChangelog

Build

REST APIMCP serverAPI referenceWorkflowsStatus

FindUtils

AboutLibraries we useSponsorRequest a toolDomains for saleContact
© 2026 FindUtils PrivacyTermsSitemap
Service status
FindUtils

Free, fast utilities that respect your data. Most tools run in your browser.

Build with it

REST APIMCP serverGuidesChangelog

FindUtils

AboutSponsorPrivacyContact
Theme
© 2026 FindUtils Terms
FindUtils
Guides Blog REST API MCP server Changelog

Categories

Developers 92 Convert 49 Finance 31 Generate 31 Calculate 26 Design 25
All 15 categories →

Keep it free

Sponsorship keeps every tool free and funds the new ones we ship each week.

Sponsor Back the project
Tools API Sponsor