JSON to TOML Converter

Convert JSON into clean TOML config syntax.

Free JSON to TOML converter that turns JSON objects into clean TOML with tables, arrays of tables and inline arrays. Runs entirely in your browser — nothing is uploaded. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

How are nested objects and arrays converted?

Nested objects become [table] headers using dotted paths, and arrays of objects become [[array of tables]] entries. Arrays of scalars are written inline, e.g. tags = ["fast", "free"].

Convert JSON to TOML in your browser

TOML is the config format behind Cargo.toml, pyproject.toml and many other tools, but data often arrives as JSON. This converter turns a valid JSON object into clean TOML that targets the TOML v1.0.0 syntax, so you can paste it straight into a config file.

How it works

The converter maps each JSON construct to its TOML equivalent:

JSONTOML
nested object[table] header with dotted path
array of objects[[array of tables]] entries
array of scalarsinline array, e.g. tags = ["a", "b"]
stringbasic-string quoting with escapes
number / booleanwritten as-is
nullempty string (TOML has no null)

Keys that are not bare-key safe (containing spaces or special characters) are quoted automatically. TOML requires an object at the top level, so the input must be a JSON object.

Example

This JSON:

{ "name": "demo", "deps": { "serde": "1.0" }, "tags": ["fast", "free"] }

becomes:

name = "demo"
tags = ["fast", "free"]

[deps]
serde = "1.0"

The scalar array stayed inline, and the nested deps object became a [deps] table. The conversion happens entirely in your browser — your config is never uploaded or stored.

How TOML compares to JSON for config

TOML was designed specifically for configuration files, with human readability as a first-class concern. The key differences from JSON that matter for config:

  • No quotes around keys. name = "demo" instead of "name": "demo" — less visual noise.
  • Comments. TOML allows # ... comments on any line; JSON does not. This is the biggest practical difference for hand-edited config files.
  • Tables and arrays of tables are syntactically distinct from inline objects and arrays. [server] followed by host = "localhost" is clearer than a nested JSON object for configuration blocks.
  • Dates and times are first-class types. date = 2026-01-15 is a native TOML date value, not a string — handy for release dates, expiry times, and scheduling config.

Common use cases for this converter

  • Migrating a JSON config to a Rust project. Cargo.toml uses TOML; if your settings are currently in config.json, convert here first.
  • Setting up a pyproject.toml. Python packaging moved from setup.py to pyproject.toml — converting your existing JSON tooling config is a quick starting point.
  • Hugo static site config. Hugo accepts hugo.toml in addition to YAML; converting from a JSON config file is straightforward here.
  • Translating API responses to local config. Some APIs return configuration as JSON; if your runtime reads TOML, convert once and edit as needed.