Skip to content

TOML to JSON Converter

Convert TOML configuration files to clean, formatted JSON output

Parse your Cargo.toml into something scripts can eat

TOML is great for configuration files. It’s minimal, unambiguous, and easy to edit by hand. But when you need to process that config programmatically, parse dependencies from Cargo.toml, extract build settings from pyproject.toml, or feed site config from a Hugo project into a custom script, JSON is what most tools and libraries expect.

Paste your TOML, pick your indentation (2 or 4 spaces), click convert. Sections become objects, arrays of tables become arrays of objects, dotted keys expand into nested structures. All the data types map cleanly: strings, integers, floats, booleans, arrays.

The ecosystems that use TOML

Rust: Cargo.toml is the package manifest. Dependencies, features, build profiles, all in TOML.

Python: pyproject.toml is the modern build system config. Tools like Poetry, Flit, and setuptools use it.

Hugo: config.toml for static site configuration.

Various: TOML shows up in more places as projects move away from JSON (too strict, no comments) and YAML (too flexible, too many footguns).

What gets converted

Sections ([package]) become JSON objects. Nested sections ([package.metadata]) become nested objects. Dotted keys (parent.child = "value") expand into proper nesting. Both basic and literal strings are handled. Arrays, arrays of tables ([[bin]]), integers, floats, booleans, everything maps to its JSON equivalent.

TOML vs JSON vs YAML

TOML is the easiest to get right. Its syntax is unambiguous, you can’t accidentally create a valid-but-wrong structure like you can in YAML. JSON is the universal interchange format but doesn’t support comments and requires lots of quotes and braces. YAML is flexible but whitespace-sensitive and has surprising implicit type coercion (Norway problem, anyone?).

For converting YAML to JSON, the YAML to JSON converter is available too.

FAQ

Can it handle Cargo.toml and pyproject.toml?

Yes, standard TOML syntax is fully supported. If your file parses correctly with any TOML library, it’ll work here.

Arrays of tables?

[[section]] syntax is correctly converted to JSON arrays containing objects.

Invalid TOML?

You’ll get an error message pointing to where parsing failed.

Client-side?

Everything runs in your browser. Your config files stay private.

toml json converter config developer

Related Tools

More in Developer Tools