Convert JSON to readable TOML
Objects become tables, arrays of objects become array-tables. Perfect for pyproject.toml, Cargo.toml, and any TOML-configured tool.
title = "TryDevTools" [owner] name = "Ada" since = 2024 [db] host = "localhost" port = 5432 tls = true [[servers]] name = "alpha" ip = "10.0.0.1" [[servers]] name = "beta" ip = "10.0.0.2"
How to convert JSON to TOML
TOML is the config format of choice for modern Python (pyproject.toml), Rust (Cargo.toml), and many CLI tools. This converter maps JSON cleanly to TOML's table and array-table syntax.
- 01
Paste a JSON object
Top-level must be an object — TOML doesn't allow array roots.
Inputs parse through the native
JSON.parsereviver chain — strict RFC 8259. Any syntax error returns line and column for the exact offending byte.root: objectRFC 8259JSON.parsestrictliveinput · raw.json · RFC 8259{"title":"Demo"}loaded · parsed RFC 8259RFC 8259 · ready - 02
Nested → tables
Each nested object becomes a
[table]header. Arrays of objects become[[array-table]]sections.Indent options run through
JSON.stringify(value, null, n); the second argument lets you sort, transform, or omit keys via a replacer if you ever wire one in.[table][[array]]indentJSON.stringifyliveoutput · options.toml · livetitle = "Demo" [db] host = "localhost"
options applied · livelive - 03
Inline tables for mixed shapes
Arrays of mixed types (or non-object arrays) become inline values. Strings escape per JSON, keys quote when non-bare.
Large documents stream through a
useMemowith stable hashing so options re-apply instantly — no full re-parse if only formatting changes.inlinesafe-quotingmemoisedinstantdiff-friendlyinline · renderedvalues · readytags = ["a","b"]
rendered · livediff-friendly - 04
Copy or download .toml
Drop into your project. Works with all major TOML parsers.
Download is a
Blobwithapplication/json; copy uses the Async Clipboard API. Both round-trip identically to what the page rendered.pyprojectCargoclipboardblob.jsonexport · copiedready · done✓ Copied ✓ Saved
shipped · ready to shipsuccess
Production-grade JSON, the right way
Stick to RFC 8259
Strict JSON has no NaN, Infinity, comments, or trailing commas. If you need those, look at JSON5 or JSON Repair.
Preserve key order for diffs
JavaScript preserves insertion order, but two parsers shouldn’t be assumed equal. Use Sort JSON Keys before diffing or hashing.
Big integers lose precision
JS numbers lose precision past 2^53−1. Transport large IDs as strings or use BigInt.
Escape inside HTML
When inlining JSON inside <script>, escape </ to <\/ so HTML parsing doesn’t close your tag early.
Validate at boundaries
Trust the wire as little as possible. Run incoming JSON through a schema (Zod / Pydantic) before it touches business logic.
Minify in production
Minify removes whitespace; gzip removes redundancy. Together they typically shrink JSON payloads 70–85% over the wire.
When to convert JSON to TOML
Anywhere modern config tooling expects TOML.
pyproject.toml
Python projects (Poetry, PDM, hatch, uv, ruff, mypy) configure via TOML. Output round-trips losslessly through JSON.parse + JSON.stringify, so the file you save is byte-identical to what you see. Streaming parsers, jq pipelines, and Postgres jsonb columns all accept the result without complaint.
10× faster to scanCargo.toml
Rust crate manifests are TOML. Pairs perfectly with sort-keys + diff for review-friendly fixtures in CI. Whitespace-only churn disappears and reviewers see real changes, which keeps PR comments focused on logic rather than indentation.
cleaner PR diffsCLI config
Many CLI tools (ripgrep, starship, helix) take TOML configs.
Static site config
Hugo and Zola sites use TOML for site config.
round-trip safePlugin manifests
Editor and CLI plugin systems often standardize on TOML.
schema-friendlyMigrating from JSON
Moving a project's config from JSON to TOML for human-friendliness. Output is byte-stable: same input plus same options always produces identical bytes, ideal for content-addressed caches and snapshot tests. Downloads ship with the application/json MIME so editors apply syntax highlighting.
production-readyFrequently asked questions
Something missing?
Tell us what you need. We ship the top requests every two weeks.