Skip to main content

JSON ⇄ TOML Converter

JSON / Data

TOML became the default config format for good reasons: comments, multi-line strings, no quote soup. But data still travels as JSON. This page translates both ways — handy for turning an API response into a starter `pyproject.toml`, or for loading a `Cargo.toml` into a script — and reports parse errors with the offending line instead of a generic failure.

Loading tool…

How to use

4 steps
  1. 01

    Pick a direction; conversion happens as you type, no button needed.

  2. 02

    Nested objects become `[section]` headers, arrays of objects become `[[array tables]]`.

  3. 03

    On a parse error, the message points at the line and character to fix.

  4. 04

    Copy the result or download it as `.toml` / `.json`.

Technical Notes & Guide

1

What gets lost in translation

TOML has no `null`, so JSON nulls are dropped. Date-time strings stay strings rather than becoming TOML datetime values, and integers beyond 2^53 have already lost precision in JavaScript before conversion starts. For round-trip fidelity, keep TOML as the human-edited layer and JSON as the wire format.

FAQ

2 questions
Q1Why does my JSON fail to convert?

Usually one of two things: the top level is an array (TOML requires a table), or an array mixes `null` with other types. Wrap the structure in an object and remove nulls.

Q2Does it support all of TOML 1.0?

Parsing uses smol-toml, which covers tables, array tables, inline tables, multi-line strings, hex numbers and datetimes. A few edge cases may differ from a native parser.

JSON / Data