TOML to JSON Converter

Bidirectional converter for TOML 1.0 and JSON. Paste a pyproject.toml, Cargo.toml, or any config and convert it instantly. Tables, arrays, datetimes, dotted keys all supported. Processing runs entirely on your device.

Bidirectional converter ยท TOML 1.0 ยท 100% client-side
TOML Input 0 chars
Waiting for input
JSON Output 0 chars
Idle

How to Convert TOML to JSON

Paste your TOML config

Enter any valid TOML into the left pane โ€” a pyproject.toml, Cargo.toml, or custom config file. The tool converts live as you type when Live mode is enabled. Toggle Live off to convert only on demand by clicking Convert. Click Sample to load a full pyproject.toml-style example with tables, arrays of tables, inline tables, and dotted keys.

Choose direction and indent options

The direction toggle switches between TOML โ†’ JSON and JSON โ†’ TOML. In TOML โ†’ JSON mode, choose 2 spaces, 4 spaces, Tab, or Minify to control output indentation. In JSON โ†’ TOML mode, indentation does not apply โ€” TOML output uses standard formatting automatically. Use Swap to send the output back as input for immediate round-trip verification.

TOML 1.0 type support

The parser implements the full TOML 1.0.0 specification. Supported types include: basic and literal strings (single- and multi-line), integers (decimal, 0x hex, 0o octal, 0b binary, underscore separators), floats (including inf and nan), booleans, RFC 3339 datetimes (offset, local, date-only, time-only), arrays with trailing commas and mixed types, standard tables, dotted-key nested tables, inline tables, and arrays of tables ([[header]]).

Privacy and offline use

The TOML parser and JSON serializer both run entirely in your browser using plain JavaScript. No data is sent to any server. The tool has no analytics, no login, and no file uploads. Once the page loads, it also works fully offline โ€” useful for converting sensitive configuration files containing API keys or credentials.

Frequently Asked Questions

What is TOML and why convert it to JSON?

TOML (Tom's Obvious Minimal Language) is a configuration format used by Rust's Cargo.toml and Python's pyproject.toml. Converting to JSON makes it consumable by JavaScript tooling, web APIs, and any system that already speaks JSON. The reverse direction is useful when migrating JSON configs to a more human-readable format.

Which TOML version does this tool support?

This tool implements the TOML 1.0.0 specification, including basic and literal strings (single and multi-line), integers with hex, octal, binary, and underscore separators, floats including inf and nan, booleans, datetimes, arrays, inline tables, regular tables, and arrays of tables with dotted keys.

Is the conversion lossless in both directions?

TOML โ†’ JSON is lossless for data, but comments are dropped because JSON has no comment syntax. JSON โ†’ TOML preserves all values; null is not representable in TOML and is skipped with a warning. Datetime strings in JSON stay as strings in TOML unless they match the ISO 8601 pattern exactly.

Are my files uploaded anywhere?

No. The parser and serializer run entirely in your browser using JavaScript. Nothing is sent to any server, no analytics track your input, and the page works completely offline once loaded.

Can I paste a real pyproject.toml or Cargo.toml file?

Yes โ€” that is exactly what this tool is built for. Both formats follow standard TOML syntax and parse without modification. The output will be a nested JSON object matching the table structure of the original.

Related Tools