Utilo

TOML to JSON Converter – Free, Online, Private

Parse a TOML document into JSON. Tables become objects and arrays of tables become arrays of objects.

Input
Output

How to convert TOML to JSON

  1. Paste TOML. Comments are ignored.
  2. Tables in brackets become nested objects.
  3. Copy the JSON. Dates are kept as strings.

Coverage

The reader accepts assignments, dotted keys, [tables], [[arrays of tables]], basic and literal strings, multiline basic strings, booleans, integers, floats, arrays and inline tables. Comments start at # outside a string. Integers may contain underscores. A datetime is returned as a string rather than a Date, so the JSON stays portable and you do not lose the original spelling to a timezone conversion. The root of TOML is always a table, so the JSON root is always an object.

What will fail

This is a practical subset, not a certification of the whole 1.0 spec. Quoted keys work. Exotic escapes and dotted keys inside arrays of tables can still trip the scanner; the error text names the value it could not read. Duplicate keys in one table overwrite. A file that uses the older implicit table style is accepted when each [header] appears before its keys. If you need a fully conforming parser for a Cargo.toml with every extension, use a language library in CI. This page is for the config you want to see as JSON right now.

Worked example

The sample sets title, port and enabled at the root, then an [owner] table with a name. The JSON is { title, port: 8080, enabled: true, owner: { name } }. port is a number because the scalar was an integer. enabled is a boolean. Add [[tags]] sections and the JSON gains a tags array of objects. The reverse page, JSON to TOML, prints tables in an order a TOML reader accepts: scalars first, then child tables.

Local configs

TOML files often hold registry tokens and database URLs. Parsing them in the browser means the token is not posted to a formatter. Clear the box when you are done on a shared machine. The page does not write back to disk.

Frequently asked questions

Are comments preserved?

No. JSON has nowhere to put them. They are skipped while parsing.

How are arrays of tables shown?

Each [[name]] header appends one object to the name array.

Can the root be an array?

No. TOML's root is a table, so the JSON root is an object.

Is the file uploaded?

No. The parser runs locally.