Skip to content

Developers

JSON TOML Converter

JSON TOML Converter

Beta

Convert a JSON object to TOML 1.0 or TOML back to JSON in your browser. Tables, arrays of tables and inline arrays handled; nulls dropped or emptied, your choice.

  • Free, no sign-up
  • Updated
  • Reviewed by Olgun Ozoktas

The config text is converted in your browser and is not uploaded to FindUtils. Analytics and ads may load on the page.

JSON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
TOML

The TOML will appear here..

How to convert JSON to TOML

  1. Paste or upload the JSON

    The root must be an object, because a TOML document is a table. The sample is a Cargo-like project with a nested dependency table and two [[servers]] entries.
  2. Decide what a null becomes

    TOML cannot express null. Drop leaves the key out; Empty string writes "". Either way the changed keys are listed under Notes, so nothing disappears unnoticed.
  3. Optionally sort the keys

    Sort keys orders every table alphabetically, which is useful when the JSON came from a map with random order and the TOML will be checked in.
  4. Copy or download

    Copy the TOML or download converted.toml. Switch the direction to parse TOML back to JSON; the current output moves into the input so you can check a round-trip.

Common Use Cases

Generating Cargo.toml or pyproject.toml

A script builds the project metadata as JSON; the converter writes the TOML that Cargo, Poetry, uv or Hatch expects, with dependency tables in place.

Static site configs

Hugo, Zola and similar generators read TOML. Convert a settings object from a CMS export or a JSON template into config.toml.

Reading a TOML file as data

Paste a TOML config to see it as JSON, search it, or feed it to a tool that only reads JSON. Datetimes become ISO strings.

Checking a hand-written TOML

A parse error reports the line and column, which is faster than a failing build for spotting a missing quote or a bad table header.

Why convert JSON to TOML in the browser?

Cargo.toml, pyproject.toml, Hugo and Zola configs, and a growing set of tool configs are TOML, and the data that feeds them usually arrives as JSON from a script or an API. Rewriting nested JSON into [tables] and [[arrays of tables]] by hand is slow and easy to get wrong, and the alternative is installing a CLI for a one-off job. This page converts both ways in the tab with a TOML 1.0 library. Objects become tables, arrays of objects become arrays of tables, scalar arrays stay inline. TOML has no null, so you choose whether a null key is dropped or written as an empty string, and the page lists the keys it changed.

TOML is the config format that Rust, modern Python packaging and several static site generators settled on: readable, typed, and strict about what a table is. JSON is the format every script and API speaks. FindUtils' JSON TOML Converter moves data between the two in the browser using a TOML 1.0 parser and writer, so tables, dotted keys, arrays of tables, inline tables, integers, floats, booleans and datetimes are all handled by the library rather than by string replacement.

The two directions are not perfectly symmetric, and the page says so instead of hiding it. JSON has null and TOML does not, so a null is either dropped or written as an empty string and the affected keys are listed. TOML has datetimes and JSON does not, so a TOML datetime becomes an ISO string in JSON, and a JSON string that happens to look like a date stays a string on the way back. A null-free object round-trips exactly.

The page sits beside the JSON YAML Converter, the Env JSON Converter and the Properties JSON Converter, which share the same two-pane layout. Use the JSON Formatter to tidy the JSON first if it came out of a log.

How it compares

Most online JSON-to-TOML converters are thin wrappers around a server call, and several implement TOML 0.4 or 0.5, which means inline tables, multi-line strings and some datetime forms fail. This page uses a TOML 1.0 implementation and runs in the browser, so the config text stays on your machine and the output is what current Cargo and pyproject readers accept.

Compared with a CLI such as yj or remarshal, the page needs no install and shows a parse error with a line and column. It is not a schema checker: it will happily write a Cargo.toml with a misspelled section, because TOML does not know what Cargo expects.

TOML Conversion Tips

  • TOML has no null. Choose Drop when the consumer treats a missing key as unset, and Empty string when it needs the key to exist.
  • An array of objects becomes [[name]] tables, one per element. An array that mixes objects and scalars is still valid TOML 1.0 and is written inline.
  • A JSON string that looks like a date stays a quoted string. TOML datetimes are a distinct type, and the converter does not guess.
  • Keys with dots, spaces or symbols are quoted automatically, so "my.key" survives as one key rather than becoming a nested table.
  • TOML to JSON turns a local date such as 1979-05-27 into the string "1979-05-27", not a UTC timestamp, so no timezone is invented.

Frequently Asked Questions

What happens to null values?

TOML has no null. With Nulls set to Drop, the key is left out; with Empty string, it is written as "". The keys that changed are listed under Notes either way, including nulls inside arrays.

Why does it say the JSON root must be an object?

A TOML document is a table of keys, so a JSON array or a bare value has nowhere to go. Wrap the array in an object, for example {"items": [...]}, and it becomes an inline array or an array of tables.

How are arrays of objects written?

As arrays of tables: each element becomes a [[name]] block in order. Arrays of scalars stay inline, such as ports = [ 8000, 8001 ]. A mixed array is written inline, which TOML 1.0 allows.

Are dates converted?

TOML to JSON turns a TOML datetime into an ISO string, keeping a local date as a date and a local time as a time rather than inventing a timezone. JSON to TOML leaves every string as a string, even one that looks like a date, because guessing would change the type silently.

Is the conversion lossless?

For a null-free JSON object, yes: converting to TOML and back returns the same data. Nulls and datetimes are the two places the formats differ, and the page reports what it changed.

Which TOML version is supported?

TOML 1.0, including inline tables, dotted keys, multi-line strings, and all four datetime forms. Older converters that stop at 0.4 or 0.5 reject some of these.

Is my config uploaded?

No. Parsing and writing happen in your browser, and no request carries the text. Third-party analytics and ads may load on the page, as on the rest of the site.

Can it validate a Cargo.toml or pyproject.toml?

It validates TOML syntax and reports the line and column of an error. It does not know the schema of any particular tool, so a valid TOML file with a misspelled section still passes. Use the tool's own commands for that.

What does Sort keys do?

It orders keys alphabetically in every table before writing TOML. Leave it off to keep the input order, which is what you usually want when the JSON was written by hand.

Is there a REST or MCP version?

Not yet. The page is browser-only. The JSON YAML Converter has both surfaces; extending them to TOML is a separate decision.

Rate This Tool

0/1000

Get Weekly Tools

Suggest a Tool