CSV to TOML
Convert CSV (comma-separated values) into TOML. The header row defines field names; each data row becomes a [[data]] table entry. Uses @iarna/toml serializer in your browser.
CSV in, TOML out
A small sample to show the shape of the conversion. Pretty-printed output, types preserved where possible.
id,name,age 1,Alice,30 2,Bob,25
[[data]] id = 1 name = "Alice" age = 30 [[data]] id = 2 name = "Bob" age = 25
What you'll use this for
CSV to TOML shows up in every backend and ETL stack — feeding APIs, migrating configs, debugging payloads.
API & data imports
Prepare payloads for REST APIs and ingestion endpoints.
Data migration
Move configuration and tabular data between systems and formats.
Debugging
Inspect production data in a sensible, structured form.
ETL pipelines
Stage transformations between formats in your data flow.
How to convert CSV to TOML
Paste your CSV
Drop your source into the left editor. The sample loads on first visit — replace it with your data.
Click Convert
Or leave Auto-convert on for live updates as you type. Conversion runs locally.
Review the output
The right pane shows pretty-printed TOML with status, byte counts, and line count.
Copy or download
Use the action bar to copy to clipboard or save as a file. Or jump to the reverse converter for round-trip checks.
Frequently asked questions
TOML has no top-level array type. Wrapping rows in [[data]] (array of tables) gives valid TOML that round-trips cleanly.
Yes for CSV parsing — quoted fields, embedded commas, and ""-escaped quotes are all handled.
Numbers, true, false, and null are auto-cast before serializing to TOML.
TOML keys can contain dots only via quoting. The serializer handles quoting automatically.
Yes. Runs entirely in your browser.
About CSV to TOML
CSV is the universal flat-file format; TOML is a structured config format that supports arrays of tables natively. This converter wraps every CSV row in a [[data]] block so the result is canonical TOML you can drop into a Rust or Python project.
How conversion works
- First non-empty line is the header row.
- Each subsequent row becomes an object keyed by the headers.
- All rows are wrapped in a top-level
dataarray. @iarna/tomlserializes the structure to TOML.
Use cases
- Bulk-load spreadsheet data into a Rust app via
serde. - Generate
pyproject.tomltable-of-tables sections from a sheet. - Convert exports into TOML fixtures for tests.