FormatForge

TOML to CSV Converter

Convert TOML configuration data to CSV spreadsheet format instantly. Export config arrays to Excel or Google Sheets. Free, secure, and works entirely in your browser.

TOML
CSV

Drop a file here or click to upload

Supports .toml files

Understanding TOML and CSV

TOML (Tom's Obvious, Minimal Language) is a configuration file format designed to be easy to read and write thanks to its clear semantics. TOML files use tables (sections denoted by square brackets), key-value pairs, and arrays of tables to represent structured configuration data. It is the default configuration format for Rust's Cargo package manager, Hugo static site generator, and many modern CLI tools. To explore TOML syntax rules, data types, and best practices, visit our TOML guide.

CSV (Comma-Separated Values) is one of the oldest and most universally supported tabular data formats. Each line represents a row, and values within a row are separated by a delimiter -- most commonly a comma. CSV files can be opened by virtually every spreadsheet application including Excel, Google Sheets, and LibreOffice Calc, and can be imported by every major database engine and data-analysis library. For a deeper dive into CSV quoting rules, escape characters, and RFC 4180 compliance, see our CSV guide.

Converting from TOML to CSV bridges the gap between a hierarchical configuration format and a flat tabular structure. This is particularly valuable when you need to extract repeating data from TOML files -- such as dependency lists, server inventories, or feature flags -- and analyze them in a spreadsheet.

Why Convert TOML to CSV?

While TOML excels as a human-readable configuration language, there are many practical reasons to transform it into CSV:

  • Extracting dependency lists from Cargo.toml. Rust projects often have dozens or hundreds of dependencies listed as arrays of tables. Converting to CSV lets you sort, filter, and audit packages in a spreadsheet -- perfect for license compliance reviews or version audits.
  • Exporting configuration data to spreadsheets for review. When teams need to review server configurations, feature flags, or environment settings, a CSV file in Google Sheets enables collaborative annotation, filtering, and conditional formatting that TOML cannot offer.
  • Preparing configuration data for database import. If you need to migrate configuration entries into a relational database, CSV serves as the universal import format supported by PostgreSQL, MySQL, SQLite, and every major BI tool.
  • Generating reports from configuration files. Automated reporting pipelines often consume CSV because it integrates seamlessly with pandas, R, Tableau, and Power BI. Converting TOML arrays to CSV is the fastest path from config data to charts and dashboards.

How the Conversion Works

TOML-to-CSV is a cross-format conversion that uses JSON as an intermediate representation. The process follows these steps:

  1. Parse the TOML input using a spec-compliant parser (smol-toml) that validates syntax, data types, and table structure.
  2. Convert to JSON intermediate format. TOML tables become JSON objects, arrays of tables become JSON arrays, and TOML data types (strings, integers, floats, booleans, dates) are mapped to their JSON equivalents.
  3. Identify the tabular data. The converter locates arrays of objects in the JSON structure that can be meaningfully represented as rows.
  4. Flatten nested structures using dot notation so that every leaf value maps to a single column header.
  5. Emit CSV output with proper quoting, delimiter handling, and optional BOM for Excel compatibility.

The table below summarizes how common TOML constructs map to CSV columns:

TOML ConstructCSV Representation
name = "widget"Column name with value widget
[server] port = 8080Column server.port with value 8080
tags = ["api", "v2"]Column tags with value api,v2 (joined)
enabled = trueColumn enabled with value true

Before and After Example

Below is a practical example showing a TOML file with an array of package tables (similar to Cargo.toml dependencies) and the resulting CSV output.

Input TOML

[[packages]]
name = "serde"
version = "1.0.197"
features = ["derive"]
optional = false

[[packages]]
name = "tokio"
version = "1.37.0"
features = ["full", "macros"]
optional = false

[[packages]]
name = "clap"
version = "4.5.4"
features = ["derive"]
optional = true

Output CSV

name,version,features,optional
serde,1.0.197,"derive",false
tokio,1.37.0,"full,macros",false
clap,4.5.4,"derive",true

Notice how each [[packages]] table in the TOML array becomes a row in the CSV output. The features array is joined into a single comma-delimited cell. This flat structure is immediately ready for import into Excel, Google Sheets, or any data analysis tool.

Tips and Best Practices

Use arrays of tables for best results

TOML arrays of tables ([[items]]) map most naturally to CSV rows. If your TOML uses individual named tables instead, consider restructuring them into an array of tables before conversion for cleaner output.

Watch out for mixed-type arrays

TOML enforces homogeneous arrays (all elements must be the same type), but nested tables within arrays can have varying keys. The converter handles this by creating columns for all unique keys across all array entries, leaving cells empty where a key is absent.

Enable BOM for Excel compatibility

If your TOML data includes non-ASCII characters -- such as accented names, Unicode symbols, or CJK characters -- enable the BOM (Byte Order Mark) option before downloading. This ensures Excel interprets the file as UTF-8 and displays special characters correctly.

Choose the appropriate delimiter

If your TOML values contain commas (such as in description fields or inline arrays), consider using semicolons or tabs as the CSV delimiter to avoid ambiguity. This is especially important for European locales where commas serve as decimal separators.

Validate your TOML before converting

Common TOML errors include missing closing brackets on table headers, inconsistent indentation in multi-line strings, and duplicate table definitions. FormatForge highlights the exact error position to help you fix issues quickly before conversion.

Related Tools

Explore other converters and resources that complement TOML-to-CSV conversion:

How to Convert TOML to CSV

  1. Paste your TOML data in the input area, or upload a TOML file
  2. Click the "Convert" button
  3. View the converted CSV output instantly
  4. Copy the result or download it as a file

Features

  • 100% client-side - your data never leaves your browser
  • No login or registration required
  • Instant conversion with real-time preview
  • Supports file upload and drag-and-drop
  • Download converted files directly
  • Works on mobile and desktop

Frequently Asked Questions

How does TOML to CSV conversion work?

The converter parses your TOML data and first transforms it into a JSON intermediate representation. Arrays of tables become JSON arrays of objects, and those objects are then flattened into CSV rows where table keys become column headers and values become cell data.

Why convert TOML to CSV?

CSV is ideal for spreadsheet analysis and data manipulation. Converting TOML configuration data to CSV enables easy editing and review in Excel or Google Sheets, which is especially helpful for reviewing dependency lists or comparing configuration entries.

What TOML structures convert best to CSV?

TOML arrays of tables ([[items]]) convert most naturally to CSV because each table in the array maps to a row. Simple key-value tables are also supported and converted to single-row CSV output with keys as column headers.

Is my data secure during conversion?

Yes, all conversion happens directly in your browser using client-side JavaScript. Your data is never sent to any server, stored remotely, or logged in any way. You can even use the tool offline once the page has loaded.

Can I choose a different CSV delimiter for the output?

Yes. FormatForge supports comma, semicolon, and tab delimiters. You can select the delimiter in the conversion options before running the conversion. Semicolons are common in European locales where the comma is used as a decimal separator.

How are nested TOML tables handled in the CSV output?

Nested TOML tables are flattened using dot notation during the JSON intermediate step. For example, a table [server.database] with a key port = 5432 becomes a column named server.database.port in the resulting CSV. This ensures no data is lost even with deeply nested configurations.