Skip to main content
NeatUtility

TOML to JSON & JSON to TOML Converter

YAML, TOML & Config100% Client-Side
Ready
TEXT
0 lines0 chars
0 B / 4.77 MB
About this tool, examples & FAQ

Convert bi-directionally between TOML configuration files (such as Cargo.toml and pyproject.toml) and structured JSON documents. Features 2- or 4-space formatting, recursive key sorting, and instant client-side execution.

Key facts

Verified capabilities and limits of this utility
OperationsTOML to JSON (default) and JSON to TOML
Formatting Options2 or 4 spaces indentation with optional recursive key sorting
Parser Enginesmol-toml TOML v1.0.0 compliant parser in Web Worker
Maximum Input5 MB
Execution Deadline3 s

How to use

  1. Paste your TOML configuration or JSON document into the editor.
  2. Choose your conversion direction: TOML → JSON or JSON → TOML.
  3. Adjust optional indentation (2 or 4 spaces) or enable key sorting.
  4. Click Convert (or press Ctrl/Cmd + Enter) to instantly run the transformation.
  5. Copy or download your converted output.

Examples

TOML to JSON Conversion

Input

[database]
server = "192.168.1.1"
ports = [ 8001, 8002 ]
enabled = true

Example output

{
  "database": {
    "server": "192.168.1.1",
    "ports": [
      8001,
      8002
    ],
    "enabled": true
  }
}

JSON to TOML Conversion

Input

{
  "database": {
    "server": "192.168.1.1",
    "enabled": true
  }
}

Example output

[database]
server = "192.168.1.1"
enabled = true

Edge cases

Top-level mapping requirement in TOML

TOML specifications mandate that the root of a document must be a table (key-value mapping). Bare JSON arrays or primitive values cannot be directly represented as root TOML documents.

TOML comment preservation

TOML comments are not preserved when translating into JSON, as the JSON specification does not define a standard comment syntax.

Dates and timestamps

Standard RFC 3339 date-time values are parsed and represented as ISO 8601 strings in JSON.

How it works

  1. Parses TOML into native JavaScript objects using smol-toml.
  2. Parses JSON and ensures top-level structure satisfies TOML table requirements.
  3. Applies optional recursive sorting and formatting rules.
  4. Generates output files entirely inside an isolated Web Worker without remote network calls.

Frequently asked questions

Can I convert Rust Cargo.toml or Python pyproject.toml files?

Yes. Standard Rust Cargo.toml, Python pyproject.toml, and any TOML v1.0.0 configuration can be seamlessly converted to and from JSON.

Does this tool work offline or in private environments?

Yes. Everything runs 100% locally in your browser's Web Worker. You can disconnect your network and the tool will continue working perfectly.

Are tables and arrays of tables supported?

Yes. Inline tables, nested tables ([table.subtable]), and arrays of tables ([[array_of_tables]]) are fully supported.

References