JSON to TOML Converter

Turn JSON into TOML for Cargo, pyproject and other config files.

Processed on your device. Files are not uploaded

How to convert JSON to TOML

  1. Paste your JSON

    Paste or type it into the box, or press Try an example.

  2. Check the result

    Objects become tables and lists of objects become arrays of tables.

  3. Copy or download

    Save the output as a .toml file, such as config.toml.

Worked example

This is what JSON to TOML Converter gives for its own sample values. Open the tool above and change anything to try your own.

JSON

{
  "name": "sarva-tools",
  "version": "1.2.0",
  "private": true,
  "author": { "name": "Ada", "email": "ada@example.com" },
  "keywords": ["tools", "developer"],
  "scripts": { "build": "next build", "test": "vitest run" }
}

TOML

name = "sarva-tools"
version = "1.2.0"
private = true
keywords = ["tools", "developer"]

[author]
name = "Ada"
email = "ada@example.com"

[scripts]
build = "next build"
test = "vitest run"

About JSON to TOML Converter

Turn JSON into TOML for Cargo.toml, pyproject.toml and other config files. Nested objects become [tables], and lists of objects become [[arrays of tables]].

FAQs

Why does it fail on null?

TOML has no null value. Remove the key or give it a value.

Does the top level have to be an object?

Yes. TOML documents are made of key and value pairs.

Can I convert TOML back?

Use TOML to JSON Converter.

Related tools