Skip to content
Categories
JSON to TOML
Convert JSON into TOML format.
Overview
- Converts JSON-formatted data into TOML format.
- TOML is a notation designed for configuration files, used by many development tools such as Rust's Cargo.toml and Python's pyproject.toml.
- Because of how TOML is specified, the source JSON must have an object (a table) at its top level. Arrays or single values such as strings or numbers cannot be converted as-is.
Usage
- Enter the JSON you want to convert into the text area.
- Click the "Convert" button.
- The result, converted to TOML format, is displayed below. Use the "Copy" button to copy it to the clipboard.
Example
Input
{"package":{"name":"my-app","version":"0.1.0"}}Output
[package] name = "my-app" version = "0.1.0"
Use Cases
- Assembling a Rust (Cargo.toml) or Python (pyproject.toml) configuration in JSON and converting it to TOML
- Transcribing an API response (JSON) into a TOML-formatted configuration sample for documentation
- Migrating data managed as JSON to a tool that uses TOML
FAQ
Is the JSON I enter sent anywhere?
No. The conversion runs entirely in your browser, and nothing is sent to an external server.
Can JSON that is just an array be converted?
No. Because TOML requires an object (a table) at the top level, JSON whose top level is an array or a single value such as a number results in an error. JSON with an array nested inside an object can be converted.
Can I convert TOML back to JSON?
Yes. Please use the "TOML to JSON" tool.
Notes
- The key order of objects preserves the property order of the input JSON as-is.
- Since JSON cannot contain comments, the resulting TOML will not include any comments either. Add them manually after conversion if needed.
- Converting very large JSON data (several MB or more) may make browser processing slow.
Related Tools
Convert TOML into JSON format.
Convert JSON into YAML format.
Validate whether JSON is correctly formatted.