TOML Validator
Validate TOML and re-emit it as clean, indented JSON
TOML Input
Output
About
Paste a TOML document to validate it against the TOML spec and pretty-print the parsed result as indented JSON. Handy for Cargo.toml, pyproject.toml, and config files. Everything runs in your browser; nothing is uploaded.
Examples
Validate a Cargo.toml section
[package]
name = "my-crate"
version = "0.1.0"
edition = "2021"
[dependencies]
serde = "1.0"{
"package": {
"name": "my-crate",
"version": "0.1.0",
"edition": "2021"
},
"dependencies": {
"serde": "1.0"
}
}
✓ Valid TOMLThe parser reads the top-level [package] table and [dependencies] table, re-emitting them as nested JSON objects.
Catch an inline table syntax error
[server]
host = "localhost"
port = 8080
users = { name = "alice", admin = true✗ Invalid TOML
Error: Unexpected end of file — expected } or , at line 5
Inline table 'users' is missing its closing brace.The parser's line-aware error points to line 5 where the inline table is left unclosed.
About this tool
TOML (Tom's Obvious, Minimal Language) is a configuration file format designed to be human-readable and unambiguous. It is the native format for Rust's Cargo.toml, Python's pyproject.toml, and many other tools. Validating a TOML file before shipping it catches bracket mismatches, table key errors, and malformed inline tables before they surface as runtime errors.
This validator parses TOML using the @iarna/toml library — the same library used by many Node.js tools — and reports every error with its line number. When the document is valid, it re-emits the parsed structure as pretty-printed JSON so you can inspect the exact data model and confirm the hierarchy is what you expected.
How to use
Paste your TOML
Drop a Cargo.toml, pyproject.toml or any other TOML document into the editor, or load a sample to see a quick before/after.
Review the result
A Valid badge with the parsed JSON means the document is well-formed. An Invalid badge shows the parser's line-aware error so you can fix it directly.
Copy the JSON
Click Copy to grab the re-emitted JSON, which reflects the exact data model your tool will consume.
Use cases
Validating Cargo.toml before a cargo build
Catch malformed dependency entries, bad version strings, or missing required fields before running the build.
Checking pyproject.toml for poetry or maturin
Confirm the [tool.poetry] or [build-system] section is valid so the package publishes cleanly.
Inspecting a TOML file's structure as JSON
Convert a TOML file to JSON to inspect the exact nested structure without running the tool that consumes it.
Common mistakes
Mistake:Using single quotes instead of double quotes for strings.
Fix:TOML requires double quotes for strings. Single quotes define literal strings only — they do not escape backslashes.
Mistake:Defining a table header twice.
Fix:TOML tables ([section]) cannot be redefined. Use [section.sub] for nested tables, not a second [section].
Mistake:Mixing dots in table headers with dotted keys.
Fix:TOML treats [a.b.c] and a = { b = { c = ... } } as equivalent. Mixing both styles in the same document creates a conflict.
Frequently asked questions
Related guides
TOML vs YAML vs JSON: Choosing the Right Config Format
Why Rust and Python both settled on TOML, what each format actually gives you, and how to validate your Cargo.toml without guessing.
Moving Configuration Between TOML, JSON and YAML: What Survives the Trip
Converting config formats sounds trivial until your dates vanish, your comments disappear, and your multiline string gets folded into one line.
References & standards
Related tools
TOML to JSON Converter
Convert TOML to JSON and JSON to TOML in either direction
JSON Lines Converter
Convert JSON Lines (NDJSON) to a JSON array and back
CSV to SQL Converter
Generate SQL INSERT statements from CSV data
JSON Schema Validator
Validate a JSON document against a JSON Schema
CSV to Markdown Converter
Convert CSV to a Markdown table and Markdown tables back to CSV
Find and Replace Text
Find and replace text with optional regex, case, and multiline matching