Convert JSON to TOML
online, free & instant
Paste your JSON and get clean TOML output with section headers, inline tables, and arrays of tables. Works entirely in your browser — no upload, no account, no waiting.
Open JSON to TOML ConverterFrom JSON to config-ready TOML in seconds
No account. No upload. No nonsense.
100% Private
Your JSON never leaves your device. There is no server receiving your data.
Instant Output
Conversion happens as you type. No round-trips to a backend, no latency.
Config Ready
Output follows TOML v1.0 spec — compatible with Cargo, Hugo, pyproject, and more.
Related JSON tools
Common questions answered
What is TOML and why convert JSON to it?
TOML (Tom's Obvious Minimal Language) is a human-friendly configuration format used by tools like Cargo (Rust), pyproject.toml (Python), and Hugo. Converting JSON to TOML makes your config files easier to read and edit by hand.
Is the JSON to TOML converter free?
Yes, completely free with no account or signup required.
How does it handle nested JSON objects?
Nested objects become TOML section headers using [bracket] notation. Deeply nested structures produce dotted section paths like [parent.child], keeping the output clean and readable.
Can I use the output in Cargo.toml or pyproject.toml?
Yes. The converter produces valid TOML that can be pasted directly into Cargo.toml, pyproject.toml, or any other TOML config file. You may need to adjust key names to match your tool's expected schema.
Is my data sent to a server?
No. All conversion runs entirely in your browser using JavaScript. Your JSON is never uploaded or transmitted.
What is TOML?
TOML (Tom's Obvious Minimal Language) is a configuration format designed for readability and unambiguous mapping to hash tables. It is the format for Cargo (Rust), pyproject.toml (Python), Hugo, and many other tools. TOML uses [brackets] for sections, = for key-value pairs, and supports comments, dates, and inline tables natively.
This tool converts JSON to TOML. Top-level keys become simple key = value pairs, nested objects become [section] headers, and arrays of objects become [[array]] of tables. TOML has strict rules: bare keys when possible, quoted strings, distinct types for integers, floats, booleans, and dates.
{
"name": "my-app",
"version": "1.0.0",
"database": {
"host": "localhost",
"port": 5432
}
}
name = "my-app" version = "1.0.0" [database] host = "localhost" port = 5432
Get the most out of this tool
- TOML sections ([section]) correspond to JSON objects — nested objects create subsection headers.
- Arrays of tables use [[double brackets]] — this maps to JSON arrays containing objects.
- Use TOML for Rust (Cargo.toml), Python (pyproject.toml), and other tools supporting TOML config.
Ready to convert your JSON to TOML?
Free forever. No signup. Works offline.
Convert JSON to TOML nowJSON to TOML conversion explained
TOML (Tom's Obvious, Minimal Language) is a configuration file format designed to be easy for humans to read and write, with an unambiguous specification that maps cleanly to a hash table. Created by Tom Preston-Werner (co-founder of GitHub), TOML is the default configuration format for Cargo (Rust's package manager), Hugo (static site generator), Pip (Python package manager, pyproject.toml), and many other developer tools. Converting JSON configuration to TOML is a common task when adopting these tools.
TOML's syntax is closer to INI files than to JSON. Simple key-value pairs are written as key = "value" without any wrapping structure. Nested objects use section headers in brackets: [database] introduces a section where following key-value pairs belong to the "database" object. This makes TOML configuration files much more readable than equivalent JSON — you can see at a glance which settings belong to which component without counting braces.
TOML has richer primitive types than JSON. TOML natively supports dates (1979-05-27), times (07:32:00), and datetimes (1979-05-27T07:32:00Z) as first-class types — no quotes required, parsed as typed values rather than strings. TOML also has hexadecimal (0xFF), octal (0o17), and binary (0b1010) integer literals, and underscores in numbers for readability (1_000_000). These features make TOML more expressive for configuration values without requiring helper functions.
JSON arrays of objects convert to TOML "array of tables" syntax using double-bracket headers: [[dependencies]]. Each [[dependencies]] section starts a new element in the array, and the key-value pairs following it define that element's fields. This syntax is more verbose than JSON array notation but more readable — each array element is clearly delineated with its own section header rather than nested inside brackets.
Key naming in TOML is flexible: bare keys (no quotes, alphanumeric and dashes only), quoted keys ("any unicode key"), and dotted keys (a.b.c = 1 is equivalent to [a]\n[a.b]\nc = 1). The converter chooses the appropriate key format based on the JSON key's characters, preferring bare keys for simple alphanumeric names and quoted keys for names with spaces or special characters.
Rust's Cargo.toml is the most widely encountered TOML file for developers working with Rust. The [package] section, [dependencies] section, [[bin]] targets, and [profile.release] settings are all standard TOML structures. When migrating a Rust project from one package manager format or converting build configuration from JSON to TOML, this converter handles the structural mapping automatically.
When developers use this tool
Additional frequently asked questions
When should I use TOML instead of JSON for configuration?
Use TOML when humans will frequently read and write the configuration file — TOML is more concise and readable than JSON, supports comments, and has native date/time types. Use JSON when the configuration is primarily machine-generated or when you need broad tool compatibility. Use YAML when you need multi-line strings or anchors for repeated values.
Does TOML support comments?
Yes. TOML uses # for single-line comments. Lines starting with # and portions of lines after # are ignored by parsers. This is a major advantage over JSON for configuration files — you can annotate settings with explanations, disable options by commenting them out, and add section headings as comments to organize the file.
Can TOML represent all JSON data types?
Yes, for practical purposes. TOML has string, integer, float, boolean, datetime, array, and table (object). JSON null has no TOML equivalent — null values must be omitted or represented as a sentinel value (like an empty string or -1). This is the only JSON value that does not map cleanly to TOML; all others convert cleanly.
Is TOML better than YAML for configuration?
TOML is more predictable than YAML because it has fewer edge cases (no boolean coercion, no indentation sensitivity for scalar values, no multi-document streams). YAML is more flexible (multi-line strings, anchors, complex keys). TOML is generally preferred for application configuration; YAML is preferred for data-heavy or template-heavy configurations like Kubernetes manifests and Ansible playbooks.