JSON Flatten

FreePrivateConfigurable separator

Turn nested objects into a single level of dot-path keys, or reverse the operation.

Nested JSON
Output
Ctrl+Enter Run

JSON Flatten & Unflatten Online

Nested JSON is great for APIs; flat key–value maps are easier for spreadsheets, some databases, and analytics schemas. Switch between Flatten and Unflatten, pick a separator, and transform documents entirely in your browser.

Where Is This Useful?

CSV prep
Align nested API payloads with flat column names before JSON → CSV.
Events & warehouses
Many warehouses prefer dot-path or underscore keys for semi-structured properties. After flattening, export grids through JSON → CSV for analysts who live in spreadsheets.
Round-trip
Flatten for editing, then unflatten with the same separator to restore hierarchy. Validate both shapes with JSON Formatter or compare before/after using JSON Diff.

How to Use

  1. Choose Flatten or Unflatten and pick a separator
  2. Paste JSON (nested object for flatten; flat object for unflatten)
  3. Run the action, then copy or download from the output panel

Example (flatten)

Nested
{
  "user": {
    "name": "Alice",
    "id": 42
  }
}
Flat (dot)
{
  "user.name": "Alice",
  "user.id": 42
}

Features

  • Toggle flatten / unflatten without leaving the page
  • Separator: dot, underscore, or slash
  • Pretty JSON output with highlight on the result panel
  • Keyboard shortcut Ctrl+Enter to run
  • Private; no upload

Frequently Asked Questions

What separators are supported?

Dot, underscore, or slash. pick the delimiter that matches your CSV column naming or analytics warehouse convention.

Are arrays flattened?

This tool focuses on nested plain objects. Complex array nesting may need a dedicated transform for your use case.

Is data uploaded?

No. Flattening runs in your browser.

Related Tools