OKfmt

JSON TOML

Converts JSON to TOML for Rust/Python ecosystem config files such as Cargo.toml, pyproject.toml and Hugo settings.

Drag files here or click to upload (multiple files supported)

Ctrl+V to paste from clipboard

How to convert JSON to TOML

  1. 1Upload your JSON file by dragging, clicking, or pasting.
  2. 2Adjust quality settings if needed.
  3. 3Click 'Convert Now' and wait for the conversion to complete.
  4. 4Download your converted TOML file.

About JSON to TOML conversion

JSON is a general-purpose data interchange format based on the RFC 8259 standard, with only six basic data types. It does not support comments or native date types. TOML is a format designed for configuration scenarios, natively supports date types, and is used by Rust Cargo and Python pyproject configuration files, so there is a need for format conversion.

All key names and nested structures are fully retained after conversion. JSON does not support native comments, so comments in the original JSON will not be retained. Dates stored as JSON strings will be converted to TOML native date types. Size changes vary depending on the original data structure.

This conversion is suitable for converting JSON format interface configurations into a format usable for Rust Cargo.toml and Python pyproject.toml. The conversion result conforms to the TOML v1.0 specification and can be read normally by most tools that support TOML parsing.

JSON vs TOML: technical comparison

FeatureJSONTOML
Released20012013
DeveloperDouglas CrockfordTom Preston-Werner

FAQ about JSON → TOML

Will data be lost after conversion

Data types natively supported by JSON will not be lost after conversion. JSON does not natively support comments and date types, so original comments cannot be retained, but string-formatted dates can be converted to TOML native date types.

Can original JSON key names be retained

All valid JSON key names can be fully retained. During conversion, according to TOML syntax rules, the JSON nested structure is mapped to TOML tables of corresponding levels, and original key names are not modified.

What is the maximum file size supported for conversion

The single-file conversion limit of this tool is 50MB, and only one file can be converted at a time. This meets the size requirements of conventional configuration files and data files. Files exceeding the limit will be rejected.

Will uploaded files be stored

Files are uploaded to the server via HTTPS for conversion. After conversion is complete, the server immediately deletes the source file and output file, does not store any files, so privacy is guaranteed.