Input

Validation Results

Enter or paste your TOML to validate

What this checks

TOML looks forgiving and is not. It has no significant indentation, so the errors YAML users expect are absent — and it is stricter about quoting, duplicate keys and redefined tables than most people assume from reading a Cargo.toml.

The failure that costs the most time is a table header declared twice. [network] appearing again later in the file is not a merge of the two blocks, it is an error, and it happens most often when someone pastes a section from another config. The message names the line, which is usually all you need.

Everything runs in this tab. That matters more for TOML than for most formats, because config files are where API tokens and connection strings live, and pasting one into a validator that posts it somewhere is a bad trade for a syntax check. See the specification if you want to confirm a rule this page enforces.

Using it

  1. Paste your TOMLValidation runs as you type. Sample loads a valid file; Invalid Sample loads one with a redefined table so you can see what an error looks like.
  2. Read the line and columnBoth come straight from the parser and are already 1-based, so they match your editor without adjustment. The offending line is highlighted in the pane.
  3. Follow the hintThe advice is chosen from the error, not generic. A duplicate key and a missing quote need different fixes.
  4. Check the statisticsTable count, top-level keys and nesting depth. A depth you did not expect usually means a dotted key created a level you did not intend.

If the file is valid here but your tool still rejects it, the problem is the schema rather than the syntax — the keys parse but are not the ones being looked for. Converting with TOML to JSON and reading the shape is usually the fastest way to see which key is in the wrong section.

A table declared twice

This is the mistake that comes up most, and the reason is nearly always a copy-paste merge. TOML treats the second [network] as redefining a table that already has values.

config.toml → error Line and column
config.toml[network] appears twice
# merged from two branches
subscriber:
  subscriberId: SUB-1001
  plan: Unlimited 5G
  roaming: true
  plan: Business 200GB
Validation resultNamed line · reason · fix
✗ Invalid YAML

Line 6, Column 3
Error: The key "plan" appears twice
in the same mapping. YAML requires keys
to be unique within a mapping.

What to do: Delete one of the two
entries, or move it under a different
parent.

When you would use it

A build failing on the manifest

Cargo and Poetry report a parse error with a line number and stop. Pasting the file here gives the same position plus what to do about it.

Checking a config before committing

Faster than pushing and waiting for CI to tell you a bracket is missing.

After merging two configs

Duplicate keys and repeated table headers are exactly what a hand-merge produces, and both are errors in TOML rather than last-one-wins.

Coming from YAML

Different rules, different mistakes. If you also work with YAML, YAML Validator catches that format's own traps.

What it does

  • Exact line and column, taken from the parser and already 1-based.
  • Advice matched to the error, not one generic sentence for every failure.
  • The offending line is highlighted in the editor so you can see it in context.
  • Statistics — size, lines, table count, top-level keys and nesting depth.
  • Nothing is uploaded. A config file with a token in it stays in this tab.

Questions people actually ask

It says my integer cannot be represented losslessly. Is my file wrong?

No — your file is valid TOML, and this is the one case where the validator is reporting a limitation rather than a mistake. The spec requires 64-bit integers, and the parser browsers use refuses anything past 2^53 instead of silently rounding it. Refusing is the honest behaviour, and the validator reports it verbatim rather than pretending the document is malformed. TOML to JSON and TOML to Table both work around it and will open the file.

Why is redefining a table an error? YAML lets me repeat a key.

YAML mostly lets the last one win; TOML forbids it. That is a deliberate design choice — a config where the meaning depends on which duplicate came last is a config that breaks when someone reorders it.

Does valid mean my Cargo.toml is correct?

Only that it parses. Cargo also requires particular keys in particular sections, and a syntactically perfect file can still be missing [package] name. Syntax is the floor, not the ceiling.

What counts as a table in the statistics?

Every [header] and [[header]] line in the source. It is counted from the text rather than the parsed tree on purpose, because [a.b.c] is one header you wrote but three levels once parsed, and the figure is more useful as "how many sections is this file".

Related tools

Worth reading