Skip to content
Jellykit

TOML to JSON Converter

Convert TOML to JSON and JSON to TOML, with the line and column of any syntax error and 64-bit integers kept exact.

  • Runs on your device
Loading tool

About TOML to JSON Converter

Turn a Cargo.toml, a pyproject.toml, a Hugo or Netlify config or any other TOML file into JSON for a script or an API, or write JSON out as TOML that is easier to read and edit by hand. The swap button reverses the direction, and a syntax error is reported with its line, column and reason instead of a blank result.

Values are read by the TOML 1.0 rules. Integers too long for a JavaScript number keep every digit, dates and times become ISO 8601 text, and anything one format can hold but the other cannot, such as nan, inf or a JSON null, is pointed out rather than changed in silence.

How it works

  1. TOML is parsed by the TOML 1.0 rules, so redefined keys, mixed tables and badly formed values are errors, reported with their line and column.
  2. Tables become JSON objects and arrays of tables become lists of objects. Integers beyond 2^53 are written with every digit instead of being rounded.
  3. Dates and times become ISO 8601 text in the form they were written: an offset date-time keeps its offset, a local date stays a date. nan and inf become the text "nan" and "inf".
  4. Converting JSON to TOML needs an object at the top. Null values are left out, because TOML has no null, and the result says how many.

Questions

Are comments kept?

No. JSON has no comments, and the TOML is rebuilt from the data, so comments are lost in either direction. The result says so when the TOML had comment lines.

Why are my dates strings in the JSON?

JSON has no date type, so dates and times are written as ISO 8601 text such as "2026-03-14T09:30:00Z". Converting that JSON back gives TOML strings, not dates, because a string that looks like a date may really be text.

Why did my JSON fail with "must be an object"?

A TOML document is always a table of keys. A JSON list or a lone value has no key to sit under, so wrap it first, for example {"items": [1, 2, 3]}.

Is there a size limit?

The input can be up to 5 MB, nested up to 1,000 levels deep. The conversion runs on your device as you type.

Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.