ComfyToolkit

Data Converter

Convert between JSON, YAML, TOML and CSV.

Input
1
Output
1

JSON to TOML Converter

Turn a JSON document into TOML, the format used by pyproject.toml, Cargo.toml and a growing number of application configs.

This page opens with JSON as the input and TOML as the output.

Why TOML for config

TOML was designed to be obvious. There is no significant whitespace, types are explicit, and a value cannot silently become a boolean the way it can in YAML. For a config file a human edits and a machine parses, that predictability is usually worth more than YAML expressiveness.

It also has a real date and time type, which neither JSON nor most YAML consumers provide.

Nesting becomes tables

Nested JSON objects become bracketed table headers rather than indentation, so a deeply nested structure reads as a flat list of sections. This is clearer at two or three levels and less so beyond that - TOML is happiest with shallow config rather than deeply nested data.

{"tool":{"ruff":{"line-length":88}}}

[tool.ruff]
line-length = 88

Nulls have no home

TOML has no null. A JSON null cannot be represented and must be either omitted or given a sentinel value, so check what happened to any nullable field after converting.

Arrays of tables

A JSON array of objects becomes a repeated double-bracket section block rather than an inline list. That reads well for a handful of entries and becomes unwieldy past a dozen or so.

Where the data is genuinely a long list of records rather than configuration, TOML is the wrong destination and CSV or JSON is the better fit.

Open the full Data Converter