TOML Validator
Paste any TOML content below. Invalid documents report the exact line and column where parsing failed. Valid documents return a normalized structure you can inspect.
TOML Validator
Before you start
You need a TOML document—like a Cargo.toml, pyproject.toml, or a custom
config file—either saved on your computer or ready to paste from your editor. This validator
checks against the TOML 1.0.0 specification, which is the stable version used
by most modern package managers and tools.
I built this to be private by default. Your configuration data never leaves your browser; the validation logic runs entirely in your local JavaScript environment. This makes it safe to use even for files containing internal paths or environment keys that you wouldn't want to upload to a random server.
There is no hard limit on file size, but since the parser (smol-toml) needs to
load the content into a string, your browser might struggle with files over 50 MB. For
standard project configs, it should be near-instant.
How to use it
- Paste your TOML text into the left pane, or drag a
.tomlfile directly onto the input area. - Click the Validate button to trigger the parser.
- Check the right pane for the result. If the TOML is valid, you'll see a success message and a structural representation of the data.
- If there's a syntax error, look for the
Line N, Column Mmessage to find exactly where the parser got stuck. - Use Clear to reset both panes and start fresh with a new file.
Example
Input (with a syntax error):
[server]
port = 8080
name = "web-server"
tags = ["prod", "api" # Missing closing bracket
Output (Validation result):
Error: Unexpected end of input, expected ']' or ','
Line 4, column 21
Once fixed, the output will simply confirm Validation successful! along with the
parsed object structure for your inspection.
Tips & common pitfalls
- Duplicate keys are illegal. TOML doesn't allow you to define the same key twice in the same table. This tool will flag that as a hard error.
- Bare keys are restricted. Keys without quotes (like
my_key = 1) can only containA-Z,a-z,0-9, underscores, and dashes. Use quotes if you need spaces or special characters. - Values must be typed correctly. A version like
version = 1.2.0is invalid because it's not a valid float; it must be a string:version = "1.2.0". - Indentation is optional. Unlike YAML, TOML doesn't care about your leading whitespace, but it does care about the order of tables (
[table_name]).
Troubleshooting
The error says "Line 10" but the mistake looks like it's on Line 9.
Parsers often don't realize something is wrong until they hit the *next* token. If you're missing a closing quote or a bracket, the error might be reported at the start of the following line where the parser finally gave up looking for the end of the previous value.
The browser tab freezes when I paste my file.
This usually happens with massive files (thousands of lines) containing extremely long strings or deeply nested arrays. Try stripping out large binary-like data or breaking the file into smaller chunks to identify the offending section.
Related tools
See also: if you need to do something adjacent on this site, try JSON to TOML to convert JSON to TOML, TOML Formatter to pretty-print or normalise TOML, or TOML to JSON to convert TOML to JSON.
Frequently asked questions
Which TOML version does this validator support?
It supports TOML 1.0.0. This is the version used by the vast majority of the ecosystem, including pip, cargo, and poetry.
Does it check for logical errors (like missing Cargo keys)?
No. This is a syntax validator. It checks if your file is valid TOML, not if it's a valid pyproject.toml or Cargo.toml. It won't tell you if a required field for a specific tool is missing.
Why use this instead of just running my build tool?
Build tools often give generic "Failed to parse config" errors. This tool provides 1-indexed line and column numbers, making it much faster to hunt down a missing comma or a stray character in a large file.
Is my data being saved or logged?
Absolutely not. There is no backend for this tool. The processing happens in your browser's memory and is wiped the moment you close the tab or refresh the page.
Is there a CLI tool that does this?
Yes, I'm a big fan of taplo for the command line. It's great for CI/CD linting, whereas this web version is meant for quick, one-off debugging without installing anything.