Skip to content
DevToolKit

JSON Flatten & Unflatten

Flatten nested JSON objects into dot notation or unflatten them back. Supports custom delimiters, array handling, and circular reference detection. 100% private.

Hierarchy Utility

JSON Matrix

Flattening Mode
Input Depth:0
Input Keys:0
Result Depth:0
Result Keys:0
100% Local

Transformation

Circular Ref Check
Usage Note

Flattening turns {a:{b:1}} into {"a.b":1}. Unflattening reverses this logic using the selected delimiter.

Input JSON
Transformed JSON
Was this tool helpful?

How to Use

The JSON Flatten & Unflatten tool is an essential utility for data engineers and developers who need to transform hierarchical data into a flat key-value structure.

How to use this tool

  1. Paste JSON: Enter your nested JSON object into the left-hand editor.
  2. Configure Transformation: Choose between Flatten (nested to flat) and Unflatten (flat to nested) modes.
  3. Select Delimiter: Choose the character used to separate keys (e.g., dot, underscore, or slash).
  4. Limit Depth: For complex objects, you can optionally set a maximum recursion depth for the flattening process.
  5. Safe Processing: Keep "Circular Ref Check" enabled to prevent errors when handling objects with self-references.
  6. Swap & Copy: Use the "Swap Mode" button to iteratively transform your data, and click copy to grab the result.

About This Tool

Simplifying Data Access

Flattening JSON is a common requirement when preparing data for CSV export, database ingestion (like Amazon Athena or BigQuery), or simplifying complex configuration files. By converting deep hierarchies into flat dot-notation keys, data becomes much easier to query and manipulate in traditional tabular environments.

Our tool also supports the reverse process—unflattening—which reconstructs the original nested object from its flat representation, provided the delimiters remain consistent.

Why Use This Tool

Privacy-First Data Engineering

Data structures often contain sensitive PII or proprietary configuration. Most online formatters upload your JSON to a server for processing. DevToolKit uses industrial-grade local processing—your data stays **entirely within your browser memory**, ensuring 100% privacy and security.

FAQ

What does it mean to flatten JSON?
Flattening JSON converts a multi-level nested object into a single-level flat object using dot notation to represent the hierarchy. For example, {"user": {"name": "Ana"}} becomes {"user.name": "Ana"}.
How are arrays handled when flattening?
Arrays are represented with numeric indices in the key: {"items": ["a", "b"]} becomes {"items.0": "a", "items.1": "b"}. You can configure whether arrays are flattened or kept as values.
What is unflatten?
Unflatten is the reverse operation: it converts a flat object with dot-notation keys back into its original nested structure.