HCODX/CSV to TOML
100% browser-based · UTF-8 safe · No upload

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 input
TOML output
Conversion options
Reverse (TOML → CSV)
Input size
0 B
Output size
0 B
Output lines
0
Status
Ready
Example

CSV in, TOML out

A small sample to show the shape of the conversion. Pretty-printed output, types preserved where possible.

CSV
id,name,age
1,Alice,30
2,Bob,25
TOML
[[data]]
id = 1
name = "Alice"
age = 30

[[data]]
id = 2
name = "Bob"
age = 25
Use cases

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.

Step by step

How to convert CSV to TOML

1

Paste your CSV

Drop your source into the left editor. The sample loads on first visit — replace it with your data.

2

Click Convert

Or leave Auto-convert on for live updates as you type. Conversion runs locally.

3

Review the output

The right pane shows pretty-printed TOML with status, byte counts, and line count.

4

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.

FAQ

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

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 data array.
  • @iarna/toml serializes the structure to TOML.

Use cases

  • Bulk-load spreadsheet data into a Rust app via serde.
  • Generate pyproject.toml table-of-tables sections from a sheet.
  • Convert exports into TOML fixtures for tests.
Related

Related tools