Skip to main content

gron Converter — JSON to gron and ungron

Make JSON greppable. json.users[0].name = "Ada"; one leaf per line, and ungron right back. Runs in your browser.

  • Runs locally
  • Category Developer & DevOps
  • Best for Formatting, validating, shrinking, or inspecting code-adjacent text.
Turn JSON into greppable gron lines (json.users[0].name = "Ada";), or ungron them back to JSON. Every leaf is one line, so you can pipe it through grep to find deep values. Strings keep quotes; numbers, booleans and null stay bare.
Direction
Root name
Input

Converted

Output
json = {};
json.users = [];
json.users[0] = {};
json.users[0].name = "Ada";
json.users[0].admin = true;
json.count = 1;
json.next = null;

What this tool does

Convert JSON into gron and back, entirely in your browser. gron, the format from Tom Hudson's tomnomnom/gron tool, rewrites a JSON document as one assignment statement per line, like json.users[0].name = "Ada"; — an absolute path on the left, a JSON literal on the right. Because every deep value sits on its own line with its full path, you can pipe the output straight into grep to find where a value lives: gron data.json | grep name. Object keys join with dots, array elements use [index], and keys that are not plain identifiers are bracket-quoted as json["weird key"]. Strings keep their quotes, while numbers, booleans and null stay bare so the lines read like real assignments. The ungron direction reads those statements back and rebuilds the original JSON exactly, so the round trip is lossless. Pick the root variable name, paste, and copy. Nothing is uploaded; the JSON and the gron output never leave the page.

Tool details

Input
Files + Text + Numbers
The page exposes text boxes, numeric controls, file pickers, or structured inputs depending on the tool.
Output
Live result + Copy
The result area focuses on usable output, with copy, download, or preview actions when supported.
Privacy
Browser-side processing
The main tool logic does not call an external API, so inputs normally stay in the current tab.
Save / share
Shareable URL state
Key settings are encoded in the URL so another person can reopen the same setup.
Performance budget
Initial JS <= 9 KB
No WASM budget is declared, keeping the tool quick to open on mobile.
Best fit
Developer & DevOps · Developer
Category and role tags drive related tools, internal links, and quick fit checks.

How to use

  1. 1. Input

    Paste or drop your content into the tool panel.

  2. 2. Process

    Click the button. All processing is local in your browser.

  3. 3. Copy / Download

    Copy the result or download to disk in one click.

How gron Converter (JSON to gron / ungron) fits into your work

Use it in the small gaps between coding, reviewing, debugging, and shipping.

Developer jobs

  • Formatting, validating, shrinking, or inspecting code-adjacent text.
  • Preparing snippets for documentation, tickets, commits, or handoff.
  • Checking a small payload quickly without switching tools.

Developer checks

  • Run irreversible transforms like minify or obfuscate on a copy.
  • Keep secrets out of pasted snippets unless the tool explicitly stays local.
  • Use your normal tests or linter before shipping transformed code.

Good next steps

These links move the current task into a more complete workflow.

  1. 1 JSON Diff Structural JSON compare — added / removed / changed keys by path, three-colour tree, browser-only Open
  2. 2 JSON Lines Formatter Validate JSONL line by line, pretty-print it, convert to a JSON array, or export a CSV-like table locally. Open
  3. 3 JSON Flatten / Unflatten Flatten nested JSON to dot-notation keys and unflatten it back — choose the delimiter and array style, types preserved, browser-only. Open

Real-world use cases

  • Grep a deep value out of a giant API response

    A 4000-line JSON payload comes back from an API and you need the auth token buried somewhere inside. Paste it, switch to JSON to gron, copy the lines, and run grep -i token over them. Instead of scrolling through nested braces you get json.data.session.refresh_token = "eyJ…"; on one line with its full path. Same trick finds every URL, every id, every email — grep the word, read the path, done.

  • Diff two JSON files line by line

    Structured JSON diffs are noisy because formatting and key order move things around. Run both files through gron and the output is a flat, stable list of path = value lines, so an ordinary line diff (or git diff) shows exactly which leaves changed and where. A reordered object no longer looks like a hundred-line change; only the genuinely different assignments stand out.

  • Edit a buried value with sed, then rebuild

    You need to bump json.config.replicas from 2 to 5 in a config you would rather not hand-edit through three levels of nesting. gron the file, change the one line (by hand or with sed), then ungron it back into valid, pretty-printed JSON. The path syntax makes the edit unambiguous and the round trip guarantees the structure is rebuilt correctly.

  • Teach or document a JSON shape

    When you explain an API response in a doc or a code review, a wall of braces hides the structure. gron lines spell out every path explicitly, so a reader sees json.items[0].price = 9.99; and immediately knows the shape, the types and where each field lives — no mental parsing of indentation required.

Common pitfalls

  • Expecting gron output to be valid JSON. It is not — it is a list of assignment statements (json.a = 1;). To get JSON back, switch the direction to ungron, which parses those statements and rebuilds the object. Do not feed gron lines into a JSON parser directly.

  • Hand-editing a gron line into a syntactically broken value. The right side of each line must be a JSON literal, so a string needs its quotes (= "5";) while a bare number is = 5;. Writing = 5 abc; or dropping the quotes on a string makes that line fail to ungron with a value error.

  • Renaming the root variable on one side only. If you gron with a custom root like data and then try to ungron text that still says json, both work independently, but mixing lines with different roots in one paste rebuilds them onto separate roots. Keep the root consistent across a single document.

Privacy

Both directions — JSON to gron and ungron back to JSON — are plain JavaScript that runs inside your browser tab. The JSON you paste, the gron lines and the rebuilt output never leave the page and are not logged. The one caveat: the shareable URL encodes your input in the query string, so a link pasted into chat records that input in the recipient server's access log. For anything sensitive — tokens, private payloads — use the copy button and paste the text rather than sharing the URL.

FAQ

Tool combos

Folks in your role tend to reach for these alongside this tool.

Made by Toolora · 100% client-side · Updated 2026-05-29