JSON to TOML Converter Online — Free & Private

Paste JSON from APIs or exporters and preview TOML for Rust, Python and DevOps configs. Everything stays in your browser.

Loading…
JSON → TOML for Cargo and pyproject configuration
Writes validated JSON as TOML, with nested objects as tables, for Rust and Python configuration files.

Developer notes

The JSON must parse first. A syntax error stops the conversion and shows the message. The root must be an object or an array. An array is wrapped in an items key, because a TOML document needs a table at the root. Nested objects become tables, and arrays of objects become repeated [[tables]]. Sort TOML keys orders keys alphabetically at every level. Without it, keys keep the order of the JSON.

Use cases

Bootstrap a Cargo.toml from a JSON export. Move API configuration from JSON into a pyproject.toml fragment. Preview the TOML before you commit an edit.

About these options

For CSV output, choose the delimiter, how fields are quoted, the line endings and whether to write a header row. Auto uses a comma in English and a semicolon in French, German and Spanish, as Excel expects. For CSV input, the delimiter is detected on the first line (comma, semicolon, tab or pipe). You choose whether that line holds the column names. JSON output can use 2 or 4 spaces or a single line, with an optional recursive key sort. XML output can be pretty-printed with a chosen indent width. YAML output takes an indent width and a quoting mode for strings. XML comments are dropped, because the conversion goes through a JSON tree.

Examples

Package metadata

Input

{ "package": { "name": "fastminify", "version": "2.1.0", "edition": "2021", "authors": ["FastMinify Team"] }, "dependencies": { "serde": { "version": "1.0", "features": ["derive"] }, "tokio": "1.35" }, "features": { "default": ["cli"], "cli": [] } }

Output

[package] name = "fastminify" version = "2.1.0" edition = "2021" authors = [ "FastMinify Team" ] [dependencies] tokio = "1.35" [dependencies.serde] version = "1.0" features = [ "derive" ] [features] default = [ "cli" ] cli = []

Python project and tool tables

Input

{ "project": { "name": "fastminify-cli", "version": "2.1.0", "requires-python": ">=3.11", "dependencies": ["click>=8.1", "rich>=13.0"] }, "tool": { "pytest": { "ini_options": { "testpaths": ["tests"] } } } }

Output

[project] name = "fastminify-cli" version = "2.1.0" requires-python = ">=3.11" dependencies = [ "click>=8.1", "rich>=13.0" ] [tool.pytest.ini_options] testpaths = [ "tests" ]

Related tools

Validate the JSON first with the JSON validator, shrink TOML with the TOML minifier, or go back with TOML → JSON.

JSON → TOML FAQ

What the output looks like

Is the key order kept?

Yes. Keys keep the order of the JSON, unless you turn on Sort TOML keys.

Are comments written?

No. The TOML has no comments, so add them by hand after the conversion.

What happens to an array at the root?

It is wrapped in an items key, because a TOML document needs a table at the root.

Is my data sent to a server?

No. The conversion runs in your browser, and FastMinify never receives what you paste.

Convert JSON to YAML, XML, CSV, TOML, TSV, SQL, HTML, Properties and INI. Every converter runs in your browser.