JSON Flatten Converter

Flatten nested JSON into a flat key-value structure.

Category: Converters

When to use?

Use it to flatten nested JSON into dot-notation keys for logs, analytics events, or spreadsheet input.

How to use

  • Paste nested JSON.
  • Check the dot-notation key-value result.
  • Copy the result.

Input Explanation

Enter JSON with objects and arrays. Array indices are included in keys like 0, 1, 2.

Calculation Basis

It recursively traverses objects and arrays, mapping leaf values to dot-path keys.

Usage Examples

  • Tidy analytics data - Flatten nested structures for easier CSV or log analysis.
  • Prepare spreadsheet input - Turn nested JSON into flat key-value for a table.
  • Compare configs - Flatten nested settings to compare two JSONs key by key.

Examples

  • {"user":{"name":"Bling"}} → {"user.name":"Bling"}
  • Deeply nested {"a":{"b":{"c":1}}} → {"a.b.c":1}

Cautions

  • Malformed source data can cause parsing errors or broken output.
  • A mismatched encoding standard or complex nested data may break or drop the structure.

FAQ

How are arrays shown?

Array indices are included in the key path. E.g. roles.0

What is the flattened key format?

Dot notation joining nesting levels with periods. E.g. user.address.city

Can I restore the nested structure?

This tool focuses on flattening. To restore, reassemble by key path.

What about empty objects or arrays?

Empty objects/arrays have nothing to flatten and may be omitted from the result.

Related Tools