Format and validate TOML — the config format of Cargo.toml, pyproject.toml and many modern tools — or convert it to JSON and back, all locally in your browser.
The parser covers tables, arrays of tables, dotted and quoted keys, every scalar type (multiline strings included), and multiline arrays. Duplicate keys and tables are rejected with the exact line number; unquoted strings — the classic habit carried over from YAML — are flagged with a hint.
Frequently asked questions
Why is my date not a string in the output?
RFC 3339 date-times are legal TOML scalars; they are kept as their original text, so JSON conversion yields strings that a date library can parse.
How are arrays of tables formatted?
Every item of an object array is re-emitted as its own [[header]] section — the canonical TOML way; scalar arrays stay inline.
Can it parse Cargo.toml?
Yes — workspace members, dependency tables and [[bin]] sections are all within the supported subset. Very exotic constructs may still be reported as errors rather than guessed at.
中文说明
格式化并校验 TOML——Cargo.toml、pyproject.toml 等现代工具的配置格式——也可与 JSON 双向互转,全部在浏览器本地完成。
解析器覆盖表、数组表、点分与带引号的键、全部标量类型(含多行字符串)以及跨行数组。重复的键与表会带精确行号报错;未加引号的字符串——从 YAML 带来的经典习惯——会附带提示地报错。
常见问题
为什么日期在输出里不是特殊类型?
RFC 3339 日期时间本身就是合法的 TOML 标量;解析后保留原文,转 JSON 时就是可直接交给日期库解析的字符串。
数组表是怎么格式化的?
对象数组的每个元素都会重新输出为独立的 [[表头]] 小节——这是 TOML 的规范写法;标量数组则保持行内形式。
能解析 Cargo.toml 吗?
可以——workspace 的 members、依赖表和 [[bin]] 小节都在支持范围内。极少数冷门语法仍会明确报错,而不是猜测着解析。