JSON Flattener to Dot Notation

Nested JSON is great for APIs, terrible for spreadsheets. Flatten it into user.address.city style keys — ready for CSV, logs and quick analysis.

Embed this tool on your website / blog No code required · Copy and paste
HTML Embed Code (iframe):
<iframe src="https://lucentool.com/json-flattener" width="100%" height="650" style="border:1px solid #e5e0d8;border-radius:12px;max-width:850px;width:100%;" frameborder="0"></iframe>
<div style="font-size:12px;color:#78716c;margin-top:6px;font-family:sans-serif;">Powered by <a href="https://lucentool.com/json-flattener" target="_blank" style="color:#c85a32;text-decoration:none;">Lucentool - JSON Flattener to Dot Notation</a></div>

Why flatten JSON?

Databases and log systems often store nested JSON, but analysis tools (spreadsheets, BI, pandas json_normalize) want flat rows. Flattening converts {"user":{"address":{"city":"Shanghai"}}} into user.address.city = "Shanghai" — one line per leaf value.

What the tool does

Use cases

Everything runs locally — your JSON never leaves the tab.

Where it breaks down

flatten() walks the structure and joins keys with dots while array indices go into brackets, producing a single-level map where every leaf is reachable by one path. The purpose is downstream: a flattened object drops straight into a spreadsheet column set, a key-value store or a log line, whereas the nested original needs bespoke traversal code.

Formats, sizes and other limits

Flattening is lossy — there is no unflatten here, and the original hierarchy cannot be reconstructed without extra rules. Keys that already contain a dot or a bracket become ambiguous with the path syntax. Arrays are expanded by index, so sparse arrays produce gaps. Circular references recurse until the stack runs out. Numeric precision follows JavaScript's double representation.

Privacy: no data leaves this tab

The structure is walked in memory and printed back into the page. No key path is logged, transmitted or stored between visits.

Frequently asked questions

Can I reverse it?

Not with this tool. Round-tripping needs the original shape or an escaping convention; flattening alone discards both.

What if a key contains a dot?

It becomes indistinguishable from a path separator. Rename those keys first, or accept the ambiguity knowingly.

How are arrays handled?

Indices become bracketed path segments. A sparse array keeps its gaps, which is usually what you want for debugging.