Free Online TOML Formatter and Validator, With a Table Tree
Paste a TOML file and find out what it really declares. The parsed result is shown as a tree of tables and keys, so the difference between a table and an array of tables is visible, and the file is written back out tidily or shown as JSON instead.
Enjoying WizTools123? Help keep our server infrastructure 100% free and open for everyone.
A Table, an Inline Table and an Array of Tables
Three things that look similar and are not.
A table is written [database] and every key after it, until the next
header, belongs to it. There can only be one [database] in a file; declaring
it twice is an error rather than a merge.
An inline table is written pool = { min = 2, max = 20 }. It means the
same thing as a table with those two keys, but it must fit on one line and it cannot be
added to later.
An array of tables is written [[server]], with two brackets, and each
repeat appends another table to the same array. Three [[server]] blocks give
you a list of three servers. This is the piece people get wrong, usually by writing one
bracket and then wondering why the second block overwrote the first, and it is the reason
the tree on this page exists.
How to Check and Format TOML
A few steps, and nothing is uploaded.
What to Know About TOML
Starting with the double brackets that confuse everyone.
[[server]] appends a table to a list called server, so writing the block twice gives you two servers. [server] with one bracket declares a single table, and writing it twice is an error. This is the single most confusing part of TOML, and the tree on this page shows which one your file produced.
# comment is not data, so there is nothing left to write back. Blank lines and your chosen key order go the same way. This is a reformatter and a checker, not a comment-preserving editor, so keep the original for a file that people maintain by hand.
2024-03-14 may come back with a time on it. The value is the same moment; the spelling is not necessarily the one you typed.
Key Features & Capabilities
What this tool does, and what it deliberately does not.
About the TOML Formatter
TOML was designed to be an obvious configuration format, and for flat files it is. It becomes less obvious the moment tables get involved: a single bracket declares a table, a double bracket appends to an array of tables, and an inline table with braces does the same job as a table header but cannot be extended. Reading a file and predicting the data structure it produces takes more care than the format admits.
So this page does two things at once. It validates and re-emits the file, with controls for key order, array layout and indentation, and it draws the parsed result as a tree of tables and keys. The tree is the useful half. It is built from the data the parser returned, which means it shows what your file declares rather than what the layout suggests it declares.
Parsing is done by a TOML parser in the page; the writing half was written here, because control over table order, inline arrays and indentation was needed and a generic serialiser does not give you that. What could not be built, and is said plainly on the page, is comment preservation: the parser discards comments, so a round trip through this tool drops them.
Frequently Asked Questions
Tables, arrays of tables, comments and dates.
Every Other Developer Tool
88 more tools in this set. All free, all in your browser.