CSV to TOML Converter

Paste or drop a CSV file to turn it into a TOML array of tables (like [[row]]), with numbers and booleans automatically typed when a whole column is consistently numeric or boolean. Or paste a TOML document containing an array of tables to flatten it back into CSV. The array key is configurable for CSV → TOML and auto-detected for TOML → CSV when there's exactly one candidate. It runs on your device with the smol-toml library loaded on demand, and nothing is uploaded.

PrivateFreeWorks offline

Reviewed by Vincenzo Manto, Founder & Lead Developer · Last updated September 27, 2026

How it works

  1. 1

    Paste your CSV text or a TOML document with an array of tables, or drop a file into the input box.

  2. 2

    Pick the delimiter and, for CSV → TOML, the array key that names the [[row]] table array (or leave it for TOML → CSV to auto-detect it).

  3. 3

    The converted output updates instantly on the right.

  4. 4

    Copy it or download it as a .toml or .csv file.

Why convert between CSV and TOML?

TOML has become the go-to configuration format for tools like Cargo, Poetry, and many static-site generators, and its array-of-tables syntax maps naturally onto tabular data. This tool lets you turn a spreadsheet export into ready-to-use TOML config rows, or pull structured config data back out into a CSV you can open in Excel or Google Sheets.

Careful, conservative type inference

Rather than guessing per-cell, this converter looks at an entire column at once: a column is only converted to a native TOML integer, float, or boolean type if every value in it, across every row, unambiguously matches that type. That avoids the common conversion bug where one stray non-numeric value in an otherwise numeric column would crash the conversion or silently corrupt the data; here it just keeps that one column as a string.

Frequently asked questions

What TOML structure does CSV → TOML produce?

Every CSV row becomes one table in a top-level array of tables, e.g. [[row]] blocks with each CSV column as a key. You choose the array's name (the default is "row").

How are numbers and booleans detected?

A column is only emitted as TOML integers, floats, or booleans when every single value in that column across every row matches (e.g. all rows have a purely numeric value in that column). If even one row has a non-numeric value, the whole column stays a quoted string so the conversion never silently misrepresents mixed data.

What TOML structure does TOML → CSV expect?

A document containing an array of tables (an array whose entries are all objects/tables), such as [[row]] or [[people]]. If there's exactly one such array at the top level, it's used automatically; if there's more than one, specify which array key to read from.

What happens to rows with different columns?

TOML → CSV uses the union of every key seen across all table entries as the CSV columns; a table missing a given key just gets an empty cell in that column.

Does this tool upload my file anywhere?

No. Everything runs locally in your browser. The small smol-toml library is loaded on demand only on this page and never sends your data anywhere.

Can I control the CSV delimiter?

Yes, choose between comma, semicolon, tab, and pipe for both directions.

Related tools