TOML Validator
Validate TOML and re-emit it as clean, indented JSON
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 this tool
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
What does the validator actually do with my TOML?
It parses the document using @iarna/toml and, if it is well-formed, re-emits it as pretty-printed JSON so you can inspect the exact structure. If the document is invalid, it reports the parser's line-aware error message.
Does it support TOML arrays of tables?
Yes. [[array_of_tables]] is parsed correctly and re-emitted as a JSON array of objects, matching the TOML spec v1.0.0.
Can I use it to convert TOML to JSON without validating?
Yes. A Valid badge means the document passed validation; clicking Copy or Download captures the pretty-printed JSON regardless of whether you arrived via the Validate or Convert path.
Is my TOML uploaded anywhere?
No. Parsing and JSON re-emission run entirely in your browser; the input is never transmitted or stored.
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
Base64 Toolbox
Professional Base64 workspace for text, files and images with Base64URL, MIME, Data URI, strict validation, image preview and ready-to-use snippets.
C# to VB.NET Converter
Convert a subset of C# — classes, methods, variables, loops — into VB.NET
CSV Data Viewer
Paste CSV and browse rows in a sortable table with delimiter detection
CSV to Chart
Paste or upload CSV data and generate bar, line, pie, or doughnut charts. Export as PNG.
CSV to JSON Converter
Paste CSV data and convert it to pretty-printed JSON instantly — supports custom delimiters, header row toggling, and value trimming.
CSV to Markdown Converter
Convert CSV to a Markdown table and Markdown tables back to CSV