JSON to TOML Converter

Input JSON

Output TOML

Your TOML appears here as you type.

Paste data to see token savings

TOML provides explicit types and is the standard for Python configuration (pyproject.toml).

Example: JSON input and real TOML output

The output below was generated by the same conversion code the converter uses, run on this sample when the page was built.

JSON input (689 characters)
{
  "orders": [
    {
      "id": 1001,
      "status": "shipped",
      "total": 59.9,
      "customer": {
        "name": "Ana Ruiz",
        "country": "ES"
      },
      "items": [
        "SKU-104",
        "SKU-221"
      ]
    },
    {
      "id": 1002,
      "status": "pending",
      "total": 18.5,
      "customer": {
        "name": "Jonas Berg",
        "country": "SE"
      },
      "items": [
        "SKU-310"
      ]
    },
    {
      "id": 1003,
      "status": "shipped",
      "total": 112,
      "customer": {
        "name": "Mei Tanaka",
        "country": "JP"
      },
      "items": [
        "SKU-104",
        "SKU-415",
        "SKU-502"
      ]
    }
  ]
}
TOML output (418 characters)
[[orders]]
id = 1001
status = "shipped"
total = 59.9
items = [ "SKU-104", "SKU-221" ]

[orders.customer]
name = "Ana Ruiz"
country = "ES"

[[orders]]
id = 1002
status = "pending"
total = 18.5
items = [ "SKU-310" ]

[orders.customer]
name = "Jonas Berg"
country = "SE"

[[orders]]
id = 1003
status = "shipped"
total = 112
items = [ "SKU-104", "SKU-415", "SKU-502" ]

[orders.customer]
name = "Mei Tanaka"
country = "JP"

TOML output is 39% smaller than the JSON input. The same data is 375 characters as minified JSON and 689 as pretty-printed JSON. Sizes are character counts, not tokens: token counts depend on the model's tokenizer (see the tokenizer comparison).

JSON to TOML: what changes

  • Reading JSON: Input must be strict JSON: no comments, trailing commas, or single quotes. If it came from an LLM or a log file, run it through the JSON repair tool first.
  • Writing TOML: TOML requires a top-level table: a root-level array is wrapped as [[data]]. Arrays of objects become [[name]] array-of-tables blocks, and null values are silently dropped because TOML has no null.

About JSON

JavaScript Object Notation is the most widely used data interchange format. Lightweight, easy to parse, and supported by every programming language.

  • ✓Universal compatibility
  • ✓Easy to parse
  • ✓Great for APIs
  • ✓Native in JavaScript
Full JSON Documentation →

About TOML

TOML is a config file format with explicit types. It's the official format for Python's pyproject.toml and Cargo's Cargo.toml.

  • ✓Explicit types
  • ✓Standard in Python/Rust
  • ✓Unambiguous
  • ✓Easy to parse
Full TOML Documentation →

Why Convert JSON to TOML?

Use TOML for application configuration, especially in Python (pyproject.toml) or Rust (Cargo.toml) projects. It has explicit types and no ambiguity.

JSON to TOML: Frequently Asked Questions

How do I convert JSON to TOML?

Paste your JSON into the editor on json2toon.co. The tool detects the input and produces TOML instantly, then you copy the result. Conversion runs entirely in your browser, so nothing is uploaded to a server.

Is the JSON to TOML converter free?

Yes. Converting JSON to TOML on json2toon.co is free with no account, signup, or usage limit. A free public API is also available for automated, programmatic conversion.

Why convert JSON to TOML?

TOML provides explicit types and is the standard for Python configuration (pyproject.toml).

What should I watch out for when converting JSON to TOML?

TOML requires a top-level table: a root-level array is wrapped as [[data]]. Arrays of objects become [[name]] array-of-tables blocks, and null values are silently dropped because TOML has no null.

Is my data safe when I convert JSON to TOML?

Yes. The JSON to TOML conversion happens client-side in your browser. Your source data stays on your device and is never sent to or stored on a server, which makes it safe for private or sensitive payloads.