JSON to CSV, YAML & XML Converter
Convert JSON to and from CSV, YAML and XML in your browser. Runs in your browser.
About this json to csv, yaml & xml converter
This converter turns JSON into CSV, YAML or XML, and turns each of those back into JSON. It is for developers, analysts and anyone who has data in one format and a tool that only reads another.
Paste or open a file, pick a direction, and the result appears as you type. Nested objects become dot-path columns like address.city, so an API response lands in a spreadsheet with one column per field. Going the other way, those dot paths can be rebuilt into nested JSON. If your input has a syntax error, you get the line and column instead of a vague failure. Need to clean it up first? Format and validate the JSON and come back.
Everything runs in your browser. Exports from a CRM, a payment system or a user table often hold personal data, and none of it is sent anywhere.
Features
Six directions on one page
JSON to CSV, YAML and XML, and all three back to JSON. Swap sends the output back in as input and flips the direction, so you can check a round trip in one click.
Nested JSON flattened properly
Objects become dot-path columns. Arrays become numbered columns (tags.0, tags.1) or a single cell of JSON text. Rows with different keys are merged into one header, in the order the keys first appear.
CSV options that matter in practice
Comma, semicolon, tab or pipe delimiter. Header row on or off. Quote every field. An option to neutralize cells that start with =, +, - or @, so a spreadsheet does not run them as formulas.
Safe type detection for CSV to JSON
Numbers, true and false become real JSON values only when nothing is lost. 007 stays a string, and so does 9007199254740993, because JavaScript would round it.
Table preview
See the first 100 rows as a table before you download, with row and column counts. Empty cells are marked so gaps are easy to spot.
XML with attributes
Keys that start with @_ become attributes, #text becomes element text, and invalid element names such as "first name" are fixed and reported. XML input is validated first, with the line and column of any error.
How to use the json to csv, yaml & xml converter
- 1Pick a direction, such as JSON → CSV, then paste or open your file.
- 2Set the options: delimiter, header row, flattening, indent or XML names.
- 3Check the output and table preview, then copy, download or Swap to convert back.
When to use it
Opening an API response in Excel or Google Sheets
Convert the JSON array to CSV, check the table preview, and download. Use semicolons if your spreadsheet uses commas as the decimal mark.
Writing Kubernetes or Docker Compose config
Turn a JSON object into YAML with 2-space indentation, or read a YAML file as JSON to check exactly what a parser sees.
Talking to a legacy SOAP or XML service
Convert an XML response to JSON to inspect it, or build an XML body from JSON with the root and item names the service expects.
Importing a spreadsheet into an app
Export the sheet as CSV, convert to JSON with nesting rebuilt from column names like address.city, and paste it into a seed file or a test fixture.
Spotting differences between two exports
Convert both files the same way, then put them side by side in the text diff checker to see which rows changed.
How do you convert nested JSON to CSV?
CSV is flat: rows and columns, nothing inside anything. JSON is a tree. To make them meet, each path through the tree becomes one column name. A record like {"address": {"city": "London"}} becomes a column called address.city with the value London.
Arrays are the tricky part. With Columns, a tags array with two items fills tags.0 and tags.1, and a row with only one tag leaves tags.1 empty. With JSON text, the whole array sits in one cell as ["math","poetry"]. Columns suit filtering in a spreadsheet. JSON text keeps the column count down when arrays are long.
To go back, turn on Rebuild nesting from dot.paths. The converter splits each header on dots, and numeric parts become array positions. Empty cells under a numbered column are skipped, so a short array stays short instead of growing null items.
Why do numbers and leading zeros change in spreadsheets?
CSV has no types. RFC 4180 describes only fields, commas, quotes and line breaks, so every value is text until a program guesses otherwise. Spreadsheets guess aggressively. They drop the leading zero from a ZIP code like 02134 and show a 16-digit card or order number in scientific notation, rounded to 15 significant digits.
This tool writes exactly the text that was in your JSON, so the CSV file itself is correct. The guessing happens when the spreadsheet opens it. To keep codes intact, import the file with the column type set to Text instead of double-clicking it.
The same problem runs in reverse. When converting CSV to JSON with type detection on, this tool only turns a value into a number if printing that number gives back the exact same text. If a column of ZIP codes like 10001 should stay strings, turn type detection off.
Is YAML a superset of JSON?
Almost. Since YAML 1.2 (2009), nearly every JSON document is also valid YAML, which is why YAML to JSON and back usually round-trips. The differences show up in the other direction. YAML has comments, anchors and aliases (&base and *base), multiple documents in one file, and plain unquoted strings.
Unquoted strings cause the classic surprises. In the older YAML 1.1 rules, NO, yes, on and off are booleans, so a country code list could turn Norway into false. This converter reads YAML with the 1.2 core schema, where those stay text. When writing YAML, it quotes any string that would be misread, like 'true' or '10001'.
How are XML attributes shown in JSON?
JSON has no attributes, so a naming convention marks them. By default, an attribute id="bk101" becomes the key @_id, and text next to child elements goes into #text. You can change the prefix, or drop attributes when you only care about element content.
Repeated elements become arrays. Two <book> elements turn into "book": [ {...}, {...} ], while a single <book> stays an object. Code that reads the JSON should handle both shapes. When building XML from JSON, keys that are not valid XML 1.0 names are fixed: spaces become underscores and names that start with a digit get an underscore in front.
Why use Mavros
| Mavros | Typical upload sites | |
|---|---|---|
| Where your data goes | Stays in your browser | Uploaded to a server, sometimes saved behind a share link |
| Directions | JSON to and from CSV, YAML and XML on one page, with Swap | A separate page for each pair |
| Nested JSON to CSV | Dot-path columns, arrays as columns or JSON text | Often [object Object] or one JSON cell |
| CSV back to nested JSON | Rebuilds objects and arrays from dot paths | Flat objects only |
| Leading zeros and long IDs | Kept as strings unless the number is exact | Converted to numbers and rounded |
| Error location | Line and column for JSON, YAML and XML | "Invalid input" |
Tips
- Excel in Germany, France and many other countries expects semicolons, because the comma is the decimal separator there. Pick Semicolon if your columns all land in column A.
- If an API wraps its rows, like {"data": [...], "meta": {...}}, the converter finds the array for you and tells you which key it used.
- Turn on formula protection before you send a CSV built from user input to someone who will open it in a spreadsheet.
- Need realistic rows to test an import? Make them with the fake data generator, then convert them here.
- To rename a column or fix a value across the whole file, run the output through find and replace before downloading.
Questions
How do I convert JSON to CSV?
Choose JSON → CSV, paste your JSON or open the file, and download the result. Nested objects become dot-path columns automatically, and the table preview shows what the spreadsheet will look like.
Can it convert CSV back to nested JSON?
Yes. With CSV → JSON and Rebuild nesting turned on, headers like address.city become nested objects and tags.0, tags.1 become arrays. Turn it off to keep flat keys.
Why does my CSV open in one column in Excel?
Your Excel expects a different delimiter. Many European locales use a semicolon because the comma is their decimal mark. Choose Semicolon and download again.
Does it handle JSON Lines (NDJSON)?
Yes. If the input is not one JSON value but every line is, it is read as JSON Lines with one record per line. A note tells you when that happened.
Why did YAML quote some of my strings?
Those strings would be read as something else without quotes. Values like 'true', '10001' or '1.0' would turn into a boolean or number, so the converter quotes them to keep them as text.
What happens to XML attributes?
They become keys with a prefix, @_ by default, so id="x" turns into "@_id": "x". Element text that sits next to attributes goes into #text. You can change the prefix or drop attributes.
Will big numbers lose precision?
They can when JSON is the input, because JavaScript stores numbers as 64-bit floats. Integers above 9,007,199,254,740,991 trigger a warning. Store such IDs as strings in the source JSON to be safe.
Is my data uploaded?
No. Parsing and conversion run in your browser with no server involved. Nothing is stored or shared, and the page keeps working offline once loaded.
Is there a size limit?
There is no fixed limit, only your device's memory. Files of a few megabytes are fine on a typical laptop. Very long outputs are previewed in part, but Copy and Download always give the full result.