Developer Tools

TOML Validator

Check a TOML file against the TOML 1.0 specification. Errors such as a table defined twice, a key redefined, an unclosed string or an invalid date are reported with the exact line and column, and valid files are shown as JSON or as a list of every key with its type, so you can confirm that the structure is what your tool expects.

  • Runs in your browser
  • No sign-up
  • Free to use

How to use TOML Validator

  1. Paste TOML or open a .toml file.
  2. Read the error with its line and column, if any.
  3. Check the parsed data as JSON or a key list.
  4. Fix the file and validate again.

TOML Validator features

TOML 1.0

Spec-compliant parsing with smol-toml.

Exact errors

Line and column for every syntax or semantic problem.

Duplicate checks

Tables and keys defined twice are rejected.

Typed key list

Every dotted key with its type and value.

Dates and times

Offset date-times, local dates and times recognised.

Local

Validation runs in your browser.

When to use TOML Validator

  • Finding the error in a Cargo.toml that cargo refuses.
  • Checking pyproject.toml before publishing a Python package.
  • Validating application configuration written in TOML.
  • Learning how TOML tables and dotted keys map to data.

TOML Validator FAQ

What errors are detected?

Syntax errors, invalid values, duplicate keys, tables defined twice, mixed or invalid arrays and malformed dates, each with its position.

Why is defining a table twice an error?

The TOML specification requires each table to be defined once. Adding keys to [server] in two places is a common mistake when files grow.

How are dates shown?

TOML date-times become ISO 8601 strings in the JSON view and are labelled datetime in the key list.

Does it check Cargo- or Poetry-specific rules?

It checks TOML itself. Tool-specific fields, such as allowed keys in [package], are checked by the tools.

Can I format TOML too?

Yes, with the TOML Formatter.

Is my file uploaded?

No. Everything happens in your browser.

Validating TOML

TOML maps directly onto a hash table: keys and values, grouped into tables written as [name] headers, with arrays of tables written as [[name]]. Its rules are designed to be unambiguous, which also means a file either parses or does not. When a tool such as cargo or pip rejects a TOML file, the message is often short; checking the file directly shows exactly where the problem is.

The validator uses smol-toml, a parser that follows the TOML 1.0 specification closely. Besides syntax errors like unclosed strings or missing equals signs, it enforces the semantic rules: a key may not be defined twice, a table may not be defined twice, and a dotted key cannot extend a table that was already closed.

A frequent real-world error is the duplicated table. As configuration grows, a second [server] section appears further down the file, perhaps added by someone else. Readers might expect the keys to be merged, but TOML forbids it, and the validator points to the second definition.

For valid files, the parsed data is shown in two ways. The JSON view shows the nesting exactly as programs see it. The key list writes every value with its full dotted path and its type, integer, float, string, boolean, array or one of the date-time types, which is useful for checking that a version is a string and a port is an integer.

Everything runs in your browser, so configuration files containing internal hostnames or settings stay on your device.

Other useful tools