TOML Validator
Paste any TOML content below. Invalid documents report the exact line and column where parsing failed. Valid documents return a normalized structure you can inspect.
What this tool does
It runs your text through the strict smol-toml parser against the TOML 1.0.0 specification. If anything is malformed, it reports the exact line and column where parsing failed and adds a fix hint for the common mistakes. If the document is valid, it returns a normalized view of the parsed structure so you can confirm the parser read it the way you intended.
The intent it closes: "My build tool says the config is broken but won't tell me where." Package managers like cargo, pip, and poetry often emit a generic "failed to parse" message — this gives you a precise line, column, and a suggested fix so you can stop guessing.
It is a syntax validator, not a schema checker. It confirms your file is valid TOML; it does not know whether a particular pyproject.toml or Cargo.toml is missing a field a specific tool requires.
When you'd reach for it
- Hunt down a parse error your build tool won't locate. Get a 1-indexed line and column instead of a generic failure.
- Catch a duplicate key. TOML forbids defining the same key (or redefining the same table) twice — the validator flags it as a hard error.
- Confirm a hand-edit is still valid before committing a
Cargo.tomlorpyproject.toml. - Verify converter output. Paste TOML produced elsewhere and check it parses cleanly.
- Inspect the parsed structure. Switch to Show parsed tree to see exactly how dotted keys and arrays-of-tables nested.
- Sanity-check a secret-bearing file without uploading it anywhere — validation runs entirely in your browser.
How validation works
One click of Validate runs a single parse, then reports.
1. Parse strictly
The whole document is parsed against TOML 1.0.0. There's no "lenient" mode — anything the spec disallows (a bare unquoted string, a number with a leading zero, a duplicate key, a trailing comma in an inline table) is an error, not a warning.
2. On failure, locate and hint
A parse error carries a position, which the tool surfaces as Line N, column M. It then runs a heuristic fix-hint pass that recognizes the usual culprits — smart/curly quotes pasted from a word processor, an unquoted value with spaces, a duplicate key, a missing =, a stray trailing comma, a bracket mismatch, a null literal, a leading-zero number, or an unclosed array — and suggests the concrete fix.
3. On success, summarize
A valid document is re-presented according to the Output mode below, so you can confirm the parse matched your intent.
Output modes
Summary + counts
The default. Confirms the document is valid and reports counts — how many tables, scalar keys, and array-of-table entries it found. A quick structural fingerprint of the file.
Minimal (one line)
A single line confirming the file is valid TOML and how many lines it spans. Useful when you only care about pass/fail.
Show parsed tree
Prints the fully parsed structure as JSON, with datetimes rendered as ISO 8601 strings. This is the mode to use when you want to see precisely how the parser interpreted dotted keys, inline tables, and arrays-of-tables.
What it checks (data types)
The validator accepts exactly what TOML 1.0 allows on the right-hand side of any =:
| Type | Example | Notes |
|---|---|---|
| String | name = "Tom" · path = 'C:\\Users' | Basic "…" with escapes, literal '…' verbatim. |
| Multi-line string | """line 1 | Triple-quoted; '''…''' for literal. |
| Integer | port = 8080 · mask = 0xff | Optional sign, _ separators, hex/oct/bin prefixes. |
| Float | ratio = 3.14 · tau = 6.28e0 | Must have a . or exponent. inf, -inf, nan are valid. |
| Boolean | enabled = true | Only lowercase true / false. |
| Datetime | ts = 2026-05-25T13:00:00Z | RFC 3339. Local-date / local-time variants allowed. |
| Array | ports = [8001, 8002] | Mixed types allowed; trailing comma optional. |
| Inline table | p = { x = 1, y = 2 } | One line, no trailing comma. |
| Table | [server] | Headers are unique; dotted-key headers nest. |
| Array of tables | [[users]] | Repeat for each entry. |
Example
Input (with a syntax error):
[server]
port = 8080
name = "web-server"
tags = ["prod", "api" # missing closing bracket
Output (Validation result):
Error: Unexpected end of input, expected ']' or ','
Line 4, column 21
Once the bracket is closed, switching Output to Summary + counts confirms the document is valid and reports the number of tables and keys it found.
Errors and how to fix them
Concrete broken snippets and the fix the validator points you toward:
| What you wrote | Why it fails | Fix |
|---|---|---|
name = Tom | Bare value with letters — only numbers/bools/dates are valid bare values. | name = "Tom" |
version = 1.2.0 | 1.2.0 is not a valid float — too many dots. | version = "1.2.0" |
port = 0123 | Numbers can't have a leading zero. | port = 123 or port = 0o123 |
level = null | TOML has no null. | Drop the key, or use "" / a sentinel. |
ports = [80, 443,] inside {…} | Trailing comma not allowed in inline tables. | { ports = [80, 443] } (no trailing comma in the table). |
tags = ["a""b"] | Inline array can span lines, but values still need separators. | tags = ["a", "b"] or multi-line with commas. |
[a]x = 1[a] | Same table redefined — a duplicate key. | Combine entries under one [a] header. |
name = “Tom” | Smart/curly quotes from a word processor. | Replace with straight ASCII "…". |
The error says "Line 10" but the mistake looks like it's on Line 9
Parsers often don't realize something is wrong until the next token. A missing closing quote or bracket is frequently reported at the start of the following line, where the parser finally gave up looking for the end of the previous value. Check the line above the reported one.
"Duplicate key" on something that looks unique
Watch for the same table header twice ([a] … [a]), or a dotted key that collides with a table — a.b = 1 and a later [a] with b both define a.b. Consolidate them under one definition.
Recipes by intent
Pinpoint why cargo or poetry rejects your file
Paste the config and validate. The line and column take you straight to the offending token — far faster than the build tool's generic "failed to parse config".
Prove a config has no duplicate keys
Validate in Summary + counts. A duplicate key or redefined table is reported as a hard error; a clean pass with sensible counts is your evidence the structure is unique.
See how the parser actually nested your keys
Switch Output to Show parsed tree. The JSON view shows exactly how dotted keys and [[arrays-of-tables]] resolved — handy when a value isn't where you expected.
Limits and performance
- In-memory. The parser loads the whole document into a string. Project configs validate instantly; files past ~50 MB can make the tab struggle.
- Syntax only. It won't tell you a required
Cargo.tomlorpyproject.tomlfield is missing — that's a schema concern, not a TOML one. - One error at a time. Parsing stops at the first error, so fix it and re-validate to surface the next.
FAQ
Which TOML version does it validate against?
TOML 1.0.0 — the stable version used by cargo, pip, poetry, and essentially the whole modern ecosystem.
Does it check for missing required fields?
No. It's a syntax validator. It confirms the file is valid TOML, not that it satisfies a particular tool's schema.
Why use this instead of just running my build tool?
Build tools tend to emit a generic parse failure. This gives 1-indexed line and column numbers plus a fix hint, which makes a missing comma or stray character much faster to find in a large file.
Is my data saved or logged?
No. There's no backend. Validation runs in your browser's memory and is gone the moment you close or refresh the tab.
Is there a CLI version for CI?
For pipelines, taplo is excellent at linting TOML from the command line. This page is for quick, install-free debugging.