JSON, CSV, YAML, XML & TOML Converter

Convert data between JSON, CSV, YAML, XML and TOML in any direction. Turn JSON into CSV for Excel, CSV into JSON for an app, JSON into YAML for a config file or XML into JSON for an API, with the result updating as you type.

  • Runs in your browser. Nothing is uploaded
  • Free, no sign-up
  • Works offline once opened

Your files stay here

  • JSON, CSV, YAML, XML & TOML Converter runs inside this browser tab.
  • Nothing is sent to a server, so there is nothing to delete later.
  • Close the tab and it is gone from DeskTray.

Often used next

Guide

JSON for Beginners: Read, Format, Validate and Convert It Read the guide

How to convert JSON, CSV, YAML, XML or TOML

  1. Pick the format you have under “Convert from” and the one you want under “Convert to”.
  2. Paste your data or open a file. Opening a file picks its format from the extension.
  3. Adjust the options if needed: the CSV delimiter and header row, flattening of nested objects, or the indent.
  4. Copy the result or save it as a file. “Swap” turns the result into the input, to convert it back the other way.

Features

  • Any direction between JSON, CSV, YAML, XML and TOML
  • Live result as you type, with error messages that point to the line
  • Nested JSON becomes a.b columns in CSV, and a.b headers become nested JSON again
  • XML attributes kept as keys starting with @_
  • Opens files and saves the result with the right extension

Five formats, one converter

  • JSON: the format of web APIs and app data. Strict syntax, nested objects and lists.
  • CSV: rows and columns of plain text, the common ground between Excel, Google Sheets, databases and bank or GST exports.
  • YAML: indented, comment-friendly configuration used by Kubernetes, Docker Compose and GitHub Actions.
  • XML: tags and attributes, still common in RSS feeds, SOAP services, government data downloads and older business software.
  • TOML: simple key = value configuration, used by Cargo.toml in Rust, pyproject.toml in Python and Hugo sites.

Every conversion goes through the same data in between, so any format can become any other, not only the common pairs listed below.

Popular conversions

  • JSON to CSV: turn an API response or an export into a table you can open in Excel or Google Sheets.
  • CSV to JSON: import a spreadsheet into an app, a database seed file or an API request.
  • JSON to YAML and YAML to JSON: move settings between a JSON file and a Kubernetes, Docker or CI configuration.
  • XML to JSON and JSON to XML: work with feeds and SOAP responses in modern code, or produce XML for a system that requires it.
  • TOML to JSON and JSON to TOML: read or generate Cargo.toml, pyproject.toml and other TOML configs.

Old links such as “JSON to CSV” or “YAML to JSON” open this converter with that pair selected.

What changes between formats

  • CSV is flat. Nested objects become columns with dotted names such as address.city, and lists of simple values are joined with semicolons. Converting back with “Build nested objects from a.b headers” rebuilds the nesting.
  • CSV values are text. “Convert numbers and true/false” turns them into numbers and booleans; untick it to keep PIN codes, phone numbers and account numbers with their leading zeros.
  • XML attributes become keys starting with @_, and a JSON document with a single top-level key becomes the XML root element. Anything else is wrapped in a root element, with list items as item elements.
  • YAML comments are not carried over, because the other formats have nowhere to keep them.
  • TOML dates and times become ISO 8601 text, and a TOML file must be an object at the top level.

Tips for clean results

  • When conversion fails, the message gives the line of the problem. If the text looks like another format, the tool offers to convert from that one instead.
  • YAML needs spaces for indentation, never tabs.
  • CSV files from Excel in some regional settings use semicolons. Leave the delimiter on “Auto-detect” or pick it yourself.
  • Use “Swap” to convert the result back and check that nothing important was lost on the way.

Guides

Frequently asked questions

How are nested objects handled when converting JSON to CSV?

With “Flatten nested objects” on, {"address":{"city":"Pune"}} becomes a column named address.city. Arrays of simple values are joined with semicolons. Converting that CSV back to JSON with “Build nested objects from a.b headers” restores the nesting.

Can I paste directly from Excel?

Yes. Copied Excel cells are tab-separated, and with the delimiter on “Auto-detect” the tabs are recognised automatically.

What if my CSV has no header row?

Untick “First row is a header”. Each row then becomes an array of values instead of an object.

Why does my YAML fail to convert?

The usual causes are tabs (YAML requires spaces) and inconsistent indentation. The error message shows the line to fix.

How do I create XML attributes?

Prefix the key with @_, for example {"book": {"@_id": "b1", "title": "Godan"}} becomes <book id="b1"><title>Godan</title></book>.

Why does conversion to TOML fail for a JSON array?

A TOML document must be a table (an object) at the top level. Wrap your array in an object, for example {"items": [...]}.

Is my data sent to a server?

No. Everything runs in your browser, so API keys, tokens, configs and customer data never leave your machine.

Is YAML a superset of JSON?

Yes, YAML 1.2 can read JSON, but block-style YAML is easier to read and edit by hand, which is why configs use it.

Are XML attributes kept when converting XML to JSON?

Yes. They appear as keys starting with @_, alongside the element’s child values, and they become attributes again when you convert back to XML.

Will Excel open the CSV correctly?

Yes. Values with commas, quotes or line breaks are quoted properly. For a real .xlsx workbook, open the CSV in the CSV ⇄ Excel Converter.

More Developer tools

All 33 Developer Tools