How to Use JSON Array Flattener: Steps and a Worked Example

By 1 min read

Flatten nested JSON arrays into a single array. This guide shows what to enter, a worked example, and the limits to keep in mind. The JSON Array Flattener tool is free, needs no account and runs in your browser.

What you need

  • Nested JSON array, for example [1, [2, [3]], 4]

Step by step

  1. Open the JSON Array Flattener tool.
  2. Fill in Nested JSON array.
  3. Read the result, which updates as soon as the inputs change.

Worked example

With these inputs:

  • Nested JSON array: [1, [2, [3]], 4]

the tool returns:

[
  1,
  2,
  3,
  4
]

How it works

Paste a nested JSON array. Every level is flattened into one list in order.

Things to keep in mind

Check your inputs, units and any local rules before you rely on the result.

If this is not quite what you need, try JSON Array to Lines, JSON Formatter or JSON Validator.

More from the blog