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.

TOML to JSON Converter

Paste TOML and get formatted JSON as you type.

Swap directionSwap direction

TOML Input

Paste TOML, upload a .toml file or drop one here.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Cargo.toml
[package]
name = "orders-cli"
version = "0.4.2"
edition = "2021"
authors = ["Ada Lovelace <ada@example.com>"]
description = "Command line client for the orders API"
license = "MIT OR Apache-2.0"

[package.metadata.release]
published = 2026-03-14T09:30:00Z
embargo = 2026-03-01
max-order-id = 9223372036854775807

[dependencies]
anyhow = "1.0"
clap = { version = "4.5", features = ["derive", "env"] }
serde = { version = "1.0", features = ["derive"] }
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }

[dev-dependencies]
assert_cmd = "2.0"

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

[[bin]]
name = "orders-admin"
path = "src/admin.rs"
required-features = ["admin"]

[features]
default = []
admin = []

[profile.release]
opt-level = 3
lto = true
codegen-units = 1

JSON Output

Updates as you type. Copy it or download a .json file.

1

Converting…

Convert TOML to JSON online

This free TOML to JSON converter reads any TOML document and writes it out as formatted JSON. Paste a Cargo.toml, a pyproject.toml or a Hugo or Netlify config, and the JSON version appears as you type, with every table, array of tables, string and number mapped to its JSON equivalent. There is nothing to install and no sign-up, and because the TOML to JSON conversion runs in your browser, your file is never uploaded.

TOML is a pleasant format to write by hand, but scripts, APIs, JSON Schema validators and most front-end tooling want JSON. This tool bridges the two, and it is strict about it: invalid TOML is reported with its line and column instead of being half-converted.

How to convert TOML to JSON

  1. Paste your TOML into the TOML Input editor, or click the upload button to open a .toml file. You can also drag a file onto the editor.
  2. The JSON Output updates as you type. If the TOML is invalid, the status bar shows the line and column of the problem, for example Invalid TOML at line 2, column 5.
  3. Choose 2 spaces, 4 spaces or Minified output, and tick Large integers as strings if the JSON will be read by JavaScript.
  4. Click Copy to put the JSON on your clipboard, or Download to save it as data.json.

TOML to JSON example

Tables become nested objects, each [[bin]] block becomes one item in an array, and an inline table such as { version = "4.5", ... } becomes an ordinary object. Keys stay in the order they appear in the TOML.

TOML input
[package]
name = "orders-cli"
version = "0.4.2"
authors = ["Ada Lovelace <ada@example.com>"]

[dependencies]
clap = { version = "4.5", features = ["derive"] }

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

[[bin]]
name = "orders-admin"
path = "src/admin.rs"
JSON output (2 spaces)
{
  "package": {
    "name": "orders-cli",
    "version": "0.4.2",
    "authors": [
      "Ada Lovelace <ada@example.com>"
    ]
  },
  "dependencies": {
    "clap": {
      "version": "4.5",
      "features": [
        "derive"
      ]
    }
  },
  "bin": [
    {
      "name": "orders",
      "path": "src/main.rs"
    },
    {
      "name": "orders-admin",
      "path": "src/admin.rs"
    }
  ]
}

How TOML types map to JSON

TOML types and their JSON equivalents
TOMLJSON outputNotes
[table]ObjectDotted keys such as a.b = 1 become nested objects too.
[[array of tables]]Array of objectsOne object per [[ ]] block, in document order.
ArrayArrayItems may be of mixed types.
String (4 kinds)StringBasic, literal and both multi-line forms. Escapes are resolved.
IntegerNumberHex, octal, binary and 1_000 become plain decimal numbers.
FloatNumber1.0 becomes 1; inf and nan become strings.
Booleantrue / falseUnchanged.
Date and timeStringSee the next section.
CommentDroppedJSON has no comments.

Dates and times become strings

TOML has four date and time types and JSON has none, so each one is written as a string that keeps its TOML form. An offset datetime keeps the offset you wrote, and the three local types stay local: the converter never invents a time zone. Milliseconds are shown only when they are not zero, and fractional seconds beyond milliseconds are dropped.

TOML input
published = 2026-03-14T09:30:00Z
start = 2026-03-14T09:30:00
day = 2026-03-14
alarm = 07:30:00
id = 9223372036854775807
ratio = inf
JSON output
{
  "published": "2026-03-14T09:30:00Z",
  "start": "2026-03-14T09:30:00",
  "day": "2026-03-14",
  "alarm": "07:30:00",
  "id": 9223372036854775807,
  "ratio": "inf"
}

Large integers keep every digit

TOML integers can be 64-bit, but JavaScript numbers are only exact up to 9007199254740991. The converter writes larger integers with all their digits, as in the id above, which is valid JSON and is read correctly by Python, Go, Java and most other languages. JavaScript's JSON.parse would round it, so tick Large integers as strings to get "9223372036854775807" instead. Only integers beyond the safe range are quoted.

Infinity and NaN have no JSON form

TOML allows inf, -inf and nan as float values, but JSON has no way to write them, and JSON.stringify would silently turn them into null. This converter keeps the information instead and writes the strings "inf", "-inf" and "nan".

Comments are lost, key order is not

Comments cannot survive in JSON, so they are removed. The order of keys is preserved, and TOML has no null, so the JSON you get never contains one.

Fixing TOML syntax errors

TOML is stricter than it looks, and the converter stops at the first mistake instead of guessing. The message in the status bar gives the line and column, so you can jump straight to it. The mistakes below account for most failures:

  • Unquoted text values: name = demo is rejected with invalid value. Strings need quotes: name = "demo".
  • A key or table defined twice: Repeating a key, or opening the same [table] a second time, gives trying to redefine an already defined table or value.
  • Unfinished arrays and inline tables: A missing closing bracket or comma is reported at the point where the parser expected it.
  • JSON pasted into the TOML box: JSON is not valid TOML, so {"a": 1} fails on line 1. Use the JSON to TOML converter for that direction.

Why convert TOML to JSON?

  • Reading Cargo.toml and pyproject.toml in scripts: Shell, JavaScript and CI tools parse JSON natively, so convert the manifest once and query it with jq.
  • Feeding config to APIs and validators: HTTP APIs, JSON Schema validators and config UIs expect JSON, not TOML.
  • Debugging how a config really parses: Seeing dotted keys, inline tables and arrays of tables expanded shows exactly what the application will read.
  • Migrating config formats: Convert to JSON as a neutral middle step, then on to YAML if the target tool prefers it.

Wondering which format to pick? Our comparison of YAML vs JSON covers the trade-offs, and the same ones apply in the TOML vs JSON decision: TOML is easier to edit, JSON is easier to exchange. To go the other way, use the JSON to TOML converter. Related tools include the YAML to JSON converter and the JSON to YAML converter. Need test data? Create some with the JSON Generator, or describe the converted result with the JSON Schema Generator.

TOML vs JSON in short

TOML reads like an INI file with real data types: comments, multi-line strings, native dates and tables you can split across the document. JSON has fewer features but is the common language of web APIs, databases and front-end tooling. Teams usually keep TOML for the files people edit and convert to JSON for anything a program consumes.

Frequently Asked Questions

How do I convert TOML to JSON?

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

What is the difference between TOML and JSON?

TOML is designed for configuration files that people edit by hand: it allows comments, multi-line strings and native date and time values. JSON is a stricter data-exchange format with no comments and no date type, but it has null and is understood by every language and API.

How are TOML dates and times converted?

JSON has no date type, so each TOML date and time becomes a string in its own form: "1979-05-27T07:32:00Z" for an offset datetime, "1979-05-27T07:32:00" for a local datetime, "1979-05-27" for a local date and "07:32:00" for a local time. Offsets are kept as written and nothing is shifted to another time zone.

What happens to very large integers?

By default every digit is kept, so 9223372036854775807 is written as that exact number. JavaScript's JSON.parse rounds integers above 9007199254740991, though, so tick Large integers as strings if the JSON will be read in a browser or Node.js.

What happens to inf and nan values?

JSON cannot represent infinity or not-a-number, so inf and +inf become the string "inf", -inf becomes "-inf", and nan, +nan and -nan all become "nan". Convert them back in your own code if you need the numeric values.

Are TOML comments kept in the JSON?

No. JSON has no comments, so lines starting with # and trailing comments are dropped. Everything else, including the order of your keys, is kept.

Is my TOML uploaded to a server?

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

Related converters

  • JSON to TOML ConverterConvert JSON to TOML for Cargo, pyproject and other config files.
  • 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