JSONGenerator
GeneratorSchemaConvertersExamplesDocs

JSONGenerator

Free online tools for generating random JSON data and JSON Schemas.

Quick Links

  • JSON Generator
  • JSON Schema Converter
  • Examples
  • Docs
  • Blog
  • About
  • Contact
  • Privacy Policy

Converters

  • JSON to YAML
  • YAML to JSON
  • XML to JSON
  • JSON to XML
  • JSON to TOML
  • TOML to JSON
  • JSON to CSV
  • CSV to JSON
  • JSON to Excel
  • Excel to JSON
  • JSON to HTML table
  • JSON to TypeScript
  • JSON to C#
  • JSON to Go
  • JSON to Java
  • JSON to SQL

Support

Having issues? Contact us.

© 2026 JSON Generator. All rights reserved.

JSON to TOML Converter

Paste JSON and get valid TOML with tables and arrays of tables as you type.

Swap directionSwap direction

JSON Input

Paste JSON, upload a .json file or drop one here.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
  "title": "Example service",
  "debug": false,
  "owner": {
    "name": "Ada",
    "created": "2024-01-15T10:30:00Z"
  },
  "proxy": null,
  "ports": [8000, 8001],
  "build info": {
    "retries": 3,
    "ratio": 1.5
  },
  "servers": [
    { "host": "alpha", "role": "primary" },
    { "host": "beta", "role": "backup" }
  ]
}

TOML Output

Updates as you type. Copy it or download config.toml.

1

Converting…

Convert JSON to TOML online

This free JSON to TOML converter turns a JSON document into valid TOML 1.0. Paste an API response, an exported config or settings you have kept as JSON, and the TOML version appears as you type: nested objects become [tables], arrays of objects become [[arrays of tables]], and strings, numbers and booleans keep their types. Nothing is installed or uploaded, because the conversion runs in your browser.

TOML (Tom's Obvious Minimal Language) is a configuration format meant to be read and edited by people. It has comments, integers that are distinct from floats and a native date type, and it avoids YAML's indentation rules. Rust's Cargo, Python packaging, Hugo and Netlify all use it. The catch is that TOML and JSON do not line up one-to-one, and the sections below spell out exactly where they differ so there are no surprises in your output.

How to convert JSON to TOML

  1. Paste your JSON into the JSON Input editor, or click the upload button to open a .json file. You can also drag a file onto the editor.
  2. The TOML Output updates as you type. If the JSON is invalid, or cannot be expressed in TOML, the status bar explains why.
  3. Optionally set Null values to omit or report nulls, type a key into Wrap in key if your JSON is an array, or tick ISO dates as TOML dates.
  4. Click Copy to put the TOML on your clipboard, or Download to save it as config.toml.

JSON to TOML example

This JSON describes a small Rust project. In the output, the package and dependencies objects become tables, the two bin objects become an array of tables, and debug moves to the top (the reason is explained below).

JSON input
{
  "package": {
    "name": "my-app",
    "version": "0.1.0",
    "authors": ["Ada Lovelace"]
  },
  "dependencies": {
    "serde": "1.0",
    "tokio": { "version": "1", "features": ["full"] }
  },
  "bin": [
    { "name": "server", "path": "src/main.rs" },
    { "name": "worker", "path": "src/worker.rs" }
  ],
  "debug": false
}
TOML output
debug = false

[package]
name = "my-app"
version = "0.1.0"
authors = [ "Ada Lovelace" ]

[dependencies]
serde = "1.0"

[dependencies.tokio]
version = "1"
features = [ "full" ]

[[bin]]
name = "server"
path = "src/main.rs"

[[bin]]
name = "worker"
path = "src/worker.rs"

How JSON maps to TOML

JSON structures and the TOML they become
JSONTOML outputNotes
Object at the top levelkey = value linesThe document itself is the root table.
Nested objectA [table] header; deeper levels get [a.b]An empty object is still written, as an empty [table].
Array of objectsRepeated [[table]] headersOne header per item; nested objects inside an item become sub-tables.
Array of scalars or arraysInline: [ 80, 443 ]An empty array is [].
String"text"Quotes, backslashes, tabs, newlines and control characters are escaped.
Integer42A value such as 1.0 is written as 1 (see below).
Decimal number1.5Large or tiny values keep exponent form, such as 1e-7.
true / falsetrue / falseAlways lower case.
nullOmittedTOML has no null type; see below.
ISO date stringA string (default)Becomes a TOML date only if you tick the dates option.

TOML has no null

JSON can say "proxy": null; TOML has no way to write that. By default this converter leaves such keys out, which is how most TOML libraries behave, so a missing key stands for no value. Null items inside an array are dropped too, which means the items after them move up one position.

If a missing key would change what your program does, set Null values to Report an error. The status bar then names the first null it finds, for example servers[1].proxy, so you can decide on a replacement such as an empty string or a default.

The top level must be a table

A TOML file is a set of key/value pairs, so the root has to be an object. A JSON array or a bare string, number or boolean at the top level cannot be converted as is, and the converter says so instead of guessing. Type a name into Wrap in key and the whole value is nested under it: [1, 2] with the key ports gives ports = [ 1, 2 ], and an array of objects with the key products becomes a series of [[products]] tables.

Arrays of tables

When every item in an array is an object, the natural TOML form is a [[name]] header per item, as in the [[bin]] entries above. If an array mixes objects with other values, TOML cannot use that form, so the converter writes the objects as inline tables: a = [ { x = 1 }, 2 ].

Why keys can move

In TOML, once a [table] header appears, every following key belongs to that table. To keep the meaning intact, plain values must be written before any tables, so a key such as debug that comes after an object in your JSON is moved up to the top. Within each group the original order is kept. JSON objects are unordered by definition, so no data changes.

Keys that need quotes

TOML keys written without quotes may only contain ASCII letters, digits, underscores and hyphens. Anything else is quoted automatically: "build info" for a space, "a.b" for a dot (which would otherwise mean a nested table), "é" for non-ASCII letters and "" for an empty key. Digit-only keys such as 123 are valid bare keys and stay unquoted.

Integers, floats and very large numbers

TOML separates integers from floats, while JSON has a single number type. Whole numbers such as 3 are written as integers, and so is 1.0 (as 1), because the browser's JSON parser does not preserve the trailing .0. Numbers with a fractional part, such as 1.5, stay floats.

JavaScript numbers are exact only up to 9,007,199,254,740,991. Larger whole numbers are written as floats with the nearest representable value, so 9007199254740993 becomes 9007199254740992.0. If you rely on 64-bit IDs, store them as strings in your JSON before converting.

Dates and times

TOML has native offset date-times, local dates and local times; JSON does not, so a date in JSON is just a string. The converter keeps it a string by default, because a parser that reads the TOML will then give you the same string back. Tick ISO dates as TOML dates and strings in the forms 2024-01-15, 2024-01-15T10:30:00Z (also with an offset or without a zone) and 10:30:00 are written as real TOML dates. Date-times always get a fractional part, so 10:30:00Z becomes 10:30:00.000Z, and impossible dates such as 2024-02-30 stay strings.

JSON vs TOML

JSON is the better choice for data that programs exchange: it is everywhere, it nests freely and any value can be null. TOML is the better choice for files that people maintain: you can comment it, the sections are labeled, and there are no braces or commas to forget. TOML is also stricter, with a table at the root and no null, which is why a JSON to TOML conversion sometimes needs a decision from you. For a similar comparison with YAML, see YAML vs JSON.

Why convert JSON to TOML?

  • Cargo.toml: Rust crates are configured in TOML; convert generated or exported JSON metadata into [package], [dependencies] and [[bin]] sections.
  • pyproject.toml: Python packaging and tools such as Black, Ruff and pytest read their settings from pyproject.toml, so JSON settings from older setups can move over.
  • Hugo and Netlify: Hugo site configuration and netlify.toml (build commands, redirects and headers) are TOML, and both use <Code>[[arrays of tables]]</Code> for repeated entries such as redirects and menus.
  • Hand-edited config files: Comments, unambiguous types and clear section headers make TOML pleasant to review in pull requests.

If you need sample data to try the converter with, create some with the JSON Generator, or check its structure first with the JSON Schema Generator. To go the other way, use the TOML to JSON converter. Other config formats are covered by the JSON to YAML converter and the JSON to XML converter.

Frequently Asked Questions

How do I convert JSON to TOML?

Paste your JSON into the JSON Input editor, or upload a .json file. The TOML appears in the output editor as you type. Copy it, or click Download to save it as config.toml.

What happens to null values when converting JSON to TOML?

TOML has no null type, so by default the converter leaves out any key whose value is null, and drops null items from arrays. If you would rather find those values than lose them, set Null values to Report an error and the status bar names the path of the first null.

Can I convert a JSON array to TOML?

Not directly, because a TOML document must be a table at the top level. Type a key into Wrap in key (for example products) and the whole array is written under it, as an array of tables if it holds objects.

What is the difference between JSON and TOML?

JSON is a compact data-exchange format with null, no comments and no date type. TOML is designed for hand-edited configuration: it allows comments, distinguishes integers from floats, has native dates and times, and has no null. TOML is not a drop-in replacement for JSON, because every document must be a table at the top level.

Are date strings converted to TOML dates?

Not by default. A string such as 2024-01-15T10:30:00Z stays a string, so the TOML means what your JSON meant. Tick ISO dates as TOML dates to write valid ISO 8601 dates, date-times and times as native TOML values instead.

Can I convert TOML back to JSON?

Yes. Use the TOML to JSON converter, or click Swap direction above the editors. TOML dates become ISO strings in the JSON, since JSON has no date type.

Is my JSON uploaded to a server?

No. The conversion runs entirely in your browser with JavaScript, so your data never leaves your device. That makes it safe to use with config files that contain internal hostnames or other private values.

Related converters

  • TOML to JSON ConverterConvert TOML tables, arrays of tables and dates to JSON.
  • JSON to YAML ConverterConvert JSON to clean, readable YAML for config files, Kubernetes and CI pipelines.
  • YAML to JSON ConverterConvert YAML, including anchors and multi-document files, to formatted JSON.
  • XML to JSON ConverterConvert XML to JSON with attributes, repeated elements and text nodes mapped predictably.
  • JSON to XML ConverterConvert JSON to well-formed XML with a root element of your choice.
  • JSON to CSV ConverterConvert a JSON array to CSV, with nested objects flattened into columns.

See all JSON converters