Skip to content
{}

TOML to JSON Converter

Convert Cargo.toml, pyproject.toml, or any TOML 1.0 file to JSON, with tables, arrays of tables, dates, and 64-bit integers kept exact.

0 chars | 1 lines
0 chars | 0 lines

Conversion payloads stay in this browser tab and are never placed in page URLs - see how local processing works. Privacy-safe analytics record only the tool, outcome, and a coarse input-size bucket.

How to Convert TOML to JSON

Paste TOML or open a .toml file, and the JSON appears as you type. Each [table] header becomes a nested object, each [[array.of.tables]] entry becomes an element of a JSON array, and dotted keys such as a.b.c = 1 expand into nested objects. Turn on Minify for a single-line result, then copy it or download it as a .json file. A syntax error is reported with its line and column.

What is TOML?

TOML (Tom's Obvious Minimal Language) is a configuration file format designed to map unambiguously to a hash table. Rust's Cargo.toml, Python's pyproject.toml, and the config files of tools such as Hugo, Netlify, and uv all use it. Unlike JSON it allows comments and has real date and time types; unlike YAML it has no indentation rules and no implicit typing, so a value that looks like a string is a string.

What Does Not Carry Over

Comments are dropped, because JSON has none. Key order is kept. Dates become strings, so a consumer that needs a date object must parse them again. Integers beyond 2^53 are written exactly but need a big-number-aware parser on the reading side. Converting back with JSON to TOML restores tables and arrays of tables, but not the comments or the original layout of the file.

What is JSON?

JSON (JavaScript Object Notation) is a lightweight data interchange format. It's easy for humans to read and write, and easy for machines to parse and generate. JSON is the standard format for APIs and is supported by virtually every programming language.

Common Use Cases

Developers convert TOML to JSON when working with APIs that only accept JSON, when debugging configuration files, when migrating from TOML-based configs to JSON-based systems, or when using tools that don't support TOML.

Frequently Asked Questions

Is my TOML data secure when using this converter?

Yes, absolutely. All conversions happen directly in your browser using JavaScript. No data is ever sent to our servers or any third-party services.

What TOML features are supported?

The full TOML 1.0 specification: tables, dotted keys, inline tables, arrays of tables, basic and literal strings including multi-line forms, hexadecimal, octal and binary integers, and all four date and time types.

Can I convert Cargo.toml or pyproject.toml files?

Yes. Both are standard TOML 1.0 documents, so dependency tables, feature lists, [tool.*] sections, and workspace members parse like any other TOML. Open the file with Upload or paste it in.

How are TOML dates and times written in JSON?

JSON has no date type, so each becomes an ISO 8601 string. An offset date-time keeps its offset (1979-05-27T00:32:00.000-07:00), a local date stays a plain date (1979-05-27), and a local time stays a time (07:32:00.000). Nothing is shifted into your own time zone.

What about 64-bit integers, inf, and nan?

TOML integers are 64-bit, while JavaScript numbers are exact only up to 2^53. Larger values are written to the JSON exactly, with a note that JSON.parse in JavaScript will round them. TOML's inf and nan have no JSON form at all, so conversion stops and names the key rather than writing null.

Why convert TOML to JSON?

Most tooling reads JSON and few things read TOML. Converting lets you query a config with jq, feed it to a JSON Schema validator, compare two versions with a JSON diff, or hand it to an API that only accepts JSON.

Configuration workflow

Continue with the data, not the directory

Move between JSON, YAML, and TOML while keeping format semantics visible.

Browse configuration formats