Convert to CSV

Convert INI, JSON, NDJSON, TOML, TSV, XML, or YAML to CSV. Paste the source or open a local file, then choose the delimiter and whether to include column headers. The conversion runs in your browser and does not upload the input.

How conversion works

Link

Each non-empty NDJSON line becomes a row. Every line must contain one complete JSON value. Object keys become columns in first-seen order, missing properties become empty fields, and nested values stay in one cell as JSON text. A malformed line stops the conversion and the error names its line number.

JSON and YAML arrays become rows. Keys found across their objects become columns in first-seen order. Missing properties produce empty fields, while nested objects and arrays stay in one cell as JSON text.

Each INI section becomes a row. The first column is named section, and values outside a section use global. TSV rows keep their order and are written with the chosen CSV delimiter. The converter does not add or remove a TSV header row.

For XML input, set the repeated element that represents a row. Its child element names become columns. The attributes key determines where the parser stores XML attributes. Nested values are written as JSON text, while the root element, comments, and processing instructions are not preserved.

Output options

Link

A comma is the usual delimiter, but semicolons are common where commas are decimal separators. The delimiter must be one character. The header option applies when the source has named fields. Invalid input or an invalid delimiter produces an error instead of partial CSV.

Check the result before importing it into a spreadsheet. Spreadsheet software may change dates, large integers, and values with leading zeroes when it opens a CSV file.

What CSV can represent

Link

CSV stores a table as plain text. Each line is a row and a delimiter separates its fields. A header row can name the columns. Files usually use the .csv extension and the media type text/csv.

name,age,city
John,25,Rotterdam
Jane,30,"The Hague"

A field containing the delimiter, a double quote, or a line break must be enclosed in double quotes. A double quote inside such a field is written twice. CSV has no standard type information, so every cell remains text until the receiving program interprets it.

CSV dialects and compatibility

Link

CSV looks simple, but programs do not all interpret it in the same way. RFC 4180 documents a common form with commas, double-quoted fields, and CRLF line endings. It does not cover every file called CSV. Export tools may use semicolons, omit headers, accept backslash escapes, or handle blank lines differently. Character encoding can cause trouble too, especially when an older program expects a local encoding instead of UTF-8.

The receiving program’s import settings are therefore part of the format. Match its delimiter and header setting, then test fields containing quotes, line breaks, non-ASCII characters, and empty values. A small trial import catches more practical problems than choosing a dialect by name.

Where CSV works well

Link

CSV is a good exchange format for one rectangular table. Spreadsheets, databases, analytics tools, and accounting systems can usually import it without extra libraries. It is also easy to inspect in a text editor or process one row at a time in a script.

It is a poor storage format for data with several related tables or deeply nested records. In those cases JSON, XML, or a database can retain the structure that CSV has to flatten.

What may be lost

Link

CSV has no native objects, arrays, attributes, comments, schemas, or relationships between tables. Conversion cannot preserve formatting, aliases, namespaces, or application-specific rules. Rows with different shapes share one set of columns, and missing values become empty fields. The result may therefore no longer distinguish an empty string from null or an absent value.

The converter reads the complete input and output into memory. It suits ordinary local files, not multi-gigabyte exports.

Files, privacy, and saved work

Link

Select a file or drop it on the file control. A recognised extension selects the matching input type. The browser reads the file locally with FileReader and does not upload it.

The selected format, each format’s input, parser settings, and CSV settings are stored in localStorage. Switching formats does not overwrite text saved for another format. Clear the fields or site data after handling sensitive information on a shared device.

Link

Widget made with staark