Utilo

JSON to TOML Converter – Free, Online, Private

Write a JSON object as TOML. Nested objects become tables. Null is rejected because TOML has no null.

Input
Output

How to convert JSON to TOML

  1. Paste a JSON object. Arrays of objects become arrays of tables.
  2. Copy the TOML. Strings are quoted. Numbers and booleans are bare.
  3. Run it through the TOML to JSON page if you want to check the round trip.

Encoding rules

The root must be an object. Scalars are written first, then [tables] for nested objects, then [[arrays of tables]] for arrays of objects. Arrays of scalars or mixed values use inline square brackets. Strings use JSON string quoting, which is a valid TOML basic string for the characters this emits. Integers print without a decimal point. Floats print with JavaScript's default formatting. true and false are TOML booleans. Keys that are not bare identifiers are quoted.

Null and dates

TOML has no null. A JSON null throws rather than becoming a string, so you notice it. Delete the key or use an empty string before converting. Dates that are JSON strings stay strings. They are not rewritten as TOML datetimes, because a string and a datetime are different types and the page should not guess. An array of objects cannot also contain a scalar under the same key; that is illegal TOML and the converter will not emit a broken file.

Worked example

title, port and enabled are root keys. owner is a [owner] table with name inside. If tags were an array of strings it would be tags = ["math", "engines"] on one line. If tags were an array of objects, each object would be a [[tags]] table. The blank line between tables is for reading. A TOML parser does not need it. Round-tripping through the other page should return the same strings, numbers and booleans.

Use it for config, not for documents

TOML is a configuration format. A large JSON API payload with deeply mixed arrays is a poor TOML document even when the encoder succeeds. Prefer YAML or stay on JSON for those payloads. The encoder runs locally, so a config that includes a password can be reformatted without an upload.

Frequently asked questions

Why did null fail?

TOML cannot represent null. Remove the key or replace null with a value the format allows.

Can I convert an array at the root?

No. Wrap it in an object. TOML documents are tables.

Are keys reordered?

Scalars stay in JSON order, and tables follow them. That is a TOML style requirement, not an alphabetical sort.

Is the JSON uploaded?

No. TOML is built in the browser.