Skip to content
T
Tools.Town
Free Online Tools for Everyone
{}

TOML to JSON

100% Free

Convert TOML configuration files to JSON. Handles tables, arrays-of-tables, inline tables, multi-line strings, hex/octal integers, booleans, and dates.

TOML v1.0
Tables & Arrays
Instant
Private

18 lines

14 keys

Embed This Tool

Easy to Embed

Add TOML to JSON to your website or blog in seconds.

  • Responsive design
  • Lightweight & fast
  • No backend required
  • Always up-to-date
<iframe
  src="https://tools.town/embed/toml-to-json/"
  width="100%"
  height="600"
  style="border:none; border-radius:12px;"
  loading="lazy"
  title="TOML to JSON">
</iframe>

Share This Tool

Share Instantly

Share TOML to JSON with anyone — no login required.

  • Shareable link
  • No login required
  • Works on any device
  • No account needed

Share via

Advertisement

How to Use

  1. 1 Paste your TOML content into the left panel, or click 'Load example' to see a sample
  2. 2 Choose JSON indentation: 2 spaces (default), 4 spaces, or minified
  3. 3 Optionally enable 'Sort keys A–Z' to alphabetise the output object keys
  4. 4 See the converted JSON update instantly in the right panel
  5. 5 Review any parse error message if the TOML is malformed — the error shows the line number
  6. 6 Click 'Copy JSON' to copy the result to your clipboard

Features

  • Handles standard TOML tables [section], nested tables [section.sub], and arrays-of-tables [[section]]
  • Parses all TOML value types: strings (basic, literal, multi-line), integers (decimal/hex/octal/binary), floats, booleans, dates
  • Inline tables { key = value } and mixed-type arrays supported
  • Hex (0xFF), octal (0o77), and binary (0b1010) integer literals converted correctly
  • Numeric underscores for readability (1_000_000 → 1000000) handled transparently
  • Clear error messages with line numbers when TOML is malformed

Why it Matters

TOML (Tom's Obvious Minimal Language) is the configuration format of choice for Rust (Cargo.toml), Python packaging (pyproject.toml), Hugo sites, and many modern developer tools. JSON is the lingua franca of APIs, configuration systems, and data pipelines. When you need to programmatically process a TOML config — feed it to a REST API, store it in a database, or inspect it in a browser-based tool — converting to JSON is the fastest path. This tool does that conversion entirely in your browser with no server round-trip.

★★★★★

Use Cases

Rust / Cargo.toml

Inspect or transform Cargo.toml dependency graphs by converting to JSON for scripting

Python Packaging

Convert pyproject.toml to JSON to process build metadata programmatically

Hugo & Static Sites

Transform Hugo config.toml or config/ directory files to JSON for tooling

Developer Tooling

Bridge TOML-native tools with JSON-native APIs and SDKs without writing a parser

Why convert TOML to JSON?

TOML is designed for human-editable configuration: it has comments, multi-line strings, and a natural table notation. JSON is designed for machine consumption: it is the native format of REST APIs, browsers, and data pipelines. When you need a TOML config inside a JavaScript tool, a Python API call, or a database record, JSON is the format you need.

What this parser handles

Standard TOML [tables] and [[arrays-of-tables]], inline tables { a = 1 }, all string types, integers in decimal/hex/octal/binary, floats including inf and nan, booleans, and ISO 8601 dates. Underscores in numbers (like 1_000_000) are stripped before parsing.

Privacy

All parsing happens locally in your browser. Your config files are never uploaded to any server.

Frequently Asked Questions

What TOML version does this support?
The parser is aligned with TOML v1.0.0 and covers all common constructs: standard tables, arrays of tables, inline tables, basic and literal strings (including multi-line), all numeric types (decimal, hex, octal, binary with underscore separators), booleans, and RFC 3339 dates returned as ISO strings.
How are TOML dates represented in JSON?
TOML has native date, time, and datetime types. Since JSON has no native date type, this tool returns them as ISO 8601 strings (e.g. 2024-01-15 or 2024-01-15T10:30:00Z). This is the standard convention used by most TOML-to-JSON converters.
What happens with TOML infinity and NaN floats?
TOML supports inf, +inf, -inf, and nan as float values. Since JSON does not support these, they are serialised as the strings 'Infinity', '-Infinity', and 'NaN'. Be aware that strictly valid JSON parsers may reject these — use minified output and verify compatibility with your target JSON parser.
Is there a file size limit?
The tool processes up to 200,000 characters (about 200 KB) of TOML in the browser. For larger files, a CLI tool like cargo-toml2json or Python's toml library would be more appropriate.
Can I convert JSON back to TOML?
This tool is one-way (TOML → JSON). A JSON-to-TOML converter is on the roadmap. In the meantime, tools like yq or online converters handle the reverse direction.

Related Tools You Might Like

Browse more free tools