Format:
Indent:
JSON Input 0 B
Ready
0 chars
Flattened Output 0 B
Flat dot-notation pairs will appear here...
0 chars
Features

Why use this flattener

Dot-notation paths

Each value gets a path like user.address.city or roles[0]. Easy to read, easy to grep, easy to import into any flat format.

Multiple output formats

Choose JSON (default), CSV (path,value pairs), or env vars (PATH=value, suitable for .env files). Switch on the fly.

Handles arrays

Arrays use bracket notation: items[0], items[1]. Nested arrays work too: matrix[0][1].

How it works

Conversion explained

1. Parse JSON

Input is parsed into a JavaScript value. The structure is walked recursively.

2. Walk and emit

For each leaf value (string, number, boolean, null), the path from the root is recorded as a dot-notation string. Arrays use bracket notation.

3. Format output

The flat list is serialized as JSON, CSV, or env vars, depending on your selection. Copy or download with one click.

FAQ

JSON Flattener — frequently asked questions

What happens to nested objects?

Nested objects are flattened into multiple key-value pairs. {"a":{"b":{"c":1}}} becomes {"a.b.c":1}. The original nesting is recoverable from the dot paths.

How are arrays handled?

Arrays use bracket notation: items[0], items[1]. Arrays of objects become items[0].field, items[1].field, etc. Multi-dimensional arrays use chained brackets: matrix[0][1].

What's the env var format?

Each path is uppercased and converted to a valid env var name (special chars become underscores). The value is JSON-encoded. For example, user.name becomes USER_NAME="Ada".

Is this reversible?

Not directly — flattening loses some structural information (especially when arrays of mixed types are involved). For round-trip fidelity, keep the original JSON. The flattener is for inspection and export, not transformation.