JSON Flatten & Unflatten
Flatten nested JSON objects and arrays into dot-separated keys or rebuild nested JSON structures.
Related data tools
All Data toolsAbout JSON Flatten & Unflatten
Flatten deeply nested JSON objects and arrays into single-level key/value maps using dot, slash, underscore, or colon delimiters—and unflatten flat maps back into nested JSON.
How to use JSON Flatten & Unflatten
- 1
Choose Flatten JSON or Unflatten JSON and pick your preferred key delimiter (such as . or /).
- 2
Toggle whether arrays should be flattened by numeric index or kept intact.
- 3
Copy or download the transformed JSON, or click Swap to round-trip the output.
Frequently asked questions
How does Unflatten know when to recreate an array versus an object?
When path segments are non-negative integers (like roles.0 and roles.1), Unflatten automatically reconstructs a JavaScript array at that branch.
When is flattening JSON useful?
Flattened key-value JSON is handy for i18n translation files, environment variable mapping, spreadsheet exports, and comparing deeply nested configs.
Does this tool guard against prototype pollution keys?
Yes. Keys containing __proto__, constructor, or prototype are safely skipped during unflattening.
