TOML to JSON Converter
Convert TOML configuration files to JSON instantly online. Supports tables, arrays, inline tables, dotted keys, and all TOML v1.0 features. Free — runs entirely in your browser.
Related Tools
JSON → YAML
Convert JSON to YAML format instantly. Supports nested objects, arrays, and complex structures.
YAML → JSON
Convert YAML to JSON format instantly. Supports multi-document YAML and complex configurations.
CSV → JSON
Convert CSV to JSON array instantly. Automatic header detection and type inference.
TOML (Tom's Obvious Minimal Language) is a configuration file format created by Tom Preston-Werner, co-founder of GitHub, with the goal of being more human-readable than JSON and less ambiguous than YAML. It uses an INI-like section syntax ([section]) combined with explicit typing for strings, integers, floats, booleans, dates, arrays, and inline tables.
TOML is the configuration language of choice for Rust projects (Cargo.toml), Python packaging (pyproject.toml per PEP 518), Hugo static site generator, and various Rust-ecosystem tools like cargo-release and just. When integrating TOML configuration values into systems that consume JSON — such as JavaScript applications, REST API clients, or database seed scripts — conversion is required.
This tool uses the smol-toml library, a fully compliant TOML v1.0 parser, to parse the input and then serializes the result as formatted JSON using JSON.stringify with two-space indentation. TOML-specific types like datetime values are converted to ISO 8601 strings in the JSON output. Nested sections become nested JSON objects, and TOML arrays of tables become JSON arrays of objects.
Common Use Cases
Using Cargo.toml data in JavaScript tooling
Rust projects define their metadata — name, version, authors, dependencies — in Cargo.toml. When building documentation sites, release automation scripts, or dependency dashboards for Rust crates using Node.js tooling, converting the TOML to JSON allows JavaScript code to read version strings and dependency lists without requiring a TOML parsing library in the Node.js environment.
Migrating configuration to JSON-based systems
When a project switches from a TOML-based configuration (such as a Hugo site config or a Rust CLI tool) to a platform that requires JSON (AWS AppConfig, Azure App Configuration, or a Next.js config), bulk-converting the TOML configuration to JSON provides a starting point for the migration without manual transcription.
Validating TOML structure and types
Because TOML's type system is stricter than JSON (integers and floats are distinct, dates are first-class values), attempting to convert a malformed TOML file to JSON reveals parsing errors with clear messages. This is faster than running cargo check or another project-specific validator just to diagnose a configuration syntax error.
Passing pyproject.toml settings to Python scripts
Python projects using pyproject.toml store tool configuration (black, mypy, pytest settings) in TOML format. CI scripts or automation tools written in JavaScript that need to read these settings can convert the TOML to JSON first, then use standard JSON parsing rather than adding a Python TOML dependency to the Node.js pipeline.
How to Use the TOML to JSON Converter
- Paste your TOML configuration in the left panel.
- The JSON output appears instantly in the right panel.
- Click "Copy Output" to copy the JSON result.
- Use "Load Example" to see a sample Cargo.toml conversion.