JSON to TOML

Input
Output

JSON to TOML Converter

Turn JSON into TOML, the config format used by Rust's Cargo, Python's pyproject.toml and many tools, or switch direction to read TOML as JSON.

Example: writing a pyproject.toml

Python project settings kept as JSON, with nested tool settings and one null. Nested objects become [table] headers with dotted names, and the null is left out because TOML has no null:

Input

{
  "project": {
    "name": "bracely-tools",
    "version": "1.2.0",
    "requires-python": ">=3.10",
    "dependencies": [
      "httpx>=0.27",
      "pydantic>=2"
    ]
  },
  "tool": {
    "ruff": {
      "line-length": 100,
      "lint": {
        "select": [
          "E",
          "F"
        ]
      }
    }
  },
  "license": null
}

Output

[project]
name = "bracely-tools"
version = "1.2.0"
requires-python = ">=3.10"
dependencies = ["httpx>=0.27", "pydantic>=2"]

[tool.ruff]
line-length = 100

[tool.ruff.lint]
select = ["E", "F"]

How do I use the JSON to TOML?

  1. Paste JSON, or choose TOML → JSON and paste TOML.
  2. The result appears in the Output box.
  3. Copy it or save it as a file.

What does the JSON to TOML do?

  • Both directions
  • Tables and arrays of tables written properly
  • Opens .toml files directly

When to use the JSON to TOML

TOML is easier to read and edit by hand than JSON, which is why Cargo, pyproject.toml, Hugo and many tools use it for configuration. Convert JSON to TOML when you're moving settings from a JSON file or an API into one of those files, or generating config from code.

Nested objects become [table] headers with dotted names such as [tool.ruff.lint], simple arrays stay inline, and arrays of objects become [[table]] blocks. TOML has no null, so keys whose value is null are left out, and Bracely tells you how many. The top level has to be an object, because a TOML file is always a table.

Frequently asked questions

Why are some keys missing from the TOML?
Their value was null, and TOML has no null. The note under the output says how many were left out; give them a real value in the JSON if they must be in the file.
Why do I get "TOML needs an object at the top level"?
A TOML file is a table of keys, so it can't be a bare array or value. Wrap the data in an object, such as {"items": […]}.
What happens to null values?
TOML has no null, so keys with null values are left out.
Is my data uploaded?
No. Bracely runs entirely in your browser, so nothing you paste or open leaves your device.

More JSON tools

Bracely has 108 JSON tools in one page. Related ones:

Runs entirely in your browser. Nothing you paste is uploaded. Made by Saurabh Pagrut · About · Privacy policy
Last updated · Version 6.7 · Changelog
Saurabh Pagrut on GitHub · LinkedIn · X · YouTube · Instagram