How to validate and format TOML
Paste TOML into TOML input or load a TOML or TXT file. The page parses the source, lists syntax and table errors with line and column locations, and shows a formatted output preview when the checks pass. Formatting changes presentation while leaving parsed values unchanged.
How to check a TOML file
- Paste TOML into TOML input, or use Drop a TOML file here and browse files.
- Choose the formatting controls you want to apply.
- Check Tables, Arrays of tables, Key/value pairs, Comments, and Errors in the result area.
- Fix the source text when an error is reported, then let the page check the updated input.
- Click Export TOML when the error count is zero. Click Export errors for the CSV report.
What the TOML formatter changes
Indentation can be 2 spaces, 4 spaces, Tab, or None. Turn on Indent keys under table headers to indent keys and comments beneath a header. Space around "=" controls assignment spacing. Max consecutive blank lines keeps 0, 1, or 2 blank lines, and Blank line before each table header adds a blank line before headers.
Quote style has Preserve as written, Prefer double-quoted, and Prefer literal, where possible. Array layout has Preserve as written, Always inline (single line), and Always one element per line. Line endings selects LF (Unix / Mac) or CRLF (Windows).
title="Example"
[owner]
name="Ada"
With Space around "=" selected, the preview becomes:
title = "Example"
[owner]
name = "Ada"
TOML syntax errors and table order
The parser reads tables, arrays of tables, inline tables, quoted and dotted keys, strings, arrays, booleans, numbers, and date or time values. It reports an unterminated string, a missing assignment, a duplicate key, or a table/key collision with line and column details. The error table displays up to 1,000 rows; Errors still shows the full count.
title = "Example"
title = "Example"
The second declaration produces a duplicate-key error. Table order has Preserve declaration order and Canonical (shows safety warning). The canonical choice displays the warning and leaves declaration order unchanged. Comments stay in the formatted output.
When TOML export is available
Formatted output appears after parsing and semantic checks pass. Export TOML remains disabled while errors exist. Export errors downloads toml-validation-errors.csv with line, column, and message fields. The formatter keeps numbers, booleans, dates, times, and multiline strings as parsed. Quote changes apply only when the decoded string value stays the same, and invalid TOML is left without formatted output.
For another configuration syntax, use Config File Validate Tools. Choose YAML Validator and Formatter for YAML. The page reads and processes the TOML in the browser, and its script makes no request containing that content.
What happens with large TOML files
When a loaded file is longer than 300,000 characters, TOML input shows a truncated preview and a notice. The full text is still processed. Click Clear to remove the input and hide the result workspace.
Where TOML validation comes up
Paste a configuration snippet, resolve a duplicate key or malformed value, then export the formatted TOML after the error count reaches zero.
Load a .toml or .txt file, select CRLF (Windows) when needed, and inspect the preview before downloading it.
Files with comments and table headers keep those comments and declarations while you change spacing or array layout.
Frequently asked questions
How do I validate and format TOML?
Paste TOML into TOML input or load a file, choose the settings, and inspect the validation result. Correct reported errors before using Export TOML.
Can a TOML formatter change my values?
The formatter leaves parsed values unchanged. It changes presentation, and quote-style changes apply only when the decoded string value stays the same.
Why does my TOML file show a duplicate key error?
A duplicate key error means the same key was defined again in the current table context. The error list identifies the later declaration by line and column.
Can I export TOML while errors remain?
Export TOML is disabled while errors remain. Fix the source TOML, let it reprocess, and export after the error count reaches zero.