JSON to TOML

Convert JSON to TOML configuration format — strings, numbers, booleans, nested tables

JSON Input

TOML Output

[package]
name = "my-app"
version = "1.0.0"
edition = "2021"
description = "A sample app"
[profile]
[profile.release]
optLevel = 3
debug = false
strip = true
[dependencies]
serde = "1.0"
tokio = "1.28"
[features]
defaults = ["serde", "async"]

About the JSON to TOML Converter

This tool converts JSON to TOML, mapping nested objects to bracketed table headers and arrays of objects to arrays of tables. It is the quick path to a Cargo.toml, pyproject.toml or netlify.toml when the config you already have is JSON.

Convert JSON to TOML when the target ecosystem chose TOML. Rust uses Cargo.toml, modern Python packaging uses pyproject.toml, and Hugo, Netlify and plenty of Go tools read TOML config. If your settings currently live in JSON, they have to be rewritten to land there.

The mapping follows TOML's structure rather than producing something merely valid: nested objects become bracketed table headers, arrays of objects become arrays of tables, and strings, numbers, booleans and dates are written in their proper TOML forms rather than all quoted.

Keys needing quotes — those containing dots or spaces — are quoted automatically, which is the detail that most often makes hand-written TOML fail to parse. Conversion runs in your browser.

How to use the JSON to TOML Converter

  1. Paste your JSON. Provide the JSON object you want as TOML.
  2. Convert. Run the conversion to produce table headers, arrays and typed values.
  3. Review the tables. Check that nested sections landed under the table headers you expect.
  4. Copy or download. Copy the TOML or save it as a .toml file.

JSON to TOML Converter features

  • Syntax validation
  • Proper formatting
  • Data type preservation
  • Error highlighting
  • Large file support
  • Real-time conversion

Frequently asked questions

How are nested objects converted?

Into bracketed TOML table headers, so a nested section appears under its own [section] heading.

What happens to arrays of objects?

They become arrays of tables, written with double-bracket [[headers]] as TOML requires.

Are keys quoted when needed?

Yes. Keys containing dots or spaces are quoted automatically, which is a common cause of hand-written TOML failing to parse.

Are types preserved?

Yes. Numbers, booleans and dates are written in their TOML forms rather than all being quoted as strings.

Can I convert TOML back to JSON?

Yes. Use the TOML to JSON converter for the reverse direction.