Flatten JSON Without jq or the Command Line — Visual Browser Alternative
- jq is powerful but has its own syntax — easy to misremember when you flatten JSON once a month.
- Browser tool does the same work visually, no filter string to get right, no install needed.
- Best for one-off work; stick with jq for scripted pipelines and CI jobs.
Table of Contents
jq is the default answer when you need to flatten JSON on the command line. It is fast, scriptable, and ubiquitous on Linux servers. The catch: jq has its own filter syntax, and the flatten incantation is easy to forget if you only need it once a month. For one-off work, our JSON Flattener gets the job done without a single filter string.
This post covers the common jq flatten patterns, when each is appropriate, and when to skip jq in favor of a browser tab.
The Common jq Flatten Patterns
The canonical recursive flatten in jq uses paths(scalars) combined with reduce:
jq 'reduce paths(scalars) as $p ({}; .[$p | join(".")] = (getpath($p)))' input.json
That does what our browser tool does with a click — walks the tree, joins each path with dots, writes each leaf to the output object. It is a mouthful to remember and easy to typo.
Simpler one-liner for collapsing JSON to a single line (minifying, not structural flattening):
jq -c . input.json
These two are easily confused. Minifying removes whitespace; structural flattening reshapes the object. See the difference between flattening and minifying.
For simple top-level flatten with explicit paths:
jq '{user_name: .user.name, user_city: .user.address.city}' input.json
Clear, but only practical when you know every field in advance.
When jq Is the Right Tool
Piping from another command. curl | jq 'reduce paths(scalars) ...' runs entirely in your terminal. Browser round-tripping is unnecessary.
Scripting. Shell scripts, CI jobs, Makefiles. Browser tools cannot run unattended.
Files on remote servers. SSH into a box, flatten a log file in place. No browser.
Batch processing. Looping over hundreds of files with a shell for loop. jq is built for this.
When the team already uses jq. If your devops playbook standardizes on jq, sticking with it avoids introducing a new tool.
Sell Custom Apparel — We Handle Printing & Free ShippingWhen the Browser Tool Is Faster
One-off debug. A webhook payload, an API sample, a curl output you captured to clipboard. Paste, click Flatten, read.
Forgot the jq syntax. If you are looking up paths(scalars) every time, your workflow has ~30 seconds of syntax-recall overhead per run. Skip it.
Developers who do not use jq. Windows developers often do not have jq installed. PowerShell has its own JSON cmdlets but syntax is different again. Browser works everywhere.
Sharing results with non-technical stakeholders. jq output lives in your terminal. Browser output can be copied into a doc or email in one move.
Trying to understand a payload shape before writing the jq filter. Flatten a sample in the browser first to see what paths exist, then write the jq filter for production.
Hybrid Workflow — Design in Browser, Run in Shell
The most productive pattern for CLI developers:
Step 1. Capture a representative sample into the browser. Flatten it to see every path.
Step 2. Identify which paths you actually need. Most real use cases want 5-10 specific fields, not every leaf.
Step 3. Write a targeted jq filter that extracts those fields. This is simpler than the full recursive flatten and easier to maintain.
For example, if the browser shows you need user.name, user.email, and order.total, your jq filter is:
jq '{name: .user.name, email: .user.email, total: .order.total}' input.json
This is cleaner than the full reduce paths(scalars) pattern and more maintainable. The browser tool is your design environment; jq is your production runtime.
What About gron, fx, and Other CLI Tools?
Beyond jq, there are other command-line JSON tools worth knowing:
gron — flattens JSON to "greppable" single-line statements. Each line is a full path assignment: json.user.name = "Alice";. Excellent for grep/sed workflows. Run gron input.json | grep 'email' to find every path containing email.
fx — interactive JSON viewer. Walks a nested tree with arrow keys. Good for exploration, not batch flattening.
jid — interactive jq builder. Type-as-you-go to build filters. Helpful when learning jq syntax.
For browser users, our JSON Flattener plus JSON Sorter cover what gron and jq do for typical flatten-and-find workflows.
Skip the jq Filter String
Paste your JSON, click Flatten, copy the result. No filter syntax to remember.
Open Free JSON FlattenerFrequently Asked Questions
Can I run jq in Windows PowerShell?
Yes — jq is available via Chocolatey, Scoop, or direct binary download. Once installed, syntax is the same as on Linux. Some PowerShell users prefer ConvertFrom-Json pipelines, which have different syntax but similar capabilities.
Is jq actually faster than the browser tool?
For a single payload, no — both finish in milliseconds. jq is faster when processing thousands of files in a script because there is no browser overhead. For single payloads, the bottleneck is typing the filter string, not execution.
What is the jq equivalent of dot-notation flatten?
jq does not have a one-flag flatten. The canonical recipe is: jq reduce paths(scalars) as $p ({}; .[$p | join(".")] = (getpath($p))) which walks every leaf path and joins with dots. Memorize or script it; the browser tool does the same thing with a click.
Does the browser tool work offline?
Once the page has loaded, yes — all processing is client-side JavaScript. You can disconnect from the internet and continue flattening. Useful for air-gapped dev machines where jq may not be installed.

