← All text tools

JSON Flattener and Unflattener

Flatten nested JSON into single-level keys such as a.b.c, or rebuild nested JSON from dotted keys, with a round trip check.

  • Free
  • No sign-up
  • Works on any device

About JSON Flattener and Unflattener

Spreadsheets, environment variables, form fields and translation files all want one flat list of keys, while APIs return deep trees. Flattening turns {"user":{"tags":["x"]}} into the single key user.tags[0], and unflattening rebuilds the tree from such paths. You choose the separator, so a dot, an underscore or a slash works, and whether array positions appear as [0] brackets or as plain .0 parts. A round trip check converts the result back and tells you whether it matches the original exactly.

How to use JSON Flattener and Unflattener

  1. Choose Flatten or Unflatten and paste the JSON.
  2. Set the separator and the array index style that your target system expects.
  3. Read the round trip message, then copy the converted JSON.

Why use this tool?

Also known as

Frequently asked questions

How are arrays written in flattened keys?

With bracket style an item becomes user.tags[1]. With dot style it becomes user.tags.1, and when you unflatten, a part made only of digits is turned back into an array position.

Why does the round trip check sometimes fail?

If a key already contains the separator, such as a key named a.b, flattening cannot tell it from nesting. Choose a separator that never occurs in your keys.

What happens to empty objects and empty arrays?

They are kept as values, for example address: {} stays in the flat result, so unflattening can restore the empty container instead of losing the key.

Is JSON Flattener and Unflattener free?

Yes. JSON Flattener and Unflattener on Toolipedia is free to use, with no sign-up and no watermark.

Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

Can I put JSON Flattener and Unflattener on my own website?

Yes. Use the Embed on your site button under the tool to copy a short piece of code and paste it into your page. It is free, needs no account, and the tool keeps working inside your page.

Related tools