Dev TooloraLocal dev tools

> Formatters

TOML Format

Format or validate TOML with normalized spacing and table sections. Comments are removed in Format mode.

Runs locallyWorks offline
Back to results
Input

Source data

Mode
Output

Result

Your result will appear here.

Tool guide

About this tool.

TOML is a configuration format used by Cargo, pyproject.toml and many other tools. Formatting rewrites its layout without changing the data.

This tool parses the text, then writes it again with one key per line and table sections. Key order is kept and dates keep their TOML form.

  • Normalize a hand-edited Cargo.toml or pyproject.toml.
  • Check a config file for syntax errors before committing it.
  • Turn inline tables into regular table sections for easier review.

Paste TOML or choose a sample.

Choose Format to rewrite the text, or Validate to only check the syntax and count comments.

If parsing fails, use the line and column in the error to fix the problem, then run again.

Copy the result or save formatted.toml.

  • b=1 and a = "x" → b = 1 and a = "x", in the same order.
  • d = 1979-05-27 → stays a TOML date; d = "1979-05-27" stays a string.
  • # note above a key → removed in Format mode and counted in the summary.
  • a = with no value → an error that names the line and column.

  • Processing is local; nothing is uploaded.
  • Format mode removes comments; the summary shows how many. Validate mode returns your input unchanged.
  • Indentation is not configurable: TOML output uses table sections without indentation.
  • Keys made only of digits are written in ascending numeric order, because the parser stores them that way.
  • The limits are 5,000,000 input characters, 128 nesting levels and 8,000,000 characters of key paths. Output is never silently truncated.

FAQ

Questions about TOML Format

Does formatting remove comments?

Yes. Format mode drops every comment because the text is rewritten from the parsed data. The summary tells you how many were removed. Validate mode keeps your text unchanged.

Does it sort keys?

No. Keys stay in the order you wrote them.

Are dates turned into strings?

No. Local dates, times and offset date-times are written back exactly as they were, without quotes.

What happens to inline tables?

Nested tables are written as [table] sections and arrays of tables as [[table]] sections, so inline tables are expanded.

Which values are refused?

Only integers outside the signed 64-bit range are refused. Floats such as inf and nan are formatted as they are. Fix the integer and run again.

Continue with

JSON ↔ TOML ConverterConvert JSON to TOML sections or inline tables and TOML back to JSON, with exact 64-bit integers, dates kept as strings and no silently dropped nulls.YAML FormatFormat or validate YAML, including multi-document streams, while keeping comments, anchors and aliases.