JSON Flatten / Unflatten

Turn nested objects into single keys like user.address.city, or rebuild the nesting from a flat object.

JSON Flatten / Unflatten

Data & Format Tools

Runs locally in your browser.

Runs locally in your browser — your JSON is processed on your device.

About the JSON Flatten / Unflatten

While modern web APIs embrace nested JSON objects to store complex hierarchical data structures, data engineers frequently face the challenge of having to analyze these structures. For example, when trying to extract meaningful information from such objects or when importing them into a SQL database or CSV file, flattened JSON may be significantly easier to work with. Having to write custom recursive code to join the keys of nested objects and arrays into a single-level dictionary for each new use case is not effective.

This JSON Flatten / Unflatten tool helps to quickly convert nested JSON objects into a single level (or the opposite) without writing any code. Using this tool, you can instantly turn complex trees of data into a simple list of key-value pairs using dot notation (or other separators) and vice versa. The work is done in your browser, so your data is not uploaded to our servers.

Key Features of JSON Flatten / Unflatten

  • Two-way processing No need to use different websites for flattening and unflattening. Switch modes with a click of a button using the “Mode” selector in the drop-down menu
  • Custom key separators Choose exactly how you want to concatenate keys in the converted JSON using the “Key separator” drop-down menu. For example, you can use the standard Dot notation
  • Test sample Not sure how exactly the tool will process your data? Just click the “Sample” button to quickly see how the tool handles nested arrays and objects
  • Local processingThe conversion runs in your browser, so the content is not uploaded to our servers.
  • Quick access to the results Just click the “Copy” button to quickly place the converted JSON in your clipboard or “Download” to save it to your computer.

How to Use JSON Flatten / Unflatten

  1. Copy your JSON data into the “JSON input” text field at the top of the page. (You can also click the “Sample” button to test how the tool works with sample nested JSON).
  2. Using the “Mode” menu, select the type of conversion you want: “Flatten (nested → flat)” or the opposite.
  3. Then, select the separator you want to use for the converted JSON keys from the “Key separator” menu.
  4. Click the purple “Convert” button to start the process.
  5. Once the conversion is complete, you will see the converted JSON below.
  6. You can then click the “Copy” button to copy this JSON to your clipboard or the “Download” button to save the converted JSON as a file to your computer.
  7. Click the “Clear” button to start over.

JSON Flatten / Unflatten Examples

Input
{"user":{"name":"Alice","address":{"city":"Paris"}}}
Result
{"user.name":"Alice","user.address.city":"Paris"}

JSON Flatten / Unflatten — Frequently Asked Questions

What does it mean to flatten JSON?
Flatten JSON means to remove its hierarchical nesting and convert it into a single-level structure. For example, nested JSON {“user” : {“address” : {“city” : “Paris”}}} will be converted to {“user.address.city”:”Paris”}. This way, JSON can be converted to CSV columns for easier spreadsheet analysis.
What does it mean to unflatten JSON?
On the contrary, unflattening means converting a single-level JSON structure back into a nested one. For example, {“database.port”:8080} will be converted to {“database”:{“port”:8080}}. This operation is necessary, for example, when sending JSON data to a server that expects a nested structure.
Is my personal data safe on this website?
This JSON utility prioritizes privacy and does not collect any personal information. All processing of your data occurs locally in your browser’s memory.