Skip to content
Tezmy Tools

Data Format Converter

Convert between JSON, YAML, XML, CSV and TSV

Runs in your browser. Nothing is uploaded.

About the Data Format Converter

Data Format Converter changes data from one text format to another: JSON, YAML, XML, CSV or TSV, in any direction. Choose the format you have and the one you need, paste your data and the result appears as you type. Behind the scenes everything passes through JSON as the middle step, so anything JSON cannot hold is changed or lost on the way. That includes YAML comments, XML comments and mixed XML content. Tables such as CSV and TSV are flat, so nested data is flattened with dots and lists become JSON text. Conversion happens in your browser and nothing is uploaded.

Updated September 2026

How to use the Data Format Converter

  1. 1Choose the From format and the To format.
  2. 2Paste your data, or press Try a sample.
  3. 3Adjust the options that appear, such as the header row, indent or XML element names.
  4. 4Copy the result, or download it as converted.json, .yaml, .xml, .csv or .tsv.

Converting between five formats

Each format suits a different job. JSON is the language of web APIs, YAML is popular for configuration files, XML is common in older systems and feeds, and CSV and TSV are what spreadsheets export. People often need to move data from one to another: a config from YAML to JSON for a script, an API response to CSV for a spreadsheet, or a spreadsheet to XML for an import.

Pick the two formats and paste your data. If the input is not valid, an error appears under the output. When the parser reports it, the message includes the line and column so you can find the problem.

How nested data becomes a CSV

A CSV file is a flat grid: one row per record and one column per field. Nested data has to be squeezed into that shape. The tool joins the path of keys with dots, so an address with a city inside it becomes a column called address.city. A list inside a record does not fit a single cell, so it is written as JSON text such as [1,2]. Missing values are left empty.

For the reverse direction, the first row of a CSV is used as the header by default. Turn that off if your file has no header, and the columns are named column 1, column 2 and so on. Repeated or empty headers are renamed so no data is overwritten.

XML attributes and repeated elements

  • Attributes become keys that start with @_.
  • Repeated elements with the same name become a list.
  • Text mixed with child elements is stored under #text.
  • When writing XML, a top-level object with one key is used as the root element. Otherwise the data is wrapped in the root name you choose.
  • A list is written as repeated item elements, and a CSV becomes a rows element that holds one element per row.
  • Characters such as & and < are escaped, and names with spaces are made safe, for example first name becomes first_name.

What is lost in translation

Because JSON is the middle step, features it lacks do not survive. YAML comments and anchors disappear, XML comments and processing instructions are dropped, and the order of XML attributes is not guaranteed. CSV and TSV carry only text, so types are guessed from what the text looks like.

Check the result before you rely on it, especially for large or unusual files. If you only need to tidy one format, JSON Formatter and XML Formatter keep the original format and just re-indent it. Use CSV to JSON Converter when the data is a plain table, and the Base64 Encoder & Decoder if it arrives encoded.

Features

  • Five formats, any direction
  • Error messages with line and column when the parser gives them
  • Optional number and true/false detection for CSV, TSV and XML
  • Nested data flattened into dotted CSV columns
  • Choose XML root and row element names
  • Swap button to convert the result back

Frequently asked questions

How do I convert JSON to YAML?

Leave From on JSON and To on YAML, then paste your JSON. Objects become key: value lines and arrays become dashed lists, indented by two spaces. Copy the result or download converted.yaml.

How do I convert XML to JSON?

Choose XML in From and JSON in To. Elements become keys, repeated elements become arrays, and empty elements become empty strings. The XML declaration at the top is dropped. Numbers are kept as text unless you leave “Convert numbers and true/false” on.

What happens to XML attributes?

Attributes appear as keys that begin with @_, so id="1" becomes "@_id": "1". When you convert JSON to XML, keys starting with @_ are written back as attributes, which lets a round trip keep them.

How do I convert nested JSON to CSV?

Give the converter a list of objects. Nested objects are flattened using dots, so {"a":{"b":1}} gives a column named a.b, and lists inside a record are written as JSON text in one cell. The columns are the combined keys from all records, in the order they first appear.

Are numbers kept as numbers?

For JSON and YAML, yes. CSV, TSV and XML hold only text, so the tool guesses: 42, -3.5 and 1e3 become numbers, and true or false become booleans. It leaves text alone when converting would change the digits, such as 007 or 0.10.

Is my data uploaded?

No. The parsers run in the page on your own device. Nothing you paste leaves the browser, so it suits configuration files and exports you would rather keep private.

How is this different from CSV to JSON?

CSV to JSON converts only between those two formats. This page adds YAML, XML and TSV and converts between any two of the five.

Related tools