Flatten YAML Files Online
Flatten nested JSON structures in YAML files into a flat table directly in your browser. Nested objects are expanded into prefixed columns — no upload required.
How to flatten YAML files
- Drop your JSON file onto the upload area. The tool finds every top-level key that holds a nested object and previews the first 200 rows.
- Read the list of nested columns. Each one is shown with the new column names it will produce, such as location → location_site, location_floor.
- Click Flatten. The preview switches to the flattened table.
- Click Download JSON to save the result, with _flat added to the file name. If the file has no nested objects, the tool says it is already flat and there is nothing to run.
Your file is processed locally in your browser and is never uploaded. The free limit is 50 MB per file; larger files work if your device has the memory for them.
Worked example
A facilities team pulls a device list from a sensor platform API. Each record looks like {"device_id": "th-01", "location": {"site": "Depot A", "floor": 2}, "battery": 87}, and the spreadsheet they report from needs one plain column per field.
Input (YAML)
- device_id: th-01
location:
site: Depot A
floor: 2
battery: 87
- device_id: th-02
location:
site: Depot A
floor: 1
battery: 64
- device_id: th-07
location:
site: Harbour St
battery: 12Settings
- No options. Every nested object column is expanded one level.
Result
| device_id | battery | location_site | location_floor |
|---|---|---|---|
| th-01 | 87 | Depot A | 2 |
| th-02 | 64 | Depot A | 1 |
| th-07 | 12 | Harbour St | NULL |
The location object is replaced by two columns named with an underscore: location_site and location_floor. Plain columns stay first and the expanded columns are added at the end, so battery moves ahead of the location fields. th-07 had no floor key in its location object, so location_floor is null.
Frequently Asked Questions
How many levels of nesting are flattened?
One level per run. Objects nested inside objects become struct columns that you can flatten by running the tool again on the output.
Does flattening change the column order?
Yes. Columns that were already flat come first, in their original order, and the expanded columns are added after them.
What if my file has no nested objects?
The tool reports that no nested structures were detected and that the file is already flat. There is no Flatten button in that case.
Related Tools
Manage Columns in CSV Files Online
Drop or select specific columns from CSV files directly in your browser. No upload required.
Rename Columns in CSV Files Online
Rename columns in CSV files instantly in your browser. No upload, no server — your data stays on your device.
Validate CSV Files Online
Validate CSV file structure in your browser. Check null counts, distinct values, and data types for every column — no upload required.
Flatten JSON Files Online
Flatten nested JSON structures in JSON files into a flat table directly in your browser. Nested objects are expanded into prefixed columns — no upload required.
YAML Viewer Online
View and inspect YAML files directly in your browser. Browse rows, check column names and data types — no upload required, your data stays on your device.
Convert YAML to Parquet Online
Convert YAML files to Parquet format directly in your browser. No upload required — your data never leaves your device.