JSON to TOML Converter

Convert JSON to TOML format

Input JSON

Converted TOML

Paste your JSON on the left and the TOML shows up here.

Or drop a file on this box, , or .

What is JSON to TOML Converter?

TOML (Tom's Obvious, Minimal Language) is what Cargo, pip and a growing list of command-line tools read their settings from, while the data you already have is usually JSON from an API response or an older config file. Paste the JSON on the left and the TOML version builds as you type, with tables, arrays of tables, and comment lines for anything TOML has no way to say.

JSON's value types (see MDN's JSON reference) are objects, arrays, strings, numbers, booleans and null; TOML has all of those except null. A nested object becomes a [table] header, and a list of objects becomes repeated [[bin]] blocks, the shape Cargo.toml uses for binaries and pyproject.toml uses for package sources. Integers past JavaScript's 2^53 limit keep every digit. What TOML can't hold is reported rather than hidden: a null member is dropped and named in a # Left out 1 null value(s) header line, and an integer wider than 64 bits is written as a quoted string with its own note.

The conversion runs inside this page, so a config you paste, tokens and passwords included, is not sent anywhere.

What Makes This Tool Different

Automatic Conversion

Paste JSON and the TOML appears as you type. Quoting, brackets and commas all follow TOML rules, not JSON ones.

Structure Preservation

A nested object turns into a TOML table, and a list of objects is written as an [[array of tables]] block. Strings, numbers and booleans keep their types; a JSON string of digits stays a quoted string. Nulls are the exception: TOML can't store them, so they're left out and listed.

Validation Built-In

There is no separate validate step. The JSON is parsed on every edit, and when that fails the output empties and a red notice shows the parser's own message, such as "Expected double-quoted property name" for a trailing comma.

File Upload Support

Got a big file? Just upload it. Works great for converting those massive JSON configs or API responses without copy-pasting.

Download TOML

One click to download your TOML file. Drop it into your project, use it in Cargo.toml, pyproject.toml, or any TOML-based config.

Syntax Highlighting

The input editor highlights JSON and the output highlights TOML, so table headers, keys and quoted strings get different colours and a header in the wrong place is easy to spot before you copy.

How It Works

1

Paste or Upload JSON

Paste JSON into the left editor or load a .json file with "Upload". The top level has to be an object. "Sample" fills in a config modelled on the example from the TOML project README: an owner table, a database section and a list of ports.

2

Automatic Conversion

The TOML appears on the right as you type. Tables and arrays of tables follow your JSON nesting, and a comment at the top lists any null values that had to be left out.

3

Download or Copy

"Download" saves the result as converted.toml, so rename it to Cargo.toml or pyproject.toml if that is where it is headed. "Copy" puts the same text on the clipboard for pasting into an existing file.

When You'd Actually Use This

Rust Projects

Convert JSON configs to TOML for Cargo.toml files. TOML is the standard format for Rust project configuration, and this tool makes it easy to convert JSON data into TOML format.

Python Projects

pyproject.toml is where Poetry, Hatch, Ruff and Black look for their settings. If a project still keeps tool options in a JSON file, convert them here and paste the result under the matching [tool.name] table.

Config File Migration

Moving an app from config.json to config.toml? Paste the old file, read the comment lines at the top for nulls that had to go, and decide what each of those settings should become before you commit the new file.

Tool Compatibility

Some tools require TOML format. Convert your JSON data to TOML when working with tools like Cargo, Poetry, or other TOML-based systems.

Common Questions

Is my JSON data stored?

No. Parsing and TOML output both happen inside this page with no request to a server, and the page keeps no copy; Clear empties both editors.

What JSON formats work?

Any valid JSON whose top level is an object, since TOML requires a table at the root. Paste [1, 2] and you get "The top level is a list. TOML needs a table at the top level, so wrap the list in a key". Below the top, nested objects, arrays of objects and Unicode strings all convert.

How are nested objects handled?

Each nested object is written as a TOML table ([database]), while a list of objects is written as an array of tables ([[servers]]). Strings, numbers and booleans keep their types. TOML has no null, so "license": null is dropped and a # Left out 1 null value(s), because TOML has no null: license line names it; a null inside an array gives an error, and a top-level array or null gets a friendly message because TOML needs a table at the top.

Can I convert TOML back to JSON?

Yep. Use our TOML to JSON converter to convert TOML files back to JSON format.

What if my JSON has special characters?

Special characters are properly handled in TOML. Strings with quotes or other TOML syntax characters are escaped correctly.

Does it work with large datasets?

This page sets no size limit, and it reconverts on every keystroke without waiting for you to pause. A few hundred KB of config is fine on a laptop; with multi-megabyte files, paste the finished JSON in one go rather than editing it in place, or typing may lag.

Other JSON Tools You Might Need

Going back from TOML, or need the same settings as YAML for a CI file? These pages pick up where this one stops: