CSV Converter: CSV to JSON, TSV, XML and YAML
Turn CSV into JSON, TSV, XML or YAML, or turn JSON and TSV back into CSV. Free, quote-aware, and it runs entirely in your browser.
Detected delimiter: comma
More options
What is a CSV converter?
A CSV converter takes a table saved as plain text and rewrites it in another format. CSV stands for comma separated values. Each line is one row, and a separator between the values splits the row into columns. Spreadsheets like Excel and Google Sheets can save almost any sheet this way, which makes CSV the usual way to move a table from one program to another.
Other programs often want something else. A web developer may need JSON for an app or an API test. A config file may expect YAML. An older system may only import XML. Some tools read tab separated text (TSV) because tabs rarely show up inside real data. This converter handles all of these. You paste CSV, TSV or JSON, choose what you want back, and the Result box fills in straight away.
Real CSV files are messier than they look, and the converter is built for that. A value that contains a comma, a double quote or a line break is wrapped in double quotes, and a quote inside such a value is written twice. So "Smith, John" stays one cell, and "He said ""hi""" reads as He said “hi”. The tool follows these rules when it reads and when it writes.
The separator is not always a comma either. In Vietnam and much of Europe the comma is the decimal mark, so Excel often saves CSV with a semicolon between columns, like Name;Price and Lan;12,5. Leave the delimiter on detect and the converter checks the first lines, picks the separator that gives the most even column count, and tells you which one it found.
When you convert to JSON, the header row gives the key names, so a sheet with Name and City columns turns into a list of objects with those two keys. Numbers and true or false can become real JSON values if you want. A whole number written with extra zeros in front, such as 007 or 02134, always stays text so the zeros are never lost. Everything runs in your browser. Your data is not sent anywhere.
How to use the CSV converter
- Paste your table into Your data. A short sample is already there so you can see how the result looks.
- Pick the format you are starting from: CSV, TSV or JSON.
- Pick the format you want: JSON, CSV, TSV, XML or YAML.
- For CSV input, leave the delimiter on detect or choose comma, semicolon, tab or pipe yourself. If your values are wrapped in single quotes instead of double quotes, change the quote character.
- Turn off the header option if your first line is data rather than column names.
- For JSON or YAML, choose whether numbers and true or false should become real values, and pick the indent for JSON.
- To write CSV, pick the output delimiter. To turn rows into columns and columns into rows, tick Swap rows and columns.
- Copy the converted text from the Result box with the copy button.
If you paste data with a quote that is opened but never closed, the tool tells you the line where it started, so you can fix it in the original file.
FAQ
Why does my Excel CSV use semicolons instead of commas?
Excel follows the number settings of your computer. When the comma is the decimal mark, as it is in Vietnamese and many European settings, Excel uses a semicolon to split columns. Leave the delimiter on detect and the converter works it out for you.
Will a code like 007 lose its leading zeros?
No. A whole number written with extra zeros in front, such as 007 or 02134, stays text, even when number conversion is on. You can also turn number conversion off and every cell comes out as text.
What happens if two columns have the same header?
JSON keys must be unique, so the second one gets a number added, for example Name and Name_2. An empty header cell gets a name from its position, such as column_3.
Can I turn JSON back into CSV?
Yes. Choose JSON as the starting format. It accepts a list of objects or a list of lists. Keys become the header row in the order they first appear, and nested values are written as JSON text inside the cell.
Can I skip comment lines or blank lines?
Yes. Type the character your comment lines start with, such as #, and those lines are ignored. Turn on the option to skip empty lines and blank rows are dropped too.
Is my data uploaded anywhere?
No. The conversion happens inside the page on your own device. Nothing is uploaded, and the data is gone when you close the tab.