Convert JSON to TOML

Convert JSON into TOML with proper tables and array tables, ready for configuration files like Cargo.toml and pyproject.toml.

Drop your file here, or browse

Images, documents, spreadsheets, data files and subtitles. Your file stays on your device.

Your file is converted on this device and is never uploaded to a server.

Why TOML for configuration

TOML was designed to be an obvious, minimal config format: key = value pairs, [sections] for groups and comments with #. Rust's Cargo, Python's pyproject.toml, Hugo, Netlify and many other tools use it.

This converter maps JSON objects to TOML tables and arrays of objects to array tables, keeps your key order and writes values with correct quoting. Because TOML has no null, null values are left out rather than producing an invalid file.

JSON vs TOML at a glance

Main differences between the JSON and TOML formats
FeatureJSONTOML
Full nameJavaScript Object NotationTom's Obvious, Minimal Language
TypeHierarchical dataConfiguration data
IntroducedEarly 2000s (RFC 4627 in 2006)2013
Created byDouglas Crockford; now ECMA-404 and RFC 8259Tom Preston-Werner
StructureNested objects and arraysKey/value pairs grouped into [tables]
CommentsNoYes, with #
Data typesString, number, boolean, null, object, arrayString, integer, float, boolean, date-time, array, table; no null
Best forAPIs, web apps and app settingsProject config such as Cargo.toml and pyproject.toml
SupportEvery programming languageRust, Python, Go and most languages via libraries
MIME typeapplication/jsonapplication/toml

How to convert JSON to TOML

  1. Step 1: Select a JSON file

    Drop the .json config or data file onto the converter.

  2. Step 2: TOML is preselected

    Leave TOML as the output.

  3. Step 3: Convert

    Objects become tables, arrays become TOML arrays, and nulls are removed.

  4. Step 4: Download the .toml file

    Add comments and drop it into your project.

How JSON maps to TOML

Tables

Nested objects become [section] and [section.sub] tables.

Array tables

Arrays of objects become [[section]] blocks.

Null handling

Null values are removed because TOML cannot represent them.

Top-level arrays

A JSON array is wrapped under an items key, since TOML needs a table at the root.

Where JSON to TOML is handy

  • Rust projects. Draft Cargo.toml sections from JSON data.

  • Python packaging. Move settings into pyproject.toml.

  • Static site generators. Hugo and Zola read TOML configuration.

  • Readable app settings. Give users a config file with comments.

Things TOML cannot express

TOML has no null value, so keys with null are dropped. Arrays in TOML 1.0 may mix types, but some older parsers reject mixed arrays, so keep arrays uniform if your tool is strict.

JSON has no date type, so dates in your JSON are written as quoted strings. If your tool expects real TOML dates, remove the quotes around them after converting.

  • "timeout": null is removed.
  • "started": "2026-09-17" stays a quoted string.
  • [1, 2, 3] stays an inline array.

Reading the output

Simple values at the top level appear first, followed by tables. Nested objects are written as dotted table headers such as [server.tls], which is standard TOML.

Keys that contain spaces, dots or other special characters are quoted so the file parses correctly.

Tips for JSON to TOML

  • Replace null values with sensible defaults before converting if the keys must exist.
  • Check the output with the tool that will read it; each tool has its own expected keys.
  • Add comments above tables to explain settings.
  • Use TOML to JSON to verify the round trip.

JSON to TOML questions

What happens to null values?

They are removed, because TOML has no null type.

Can the JSON root be an array?

Yes. It is wrapped under an items key, because a TOML document must be a table.

How are arrays of objects written?

As array tables using double brackets, like [[items]].

Is key order preserved?

Yes, within the rules of TOML, where simple values come before tables.

Which TOML version is produced?

TOML 1.0, written with the smol-toml library.

Is my file uploaded?

No. The conversion happens in your browser.

Related conversions