TOML ↔ JSON Converter
Convert
TOML and JSON encode the same hierarchical config data with very different syntax. This converter walks both directions: paste a `Cargo.toml` or `pyproject.toml` to get the JSON shape your linter or generator expects, or feed a JSON config and get the TOML version that ships with Rust/Python tooling. Handles the parts of TOML that actually appear in the wild — top-level tables `[a.b]`, array-of-tables `[[a.b]]`, inline tables `{ k = v }`, inline arrays, basic strings, integers, floats with underscore separators, booleans, ISO dates and datetimes.
How to use
- Pick a direction. `TOML → JSON` parses your TOML into a JSON object; `JSON → TOML` does the reverse.
- Paste the source. Errors point to the line / character that broke parsing.
- Copy the result. The TOML output groups scalars first, then `[table]` sections, then `[[array.of.tables]]` blocks — the order most linters expect.
Frequently asked questions
- Does it cover the full TOML spec?
- It handles tables, dotted keys, inline tables, inline arrays, multi-line arrays, basic strings, multi-line basic strings, literal strings, integers with `_` separators, floats, booleans, RFC 3339 datetimes, and array-of-tables. Less common features (offset datetime arithmetic, escape sequence edge cases, very deeply nested mixed values) round-trip but may need a hand-edit.
- Why does JSON → TOML reorder my keys?
- TOML requires scalars to come before any `[table]` block within a section, because once `[table]` opens the next set of keys belongs to it. The serializer rearranges scalars first so the output parses back correctly — your top-level field meaning doesn't change.
Related tools
CSS Unit Converter
Convert between px, rem, em, pt, vw, vh, and % using your own base font size and viewport.
JSON ↔ YAML Converter
Convert JSON to YAML or YAML to JSON — pick the indent and copy the result.
Data Size Converter
Convert between bytes, KB, MB, GB, TB — in decimal (1000) or binary (1024).
Roman Numeral Converter
Convert between Arabic numbers and Roman numerals from 1 to 3999.
Number Base Converter
Convert numbers between binary, octal, decimal, and hexadecimal.
Unit Converter
Convert length, weight, temperature, area, volume, speed, and time.