T tomlkit·org
Inspect Formatter Validator Convert TOMLJSON JSONTOML TOMLYAML YAMLTOML INITOML TOMLINI .envTOML TOML.env TOMLTS Transform Sort keys Flatten Minify Compare Diff Merge

TOML Flattener

updated 24 May 2026

Flatten a nested TOML document to a list of dotted-key assignments — one key per line. Easier to grep, easier to script against, easier to compare visually.

When to flatten

Nested TOML is great to read, but hard to grep. A flat dotted-key form is useful when you want to:

  • Search a large config with grep "database\.".
  • Pipe values into a feature-flag system or KV store that expects flat keys.
  • Diff two configs visually without indentation getting in the way.
  • Audit which keys exist before refactoring.

How to use it

  1. Paste TOML on the left.
  2. Click Flatten.
  3. The right pane lists every leaf value as path.to.key = value.

Output format

Each line is a dotted path = a TOML-style value. Strings are quoted, numbers and booleans are bare, arrays stay inline. Nested arrays-of-tables are not flattened to indexes (yet) — they're left as inline TOML arrays. That keeps the output reversible if you ever need to.

FAQ

Can I round-trip this back to nested TOML?

Not directly through this tool, but the output is valid TOML (every line is a dotted-key statement, which TOML 1.0 supports). Pasting the flat output into the formatter gives you a normalized version.

Does it expand arrays of tables?

No. Arrays of tables stay as inline values to preserve their semantics. If you need per-index flattening, let me know — it's a one-line change.