Skip to content

JSON to TOML converter

Paste a JSON object. Null and mixed arrays are errors, and no TOML is written.

TOML has no null, and each array must contain one kind of value. The root value must be an object.

Ctrl+Enter or ⌘+Enter runs this tool immediately.

JSON input
TOML output

Waiting for input.

Parsing stays in this browser. Input is not uploaded or saved.

How to use this tool

  1. Paste one JSON object, or load the sample.
  2. Read the status. A null, a mixed array, or a root that is not an object leaves the output empty.
  3. Copy or download the TOML only after the conversion succeeds.

Supported formats and limitations

  • The root value must be a JSON object. A root array, string, or number is rejected because a TOML document is a table.
  • Null is rejected at any depth. TOML has no null, and this tool does not drop the key.
  • Every item in an array must be the same kind: all strings, all integers, all floats, all booleans, all arrays, or all tables. Integers and floats are different kinds.
  • Comments do not exist in JSON, so the TOML output has none.
  • Keys named __proto__ or constructor are rejected.

Examples

A nested object

A nested JSON object becomes a TOML table.

{
  "database": {
    "host": "localhost",
    "port": 5432
  }
}

An array of strings

A homogeneous array stays an array. Mixing a string with a number is an error.

{
  "owners": ["Ada", "Grace"]
}

Common errors and solutions

TOML has no null
Remove the null or replace it with a string, number, or boolean, then convert again.
Array mixes two kinds
Split the values into separate keys, or make every item the same kind.
The root value must be an object
Wrap a bare array or scalar in an object before converting.

FAQ

Why was my null key not omitted?
Omitting the key would hide data. The conversion stops and names the path instead.
Can an integer and a float share an array?
No. TOML treats integers and floats as different types, so the array is rejected.
Is the JSON uploaded?
No. Parsing and conversion happen in your browser.

Related tools

  • TOML to JSON converter

    Convert TOML 1.1 configuration to JSON in the browser, including tables, arrays, strings, booleans, dates, and numbers, with explicit notes where the types differ.

  • YAML to TOML converter

    Convert one YAML document to TOML in the browser. Comments are dropped, null is rejected, and multi-document streams are not merged.

  • JSON formatter

    Validate JSON, then pretty-print it with 2 or 4 spaces or minify it. Invalid JSON produces an error and leaves the output empty.