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
- 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).
- Using the “Mode” menu, select the type of conversion you want: “Flatten (nested → flat)” or the opposite.
- Then, select the separator you want to use for the converted JSON keys from the “Key separator” menu.
- Click the purple “Convert” button to start the process.
- Once the conversion is complete, you will see the converted JSON below.
- 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.
- Click the “Clear” button to start over.
JSON Flatten / Unflatten Examples
{"user":{"name":"Alice","address":{"city":"Paris"}}}{"user.name":"Alice","user.address.city":"Paris"}