Saved

Press the star next to a tool's name to save it.

All my tools

Data Format Converter (JSON, YAML, XML, CSV and More)

Use this data format converter to turn JSON, YAML, XML, CSV, TSV, TOML, INI, properties, SQL, HTML or Markdown tables, Excel and plain text into any other of those formats, in your browser.

Restored your last values ·

Choose the format you have and the one you want, paste your data or open a file, then press Convert. Lists of records become tables; nested data stays nested where the output format allows it.

Your data is converted in your browser. Nothing is uploaded.

Converted data

Paste your data or open a file, choose the two formats and press Convert.

Recent results

This data format converter turns structured data from one format into another in one step: JSON, YAML, XML, CSV, TSV, TOML, INI, Java properties, SQL INSERT statements, HTML tables, Markdown tables, Excel files and plain text, in any direction. Choose the format you have, choose the format you need, paste the data or open a file, and press Convert. You can copy the result or download it as a file. Everything runs in your browser, so configuration files, exports and spreadsheets stay on your device.

Developers, analysts and support teams meet the same problem every day: one system exports XML, the next one wants CSV; a config sample is in YAML but the app reads TOML; a database dump has INSERT statements and someone needs a spreadsheet. Instead of a separate page for every pair, this one tool reads all thirteen formats and writes all thirteen.

How to use the data format converter

  1. Pick the format of your data in “Convert from”.
  2. Pick the format you want in “Convert to”.
  3. Paste the data in the box, or open a file: the converter guesses the format from the file name. For Excel, open the .xlsx file and its first sheet is read for you.
  4. For SQL output, type the table name you want in the INSERT statements.
  5. Press Convert, then copy the result or download it. Use Swap formats to turn the result back the other way.

How each format is read

FormatWhat the converter readsShape of the data
JSON, YAMLAny valid documentAny nesting
XMLElements, attributes (as @name) and textNested; repeated tags become lists
CSV, TSVHeader row plus data rowsA list of records
TOML, INITables or [sections] with key = value linesNamed values, nested by section
Java propertieskey=value, key: value, comments and \ line breaksFlat named values
SQLINSERT INTO … (columns) VALUES (…) statementsA list of records
HTML, MarkdownThe first table on the pageA list of records
ExcelThe first sheet, first row as headingsA list of records
Plain textOne item per non-empty lineA list of values

Numbers and true or false values in CSV, TSV, INI, HTML and Markdown are read as numbers and booleans, so they come out unquoted in JSON or YAML. Values with leading zeros, such as a ZIP code like 01234, stay as text so no digits are lost.

Notes on the formats

CSV and TSV. In CSV, a field that holds a comma, a double quote or a line break is wrapped in double quotes, and a double quote inside such a field is written twice [1]. The converter follows those rules when it reads and when it writes, and TSV uses a tab instead of a comma.

YAML. YAML 1.2 was designed as a strict superset of JSON [2], so any JSON document is also valid YAML. Converting JSON to YAML mostly removes brackets and quotes; converting YAML to JSON makes every structure explicit.

TOML. TOML is designed to map unambiguously to a hash table [3], which means the top level must be a set of named values. When you convert a plain list of records to TOML, INI or properties, each record becomes its own section named row1, row2 and so on. TOML has no null value, so empty values are left out.

XML. A well-formed XML document has exactly one root element [4]. When the converter writes XML it uses the single top-level name of your data as the root, or wraps the data in a root element, and a list becomes repeated item elements. When it reads XML and you want a table, it walks down to the first list of repeated elements and makes each one a row.

Worked example: XML to CSV

Paste this XML and convert it to CSV:

Input (XML)Output (CSV)
<people><person><name>Ana</name><age>34</age></person><person><name>Ben</name><age>29</age></person></people>name,age
Ana,34
Ben,29

The converter reads the people element, finds the two repeated person elements, and writes one CSV row for each with the child tags as columns. Choose Swap formats and convert again to get the XML back as a list of person records.

Tables and nested data

Table formats (CSV, TSV, SQL, HTML, Markdown and Excel) can only hold rows and columns. When nested data goes into a table, nested objects become dotted column names, so an address with a city becomes a column called address.city. Lists inside a record are written as text in one cell. Going the other way, a table becomes a list of records with one key per column.

Tips

  • If you get a read error, check “Convert from”: a YAML file pasted as JSON fails at the first unquoted word.
  • For SQL output, pick a table name with letters, numbers and underscores only.
  • Excel output is a real .xlsx workbook with one sheet; open it in Excel, LibreOffice or Google Sheets.
  • Very large files work, but up to 5 million characters at a time keeps the page responsive.

Common mistakes

  • Expecting comments from YAML, TOML or INI to survive: data formats carry the values, not the comments.
  • Converting a list to TOML or INI and expecting the same shape back: the rows become named sections.
  • Pasting a whole web page as HTML: only the first table is read.
  • Forgetting that CSV needs a header row for the column names.

What next

Use this often? Add Data Format to your Home screen.

Frequently asked questions

Which formats does the data format converter support?

JSON, YAML, XML, CSV, TSV, TOML, INI, Java properties, SQL INSERT statements, HTML tables, Markdown tables, Excel .xlsx files and plain text, in any direction.

Is my data uploaded?

No. The conversion runs in your browser and nothing is sent to a server.

What happens to nested data in CSV or Excel?

Nested objects become dotted column names such as address.city, and lists inside a record are written as text in one cell.

Why does my list become row1, row2 in TOML?

TOML, INI and properties need named values at the top level, so each record of a list becomes its own section.

Can I convert an Excel file to JSON?

Yes. Open the .xlsx file, choose JSON as the output and press Convert. The first sheet is read with the first row as headings.

What went wrong?

We only receive the reason you pick, never what you typed into the tool.

Thanks for your feedback.

More Developer Tools