FormatterHQ

TOML Validator

Check Cargo.toml, pyproject.toml and other TOML config files for syntax errors, and see the parsed result as JSON before your build tool does.

Input TOML
Output JSON
Ready.

How to use the TOML Validator

  1. Paste the TOML into the input editor, drop a .toml file on it, use Load URL, or click Sample.
  2. Click Validate (Auto update re-checks as you type).
  3. Read the status bar: Valid TOML ✓ with the number of top-level keys, or an error with line and column.
  4. Inspect the parsed data as JSON in the output panel; choose the JSON Indent if you plan to copy it.

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

InputMessageWhy
name = Anainvalid valueStrings must be quoted
a = 1 twicetrying to redefine an already defined table or valueKeys may only be defined once
[a] header twicesame messageEach standard table can only be declared once
key with space = 1illegal character in keyBare keys allow only letters, digits, _ and -; quote other keys
a = "xcontrol characters are not allowed in stringsThe closing quote is missing, so the string runs into the line break
n = 9223372036854775807integer value cannot be represented losslesslyValid 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-27 is shown as "1979-05-27".
  • inf and nan are valid TOML floats but have no JSON form, so they are shown as null.
  • Dotted keys such as a.b.c = 1 create 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.

Frequently asked questions

Does the TOML validator check Cargo.toml or pyproject.toml fields?
It checks TOML syntax only. Whether a key such as [tool.poetry] or [dependencies] is correct for a specific tool is decided by that tool, so run cargo or your Python build tool for schema-level checks.
Which TOML version is supported?
The parser implements TOML 1.0, the current stable specification, including arrays of tables, inline tables, dotted keys and all date and time types.
Why is a large integer rejected?
TOML allows 64-bit integers, but JavaScript numbers are exact only up to 2^53 - 1. Rather than silently rounding, the validator reports that the value cannot be represented losslessly. Store such values as strings if you need to process them in JavaScript.
Are comments allowed in TOML?
Yes. A # starts a comment that runs to the end of the line, except inside strings. Comments are ignored by the parser, so they do not appear in the JSON preview.

Last updated September 26, 2026

Related tools

TOML Formatter Format TOML files online. Normalise spacing, tables and arrays of tables into clean, canonical TOML. TOML to YAML Converter Convert TOML configuration (Cargo.toml, pyproject.toml, config.toml) to readable YAML. YAML to TOML Converter Convert YAML to TOML with tables and arrays of tables — handy for Cargo, pyproject and Hugo configs. Credit Card Validator Check credit card numbers with the Luhn algorithm, detect Visa, Mastercard, Amex and more, and verify length. Runs 100% locally. CSS Validator Validate CSS online: find unclosed braces, missing semicolons and other syntax errors. Email Address Validator Check email address syntax in bulk and flag typos in popular domains, disposable providers, role accounts and duplicates. UUID Validator & Decoder Validate UUIDs/GUIDs and decode version, variant and embedded timestamps for v1, v6 and v7 — many at once. HTML Validator Validate HTML markup online and find unclosed, mismatched or malformed tags. IBAN Validator Validate IBANs for 80+ countries with the MOD-97 checksum and country length rules, and see bank code and account parts. ISBN Validator & Converter Validate ISBN-10 and ISBN-13 check digits and convert between the two formats, one or many at a time. JavaScript Validator Check JavaScript for syntax errors online and find the exact line and column of each problem. Phone Number Validator & Formatter Validate phone numbers for 240+ regions and format them as E.164, international and national, with line type detection.