All Over Tools logo
Tool Combiner
Analyze Tools Clean Tools Compare Tools Convert Tools Data Validation Extract Tools Format Tools Generate Tools Organize Tools Transform Tools
Audio Tools Font Tools Image Tools Subtitle Tools Video Tools
Archive Tools Document Tools Ebook Tools File Management Tools PDF Tools Presentation Tools
Config Tools Database Tools Dataset Tools JSON Tools Parser Tools Spreadsheet Tools XML Tools
Business Calculators Construction Calculators Date And Time Calculators Education Calculators Financial Calculators Food Calculators Health Calculators Math Calculators Science Calculators Sports Calculators Statistics Calculators
Blog About Us Contact Us

Flatten JSON

Paste or upload nested JSON and flatten it into path-keyed output - dot notation, bracket notation, or a flat table - with control over arrays, nulls, empty containers, and a report of any key collisions.

Drop a JSON file here

or

JSON, TXT

JSON input

How to flatten JSON

Flatten JSON in three steps

  1. Paste valid JSON into JSON input, or use Drop a JSON file here and browse files.
  2. Choose Output notation. For dot notation, set Separator and Escape separator found inside keys. Then choose Array handling.
  3. Set Null values and Empty objects/arrays, check Key collisions and Warnings, then choose Copy or Export.

Dot notation, bracket notation, or a flat table

Output notation controls the path format. Dot notation joins path segments with Separator. Bracket notation writes array indexes such as [0] and quotes object keys when needed. Table writes one row for each flattened entry. For example:

{"user":{"name":"Alice","roles":["admin","editor"]}}

With Dot notation (a.b.0.c), the output is:

{
  "user.name": "Alice",
  "user.roles.0": "admin",
  "user.roles.1": "editor"
}

Expand into indexed keys creates paths such as user.roles.0. Keep arrays as values (no expansion) writes the whole array as one JSON-stringified value at its path. Escape separator found inside keys (dot notation only) puts a backslash before the selected separator inside an object key.

Table output shows the first 2,000 rows. Export includes every row, and Copy includes Path and Value without Type. When an uploaded file exceeds 300,000 characters, JSON input shows a shortened preview while the full file is processed.

How Flatten JSON handles nulls, empty containers, and collisions

Null values can stay as null, become an empty string, or be omitted. Empty objects and arrays can stay as {} and [], become the marker strings "{}" and "[]", or be omitted. A top-level string, number, or boolean is written under value.

A collision occurs when separate writes produce the same flattened key. The report lists the original paths, their values, and the value used in the output. The last value written remains. A branch deeper than 200 levels becomes a truncation placeholder and appears in Warnings. Invalid JSON stops processing until you correct it.

Where flattening JSON comes up

Flattened paths let you inspect nested fields as individual entries. An input path such as user.address.city becomes one visible key, while array items receive indexed paths when Array handling is set to Expand into indexed keys.

Table output places each path, value, and type in its own row. Export saves that view as flattened.csv. Dot notation and bracket notation save as flattened.json.

When to use JSON Transform Tools

Use JSON Transform Tools when you need to reshape JSON while keeping its JSON values. Choose Flatten JSON when nested paths need to become direct keys.

Frequently asked questions

How do I flatten nested JSON?

Paste valid JSON into JSON input, choose Output notation, and review the path-keyed output. The result updates after the input or a setting changes.

How do I flatten JSON arrays?

Arrays use indexed keys by default, so items.0.name and items.1.name become separate entries. Choose Keep arrays as values (no expansion) to store each array at its path as one JSON-stringified value.

What does a JSON key collision mean?

A collision happens when multiple writes produce the same generated flattened key. An object key containing the selected separator can collide with a nested path when escaping is disabled. The report lists the contributing original paths and the final value used. The last value written remains.

Can I flatten JSON into a table?

Choose Table (path / value / type rows) in Output notation. The table has Path, Value, and Type columns, and Export saves the rows as flattened.csv.

Does Flatten JSON upload my data?

Your pasted or uploaded JSON is parsed in the browser. This page's flattening script does not send it to a server. Invalid JSON is rejected before flattening.

Related Tools

47 views