Back to Free Tools

FREE TOOLS

JSON Array Depth Flattener

Flatten nested JSON array elements to an explicit finite depth while leaving objects and arrays inside objects untouched.

UTF-8 JSON array file, Pasted strict JSON array

Flattened JSON array

Browser only

Runs locally in your browser. Your files, pasted content and generated output are not uploaded. Reset clears this tool’s working data.

This tool needs JavaScript. If it does not load, refresh the page and try again.

How to use this tool

  • Paste a root JSON array or choose a JSON file.
  • Enter a whole-number Flatten depth from 0 through 40.
  • Select Flatten nested arrays and download flat-array.json.

Examples

At depth 1, [1,[2,[3]],{"x":[4]}] becomes [1,2,[3],{"x":[4]}].

Limitations

  • 5 MiB input, input depth 40, 200,000 parsed nodes including the root, depth 0 through 40, at most 199,999 reachable output entries, 10,000 UTF-16 units per numeric token, 20 MiB output and 30 seconds.
  • Expanded empty arrays contribute no entries. Depth zero still uses strict JSON admission and does not preserve source formatting or escape spelling.
  • No object flattening, paths, sparse JavaScript arrays, undefined values or mutation inside objects.

Related tools

No items found.

More tools for your workflow

Explore the related desktop tool