Free online JSON flattener. One-click to flatten nested JSON into dot-separated key-value pairs, or restore flattened JSON back to nested structure. Supports custom separators (dot, underscore, slash, etc.) for data processing and API debugging.
TL;DR: Flatten nested JSON into key-value pairs or restore flattened JSON back to nested structure, with custom separator support for data processing and debugging.
For local tools, open DevTools → Network and search your input — it should not appear in requests.
Next steps
Usage Guide
Flatten/unflatten JSON with ., _, /, or - separators and [index] array keys — lossless and local.
1. Flatten or restore
Pick mode/separator; round-trip via mode toggle.
- Paste.
- Choose mode.
- Copy.
2. Pick a separator
Dot is common; keep the same separator on unflatten.
- Avoid collisions.
- Stay consistent.
- Round-trip samples.
3. Arrays
Indexes become path[0] keys; empty containers preserved when prefixed.
4. Good fits
Tabular exports, log fields, key-level compares.
5. Related
json-sorter, json-diff, jsonpath-query.
6. Limits
Document separator conventions before production exports.
FAQ
Collapsing a nested object tree into single-level keys joined by a separator, e.g. {"a":{"b":1}} → {"a.b": 1}. Arrays use bracket indexes such as items[0].name.
Dot (.), underscore (_), slash (/), and hyphen (-). Dot is the most common (user.name), but switch to another separator when a key itself contains dots. Flattening and restoring must use the same separator, or the paths get split at the wrong places.
Yes — conversion is bidirectional, and the mode toggle can feed the current output back into the input for round-trip checks. Number parsing is lossless, so large integers keep their precision; circular references are not supported.
Arrays expand into keys like path[0] and path[1]; empty arrays and objects are preserved as empty containers when prefixed, so no information is lost. After restoring, spot-check that arrays are still arrays rather than objects with numeric keys.
Run json-sorter first to normalize key order so text diffs stay stable; switch to json-diff when structural differences are large; use jsonpath-query for path-based field lookup. Flattening is great for turning API responses into table columns, key-level config comparison, and searchable log fields — but it only changes shape and does not replace schema validation.
No. Flattening and restoring run locally in the browser; the page fires no upload requests, and your JSON never passes through any relay.
Related Tools
Related Articles
JSON Integer Precision Trap: When Snowflake IDs Are Silently Rewritten
JSON numbers beyond 2^53-1 are rounded by JSON.parse. Compare naive formatters with a lossless path, and cross-link JWT, Base64, and this site’s JSON tools.
JSON Parse Error 'Unexpected token'? 5 Common Causes and How to Fix Them
Getting a JSON parse error 'Unexpected token'? This article covers the 5 most common causes of JSON format errors — trailing commas, single quotes, unescaped characters, BOM headers, and comments — with fixes and code examples for each.
Unexpected token '<' is not valid JSON — 5 Reasons Your API Returned HTML Instead
fetch throws SyntaxError: Unexpected token '<' when the response body is HTML, not JSON. Covers the 5 root causes: SPA history fallback returning index.html, auth 302 redirects, gateway 502 error pages, wrong baseURL, and missing res.ok checks — with curl diagnostics.