What this tool does
It checks whether a piece of TOML is syntactically valid and, when it is not, explains each problem. For every error you get the line and column, a few lines of the document around it with a marker under the exact position, a plain-language explanation, a suggested fix where one is clear, and a button that selects the line in the editor. When the document is valid you get a summary (keys, tables, arrays of tables, value types, nesting depth) and an outline of its tables.
You can choose TOML 1.0 (the default) or TOML 1.1. Large documents are checked in a background worker so the page stays responsive.
How to read the error report
- Line and column. This is where the parser could no longer continue. The mistake is usually on that line, but not always: an array missing its closing
]is only noticed at the next line, and an unterminated multi-line string is only noticed at the end of the file. - The lines around it. The marked line is shown with the lines before and after, with line numbers, so you can see the surroundings without scrolling the editor.
- Category. Each problem is labelled (key, string, number, date or time, array, inline table, table header, duplicate or conflicting definition, or syntax) to help you search for the right rule.
- How to fix and Suggestion. The fix text explains the rule that was broken. A suggested line is offered only for a few unambiguous cases, such as unquoted text, a capitalized boolean, a colon instead of an equals sign or a comma inside a number. It is never applied automatically.
- Several problems at once. The parser stops at the first error. To show more, this tool skips the broken line and checks the rest, up to 10 problems. Lines that were skipped are not checked, and a later problem can be a consequence of an earlier one (it is marked when that is likely). Fix from the top and check again.
TOML syntax in brief
# comment
title = "Example" # key = value
site.name = "demo" # dotted key
[server] # table
host = "localhost"
ports = [8080, 8081] # array
limits = { cpu = 2, mem = 512 } # inline table
[[routes]] # array of tables
path = "/health"
[[routes]]
path = "/items"- Keys are case-sensitive. A bare key may use letters, digits, underscores and hyphens; anything else needs quotes.
- One
key = valuepair per line. A#starts a comment outside a string. - Values are strings, integers, floats, booleans, dates and times, arrays or inline tables. There is no null.
Common errors and how to fix them
These messages come from the checker itself, so you can match what you see in the report.
| Broken TOML | Mistake | Message | How to fix |
|---|---|---|---|
host = localhost | Text without quotes | Expected a value (line 1, column 8) | Put a value after the equals sign. Text needs quotes (name = "demo"), and true and false must be lowercase. |
enabled = True | Capitalized boolean | Expected a value (line 1, column 11) | Put a value after the equals sign. Text needs quotes (name = "demo"), and true and false must be lowercase. |
name: "demo" | Colon instead of = | Expected '=' after the key (line 1, column 5) | Each line needs key = value. Quote keys that contain spaces or punctuation, for example "my key" = 1. |
a = 1
a = 2 | Duplicate key | Duplicate key "a" (line 2, column 1) | Each key can appear only once in a table. Remove or rename one of them, or put the values in an array. |
[server]
port = 1
[server]
host = "x" | Table defined twice | The table "server" is already defined (line 3, column 9) | A [table] header may appear only once. Move the keys under the first header, or use [[double brackets]] for a repeating list of tables. |
port = 08080 | Leading zero | Expected a valid number: leading zeros are not allowed (line 1, column 8) | Decimal numbers cannot start with 0. Use 0o17 for octal, 0x1F for hex, or quote the value as a string. |
path = "C:\users\me" | Backslash in a basic string | Invalid unicode escape (line 1, column 11) | In a double-quoted string write \\ for a backslash, or use a single-quoted literal string where backslashes need no escaping. Unicode escapes are \uXXXX or \UXXXXXXXX. |
when = 2024-13-01 | Impossible date | Invalid date (line 1, column 8) | Dates must be real calendar dates (YYYY-MM-DD) and times must be HH:MM:SS, with offsets like Z or +05:00. |
items = [1, 2 | Unclosed array | Expected ',' or ']' in an array (line 1, column 14) | Separate array items with commas and close the array with ]. |
t = { a = 1, } | Trailing comma in an inline table (TOML 1.0) | A trailing comma is not allowed in an inline table in TOML 1.0 (TOML 1.1 allows it) (line 1, column 14) | This uses syntax added in TOML 1.1. Switch “TOML version” to 1.1 if your tool supports it, or rewrite it in TOML 1.0 form. |
msg = "hello | Unterminated string | Unterminated string (line 1, column 13) | Close the string with a matching quote. Single-line strings must end on the same line; use triple quotes for multi-line text. |
price = 1,000 | Comma in a number | Expected the end of the line but found ',' (line 1, column 10) | Only one key = value pair is allowed per line. Put the next pair on its own line, or use an inline table {a = 1, b = 2}. |
a = 1 b = 2 | Two pairs on one line | Expected the end of the line but found 'b' (line 1, column 7) | Only one key = value pair is allowed per line. Put the next pair on its own line, or use an inline table {a = 1, b = 2}. |
[a.b
x = 1 | Unclosed table header | Expected ']' (line 1, column 5) | Close a table header with ] and an array-of-tables header with ]]. |
Tables and nesting
- A
[table]header may appear only once. Defining it again is an error. Use[[double brackets]]for a list of tables. - A parent table may be defined after its child (
[a.b]then[a]), but defining the same table twice, or a key and a table with the same name, is an error. - Dotted keys (
a.b = 1) and headers ([a]) can both create tables, but a table made one way cannot be reopened the other way where TOML forbids it. - An inline table is complete where it is written. You cannot add keys to it later with a header or a dotted key.
- Sub-tables of an array of tables belong to the most recent
[[entry]]:[entry.owner]after the second[[entry]]belongs to the second one. - In TOML 1.0 an inline table must stay on one line and cannot end with a comma. TOML 1.1 allows line breaks, comments and a trailing comma; choose version 1.1 to check that style.
Arrays
Items are separated by commas, may span several lines, and may be followed by a trailing comma. TOML 1.0 allows mixed types in one array. A missing comma or closing bracket is the usual error, and it is reported where the parser notices it, often the line after the real mistake.
Strings
| Kind | Written as | Escapes |
|---|---|---|
| Basic | "text" | Yes: \b \t \n \f \r \" \\ \uXXXX \UXXXXXXXX |
| Multi-line basic | """...""" | Yes, and a trailing backslash joins lines |
| Literal | 'text' | None: backslashes are kept as written |
| Multi-line literal | '''...''' | None |
Windows paths are the classic trap. "C:\users\me" is invalid because \u starts a Unicode escape, and "C:\temp" is valid but contains a tab. Use a literal string: 'C:\users\me'. TOML 1.1 adds the escapes \e and \xHH; in 1.0 they are errors.
Numbers, booleans and dates
- Integers may use
_between digits (1_000), a sign, and the prefixes0x,0oand0b. A decimal integer cannot start with 0 (08080is an error), and values must fit in a signed 64-bit integer. - Floats need digits on both sides of the dot (
0.5, not.5) and also allowinfandnan. Commas are not allowed in numbers. - Booleans are lowercase
trueandfalse. - Dates and times follow RFC 3339: offset date-time
1979-05-27T07:32:00Z, local date-time1979-05-27T07:32:00, local date1979-05-27and local time07:32:00. The date must exist (month 13 is an error). TOML 1.0 requires seconds; TOML 1.1 makes them optional. A time zone name such asAsia/Karachiis not allowed, only a numeric offset orZ.
Duplicate keys
A key may appear only once in a table, including keys created by dotted notation. a = 1 followed by a = 2 is an error at the second line. Quoted and bare forms of the same name (a and "a") are the same key. If you need several values, use an array, or an array of tables if each value has fields.
A validation workflow
- Paste the file, or open it with Open a .toml file. Nothing is uploaded.
- Read the first problem and its context. Fix it in your editor.
- Paste again, or edit here: the check runs as you type.
- When it is valid, review the summary and the structure outline to confirm the tables are what you intended.
- To inspect the actual values, convert the document with the TOML to JSON Converter, which uses the same parser.
- Check the content against the tool that reads the file (Cargo, pyproject, Hugo and so on). A valid TOML document can still be wrong for the program that uses it.
What this tool does not check
- Meaning. It checks syntax only. It does not know which keys
Cargo.toml,pyproject.tomlor any other program expects, and it does not validate values against a schema. - Style. It is not a formatter or style linter. It reports facts that matter for portability, such as use of TOML 1.1 syntax and integers that exceed JavaScript's exact range.
- Other parsers. The parser follows the TOML 1.0 specification and was compared with Python's built-in
tomllibduring development. Other libraries can differ on edge cases, and some accept invalid input, so run your real parser in CI as well.
Related configuration formats
Configuration often moves between formats. Check YAML with the YAML Validator, JSON with the JSON Validator, and structure against a schema with the JSON Schema Validator. Convert environment files with the .env ⇄ JSON Converter, and YAML with the YAML ⇄ JSON Converter.
Frequently asked questions
How do I validate a TOML file?
Paste it or open it with the file button. The result appears as you type, and the Validate button re-runs the check.
What does "line 3, column 8" mean?
It is the position where the parser stopped. Count lines from 1 and columns (characters) from 1. The marked line in the report shows the position.
Why do I get an error after fixing the first one?
The parser can only report problems it reaches. Fixing an early problem can reveal later ones, and some later problems are follow-on effects of an earlier one. Check again after each fix.
Is TOML 1.1 supported?
Yes, as an option: trailing commas and line breaks in inline tables, optional seconds in times, and the \e and \xHH escapes. Tools that implement only TOML 1.0 will reject them.
Does it upload my file?
No. It runs in your browser.
Privacy and local processing
This tool runs entirely in your browser. Your TOML is parsed by JavaScript on this page, or by a worker started from this page, and is not sent to a server. Nothing is stored.