JSON to TOML: from API response to config file
When you're scaffolding a new Rust crate, Python package, or CLI tool, you often start from a JSON example (an API response, a design doc) and need it as a real Cargo.toml or pyproject.toml.
This converter turns any JSON object into equivalent TOML: nested objects become tables, arrays of objects become arrays of tables ([[items]]).
What TOML cannot represent
TOML's type system is deliberately small, and two common JSON shapes have no TOML equivalent.
Why the converter refuses instead of guessing
Some TOML libraries silently drop null fields rather than erroring, which quietly changes your data. This tool checks for both cases first and tells you exactly which key is the problem, so nothing gets lost without you knowing.
Everything runs locally: it is safe to paste config values that include internal package names or private registry URLs.
Frequently asked questions
No. This direction has no way to tell an ISO-8601-looking string apart from any other string, so it's written out as a quoted TOML string, "2024-01-15T09:00:00Z", not the unquoted native date-time type TOML also supports. Both read back as the same value in most tools, but it isn't a byte-for-byte round trip of an original TOML file.