gitwtfhub

wtf is jq?

jqlang/jq — explained in plain English

Analysis updated 2026-06-20

34,627CAudience · developerComplexity · 2/5LicenseSetup · easy

TL;DR

jq is a lightweight command-line tool that lets you filter, extract, and reshape JSON data using a simple expression language, no programming required. Works seamlessly in shell pipelines alongside curl and grep.

Mindmap

mindmap
  root((jq))
    Filtering
      Extract fields
      Slice arrays
      Conditional logic
    Transforming
      Reshape JSON
      Compute values
      Build pipelines
    Integration
      curl pipelines
      Shell scripting
      Log processing
    Input Sources
      API responses
      Config files
      Log output
    Installation
      macOS support
      Linux support
      Windows support

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Extract specific fields from API responses without writing a script, pipe curl output directly into jq to get just the data you need.

REASON 2

Explore and debug JSON config files or log output quickly from the terminal without opening a code editor.

REASON 3

Write deployment or automation shell scripts that transform JSON payloads between tools in a single readable command.

REASON 4

Filter and reshape large JSON data files for quick analysis or to feed into another command-line tool.

What's in the stack?

CJSONCLIUnix pipes

How it stacks up

jqlang/jqmpv-player/mpvnothings/stb
Stars34,62735,11233,558
LanguageCCC
Setup difficultyeasyhardeasy
Complexity2/54/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min

Install via package manager: brew install jq (macOS), apt install jq (Linux), or download a single binary for Windows. No dependencies or configuration needed.

MIT license, free to use, modify, and distribute in personal or commercial projects with no restrictions.

Wtf does this do

jq is a command-line tool for processing and transforming JSON data, in much the same way that tools like grep and sed let you process plain text on the command line. The problem it solves is that JSON has become the universal format for data exchange, API responses, configuration files, log outputs, but it is not designed to be readable or filterable with basic text tools. jq gives you a compact, expressive way to query, reshape, and extract information from JSON without writing a full program. The tool works through a filter language where you write an expression that describes the transformation you want applied to the input JSON. The simplest filters extract fields by name: the expression .version applied to a package.json file returns just the value of the version field. More complex filters can slice arrays, iterate over lists, apply conditional logic, restructure data into entirely new shapes, compute values, and combine multiple transformations in a pipeline. Because jq reads from standard input and writes to standard output, it fits naturally into Unix shell pipelines alongside curl, grep, sort, and other tools. A typical real-world use: you call an API with curl, pipe the raw JSON response into jq with a filter that extracts a specific list of values, and then pipe those values into another tool. What would otherwise require a short Python script becomes a single readable command line. jq is written in C with no runtime dependencies, so it ships as a single small executable available on macOS, Linux, and Windows through most package managers. You would reach for it any time you are working with JSON data in a shell, debugging an API, exploring a data file, writing a deployment script, or processing log output, and want to do it quickly without leaving the terminal.

Yoink these prompts

Prompt 1
I have a JSON API response and want to extract a nested field called 'user.email' from each item in a 'results' array. Write me a jq filter that does this.
Prompt 2
Show me how to use jq with curl to call the GitHub API for a repo and print only the repo name, star count, and description as clean output.
Prompt 3
I have a JSON log file where each line is a JSON object. Write a jq command to filter only the lines where the 'level' field equals 'error' and print the 'message' field.
Prompt 4
Using jq, how do I convert an array of objects like [{"name":"Alice","score":10}] into a simple key-value object like {"Alice":10}?
Prompt 5
Write a jq filter that takes a package.json file and outputs only the name, version, and list of dependency names (not their versions).

Frequently asked questions

wtf is jq?

jq is a lightweight command-line tool that lets you filter, extract, and reshape JSON data using a simple expression language, no programming required. Works seamlessly in shell pipelines alongside curl and grep.

What language is jq written in?

Mainly C. The stack also includes C, JSON, CLI.

What license does jq use?

MIT license, free to use, modify, and distribute in personal or commercial projects with no restrictions.

How hard is jq to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is jq for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.