Skip to content
← Back

JSON Flattener - Nested/Flat JSON Converter

Data
Runs locally · Not uploaded

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.

Was this result helpful?

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.

  1. Paste.
  2. Choose mode.
  3. 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