Skip to content

Guide · Open source

How to use gron: search JSON with grep, step by step

Updated · written with AI from the project's own documentation and checked against our catalogue data

gron is an open-source command-line tool written in Go that turns JSON into a flat list of assignment-style lines, with each value on its own line and its full path shown. This guide explains what it does, when it helps, how to get the source, and how to search JSON with ordinary text tools. The README available for this page was truncated and empty, so usage details beyond the basics are not covered here.

grontomnomnom/gron · ★ 14.5k · MIT

Quick start

  1. 1Decide whether gron fits. Use gron when you need to search a large or deeply nested JSON response from a terminal. Skip it if you need a graphical viewer.
  2. 2Clone the repository. Run git clone https://github.com/tomnomnom/gron to copy the source to your machine.
  3. 3Read the project documentation. The README provided for this page was truncated and empty, so check the repository for build steps and usage details.
  4. 4Convert your JSON into gron lines. Use gron to flatten the JSON so each value appears on its own line with its full path.
  5. 5Search with grep. Pipe the flat output into grep to find the key or value you need. Each match shows where the value sits.
  6. 6Convert results back if needed. The analysis for this page says matched lines can be turned back into JSON. Confirm the exact method in the repository.

What does gron do to JSON?

gron converts JSON into a flat list of simple lines. Each line holds one value together with its full path from the top of the document, so you can see where every value sits even when the JSON is deeply nested.

Because each line is plain text, standard tools such as grep can search it. The project describes its purpose as making JSON greppable.

  • Each value sits on its own line.
  • Each line includes the full path to that value.
  • Plain text output works with grep, sed and similar tools.

Who should use gron?

gron fits developers who need to find a specific value in a large or deeply nested JSON response. It also suits people who already work in a terminal and use grep or sed, and anyone exploring an unfamiliar API response who wants to see its structure.

It is not a good fit if you need a graphical JSON viewer, because gron is a text-only command-line tool. For small JSON files, a text editor or browser may be enough.

  • Good fit: large or deeply nested JSON, terminal workflows, exploring unfamiliar API responses.
  • Poor fit: graphical viewing, very small JSON files.

Get the gron source code

The source lists git clone as the install command. Run it to copy the repository from GitHub to your machine. The source provided for this page does not list any prerequisites.

The project is licensed under MIT and written in Go. Check the repository itself for build or binary instructions, since the README provided here does not include them.

git clone https://github.com/tomnomnom/gron

Search JSON with grep after converting it to lines

The core workflow is to turn JSON into gron's flat lines and then search those lines with grep. Since every line carries its full path, a match tells you both the value and where it lives in the structure.

This pattern is most useful when you want to find one value in a response that is too large to scan by eye.

  • Convert the JSON into gron's line format.
  • Pipe or save the output and search it with grep for a key or value.
  • Read the matching line to see the full path to the value.

Turn results back into JSON

According to the analysis for this page, you can turn the result of a text search back into JSON after you have found what you need. The README provided here is empty, so this guide does not list the exact command or flag for that step. Check the project repository for the current options.

How gron compares with other JSON tools

Comparable projects include jq, fx and gojq. gron's distinguishing idea is its flat, grep-friendly output. Tools in the jq family work with JSON queries, while gron focuses on making the data searchable as plain text.

Pick the tool that matches how you already work. If you prefer text search, gron is a natural fit. If you want a query language, look at the others.

What people use it for

  • Finding one value in a large API response without scrolling through nested braces.
  • Searching logs or saved JSON responses with grep for a particular field.
  • Exploring an unfamiliar API response to understand its structure and paths.
  • Pulling a specific value out of JSON in a shell script that already uses text tools.

Frequently asked questions

Is gron free to use?

gron is released under the MIT licence, according to the project information for this page. Check the LICENSE file in the repository for the full terms.

What does gron require to run?

The source provided for this page lists no prerequisites. It is written in Go, so you will likely need the Go toolchain to build it, but the repository's own instructions should confirm the requirements.

How do I install gron?

The source lists git clone https://github.com/tomnomnom/gron as the install command. The provided README was truncated, so check the repository for build or binary instructions.

What is the difference between gron and jq?

jq is a JSON query tool with its own query language. gron instead flattens JSON into plain text lines with full paths, so you can search them with grep and other ordinary text tools.

Can gron replace a graphical JSON viewer?

No. gron is a text-only command-line tool, so it does not provide a graphical view. Use a browser or dedicated viewer if you want to browse JSON visually.

Which alternatives should I consider?

The comparable projects listed for this page are jq, fx and gojq. Each handles JSON differently, so choose based on whether you prefer text search or a query language.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

gron is a good choice for developers and terminal users who want to search large or deeply nested JSON with grep and see the path to each value. It is a poor choice if you need a graphical viewer or a full query language, and the README available for this page was too incomplete to confirm detailed usage, so check the repository before relying on it.

Install options & downloads