Reading TOML errors by line and column
A TOML parser usually stops at the first error, so an accurate position saves a great deal of time. This tool attaches a line and column to every error and names the key or table involved where it can.
How positions are counted
- Lines start at 1.
- Columns count the first character of the line as 1. A tab counts as one character.
- A duplicate key points at the start of the second occurrence.
- A table redefinition points at the
[that reopens it. - String, date and number errors point at the start of the offending value.
Parsers differ slightly here. Some report an error after reading the key and passing the value. This tool consistently points at the start of the token that caused the problem, and selecting the diagnostic puts the caret exactly there.
Common errors and fixes
| Message | Usual cause | Fix |
|---|---|---|
| the key is already defined | the same key twice in one table | delete one or rename it |
| the table cannot be defined twice | [a] twice, or [a] after a dotted key | merge the declarations |
| an inline table cannot be extended | adding a key to a value made with {...} | declare it as a bracketed table |
| the string is not closed | a missing quote, or a newline inside the string | close it, or use a multi-line string |
| invalid escape sequence | an escape such as \q | write \\ for a backslash, or use a literal string |
| not a valid date or time | 2026-02-30, 24:00:00 | use a value that exists in the calendar |
Example: an error after the value
version = 0.1.0.2
This line reads 0.1 as a float and then fails on the remaining .0.2 with 'a newline must follow a statement'. The position is the column where .0.2 starts. Write the version as version = "0.1.0.2".
Example: duplicate key
[server] port = 8080 port = 9090
The second port produces 'the key port is already defined'. TOML does not let the later value win: if it did, a merged configuration would make it impossible to tell which value took effect.
Example: table redefinition
[a] b = 1 [a.b] c = 2
b = 1 already defined a.b as a value, so [a.b] would turn that value into a table. This is the most common error when dotted keys and headers are mixed.
Fixing one error can reveal another, because the parser stopped at the first. This tool re-parses after every edit and shows the next error in turn.
Keeping a lint report
The diagnostics tab lists errors and warnings next to the key and type table. The report tab turns the same content into Markdown tables and exports JSON. The report never contains the input text, so the error list can be shared without sharing the configuration file.
How this differs from schema validation
This tool checks syntax. It does not check whether a key is required, whether a value is in range, or whether Cargo or wrangler will accept the file. Remove syntax errors first, then run each tool's own checker.
Questions
Can I see every error at once?
The parser stops at the first error, so one is shown at a time. Fix it and run again for the next. Most editor extensions behave the same way.
The column number differs from my editor.
Counting differs: tabs versus characters, or display width versus code points. This tool counts characters and treats the first character of a line as column 1.
Is a warning an error?
No. Warnings say a value may change during conversion, for example when a date becomes a string or a null is dropped.
Load the error samples and select a diagnostic to jump straight to the line in the input.
Open the toolThese guides follow the TOML v1.0.0 specification (2021-01-11), RFC 3339 (dates and times), the YAML 1.2 core schema and JSON (RFC 8259). Every example is synthetic.