Convert TOML to JSON

Convert TOML configuration into JSON for scripts, validators and APIs. Dates become ISO 8601 strings and comments are dropped.

Drop your file here, or browse

Images, documents, spreadsheets, data files and subtitles. Your file stays on your device.

Your file is converted on this device and is never uploaded to a server.

Reading TOML as JSON

TOML files are easy for people to edit, but many tools, dashboards and scripts only understand JSON. Converting a Cargo.toml, pyproject.toml, netlify.toml or Hugo config to JSON lets you inspect it with JSON tools, validate it or load it without a TOML parser.

This converter uses smol-toml, a TOML 1.0 compliant parser. Tables become objects, array tables become arrays of objects and inline tables become nested objects. Invalid TOML produces an error message rather than partial output.

TOML vs JSON at a glance

Main differences between the TOML and JSON formats
FeatureTOMLJSON
Full nameTom's Obvious, Minimal LanguageJavaScript Object Notation
TypeConfiguration dataHierarchical data
Introduced2013Early 2000s (RFC 4627 in 2006)
Created byTom Preston-WernerDouglas Crockford; now ECMA-404 and RFC 8259
StructureKey/value pairs grouped into [tables]Nested objects and arrays
CommentsYes, with #No
Data typesString, integer, float, boolean, date-time, array, table; no nullString, number, boolean, null, object, array
Best forProject config such as Cargo.toml and pyproject.tomlAPIs, web apps and app settings
SupportRust, Python, Go and most languages via librariesEvery programming language
MIME typeapplication/tomlapplication/json

How to convert TOML to JSON

  1. Step 1: Select the .toml file

    Drop your config file onto the converter.

  2. Step 2: Keep JSON as the target

    JSON is preselected. YAML and XML are also available.

  3. Step 3: Convert

    The TOML is parsed and written as indented JSON.

  4. Step 4: Download

    Save the .json file and use it anywhere.

Type mapping

Tables to objects

[package] becomes a package object.

Array tables to arrays

[[bin]] entries become an array of objects.

Dates to strings

TOML dates and times become ISO 8601 strings.

Numbers kept

Integers and floats become JSON numbers.

Why convert TOML to JSON

  • Inspecting project metadata. Read package names, versions and dependencies in JSON tools.

  • CI scripts. Parse config values in environments that ship only a JSON parser.

  • Validation. Check configs against a JSON Schema.

  • Migrating tools. Move settings to a JSON-based configuration system.

Precision and special values

JSON numbers are handled as double precision floats by most software, so integers larger than about nine quadrillion (2 to the 53rd power) cannot be represented exactly. Rather than silently changing such a value, the converter stops with an error; write very large numbers as quoted strings in the TOML if you need them.

TOML allows inf and nan as float values; JSON has no equivalent, and they are written as null. Comments are removed because JSON cannot hold them.

When conversion fails

TOML is strict. Defining the same key twice, redefining a table, or mixing a table with a dotted key of the same name is an error, and the converter reports it. The message usually includes the line where the problem was found.

Fixing the TOML in an editor with syntax highlighting is the quickest way to resolve these errors.

  • Duplicate keys: not allowed.
  • Unquoted strings: not allowed.
  • Trailing commas in inline tables: not allowed.

Tips for TOML to JSON

  • Quote every string value in TOML; bare words are errors.
  • Keep dates unquoted in TOML if you want them treated as dates.
  • Use JSON to TOML to convert edited data back.
  • For large dependency lists, pipe the JSON into jq for quick queries.

TOML to JSON questions

Which TOML version is supported?

TOML 1.0, through the smol-toml parser.

How are dates converted?

Into ISO 8601 strings such as 2026-09-17T10:00:00.000Z.

Are comments kept?

No. JSON has no comment syntax.

What about array tables?

Each [[table]] block becomes an element in a JSON array.

Why do I get an error?

TOML is strict about duplicate keys and quoting. The error message explains what went wrong.

Is the file uploaded?

No. Everything runs in your browser.

Related conversions