Welcome to learnjq
Select a lesson from the sidebar to begin.
Learn to slice, filter, and transform JSON data โ in 5 minutes.
jq is a lightweight command-line tool for processing JSON. Think of it as grep + sed + awk โ but for structured data.
If you've ever stared at a wall of JSON from an API and thought "I just want the names" โ jq is your answer.
$ curl -s api.github.com/users/Mickhat | jq '{login, repos: .public_repos}' { "login": "Mickhat", "repos": 22 }
brew install jq
sudo apt install jq
sudo pacman -S jq
scoop install jq
Or skip installation entirely โ the playground on this site runs jq server-side. Just start typing!
All examples below are interactive. Edit the filter and watch the output change in real-time.
.A dot (.) means "the whole input". It passes data through unchanged โ like cat for JSON.
.nameDot + field name extracts a single value. Try .age or .city.
.[]Square brackets after a dot unpack every element from an array.
.users[] | .nameThe pipe | chains filters โ output of the left becomes input of the right. Just like shell pipes.
select(.age > 25)select() keeps only elements that match a condition. Combine it with pipes for powerful queries.
Select a lesson from the sidebar to begin.
Type a jq filter and press Enter to see results...
๐ฌ Pipe Visualizer
Enter a jq filter with pipes (|) and click Visualize to see the data transformation step by step.
Try these:
๐ก Filter Explainer
Type any jq expression above and each part will be annotated with an explanation.
Like explainshell.com โ but for jq.
Try these: