What the TOML validator checks
TOML is the configuration format behind Cargo.toml, pyproject.toml, Hugo and Netlify configs and many other tools. This TOML validator parses your file with a TOML 1.0 parser and either confirms it is valid or shows the first error with its exact position. A valid file is also displayed as JSON, so you can confirm that tables, arrays of tables and dotted keys ended up where you expected.
Example
title = "inventory-service"
[owner]
name = "Northwind Labs"
[[servers]]
name = "alpha"
[[servers]]
name = "beta"
The status bar reports Valid TOML ✓ (3 top-level keys) and the output shows:
{
"title": "inventory-service",
"owner": { "name": "Northwind Labs" },
"servers": [
{ "name": "alpha" },
{ "name": "beta" }
]
}
(Condensed here; the output panel indents every level.) Each [[servers]] header adds one element to the servers array.
Errors you are likely to meet
| Input | Message | Why |
|---|---|---|
name = Ana | invalid value | Strings must be quoted |
a = 1 twice | trying to redefine an already defined table or value | Keys may only be defined once |
[a] header twice | same message | Each standard table can only be declared once |
key with space = 1 | illegal character in key | Bare keys allow only letters, digits, _ and -; quote other keys |
a = "x | control characters are not allowed in strings | The closing quote is missing, so the string runs into the line break |
n = 9223372036854775807 | integer value cannot be represented losslessly | Valid TOML, but larger than a JavaScript number can hold exactly |
How TOML types appear in the JSON preview
- Integers with underscores (
1_000) and hex, octal or binary integers (0x1F) become plain numbers. - Offset date-times, local date-times, dates and times become strings;
1979-05-27is shown as"1979-05-27". infandnanare valid TOML floats but have no JSON form, so they are shown asnull.- Dotted keys such as
a.b.c = 1create nested objects:{"a":{"b":{"c":1}}}.
A quick TOML syntax refresher
- Key/value pairs are written
key = value, one per line. Bare keys may contain letters, digits, underscores and dashes; anything else needs quotes, as in"key with space" = 1. - Strings come in four kinds: basic
"…"with escapes, literal'…'without escapes (handy for Windows paths and regular expressions), and triple-quoted multi-line versions of both. - Tables start with
[name]and contain every key until the next header. Indenting the keys below a header is allowed but has no meaning. - Arrays of tables use
[[name]]; each header starts a new element. - Inline tables like
point = { x = 1, y = 2 }are meant to stay short and on one line; once defined, they cannot be extended by a later[point]header.
Most validation errors come from breaking one of these rules, typically by defining the same table in two places after a file has been edited by several people.
Validator vs formatter
The validator never changes your file. If you also want consistent spacing and table layout, run the TOML formatter. To export the data, use the TOML to JSON converter, and for YAML configs the YAML validator is the equivalent check.
Privacy
Your TOML is parsed in the browser and not uploaded. Load URL fetches files through our server, and Save & Share stores the content for a shareable link, only when you use those buttons.