TOML to JSON

Convert TOML into JSON instantly

Paste TOML on the left and get JSON on the right — all in your browser

Last updated: January 27, 2026
Frank Zhao - Creator
CreatorFrank Zhao
The converted JSON will appear here

Introduction / Overview

What this tool does

Paste TOML on the left, and you get formatted JSON on the right. Everything runs locally in your browser, so your config never needs to leave your device.

Who it’s for

Developers, DevOps engineers, and anyone working with config files (for example, tool settings, project metadata, or application defaults) who needs JSON for scripting or APIs.

If your pipeline needs YAML instead, try our YAML to JSON converter or JSON to YAML converter.

Privacy note: conversion runs in your browser. Avoid pasting secrets anyway—treat API keys and tokens as sensitive.

How to Use / Quick Start Guide

  1. 1
    Paste your TOML into Your TOML.
  2. 2
    Check the JSON output on the right.
  3. 3
    Use the copy icon to copy the JSON into your project.

How to interpret the result

The output is pretty-printed JSON (with indentation). It’s meant to be human-readable and easy to diff in Git.

J=stringify(parseTOML(T),3)J = \mathrm{stringify}(\mathrm{parse}_{\mathrm{TOML}}(T),\,3)==formatted JSON\mathrm{formatted\ JSON}

Here TT is your TOML text and 33is the indentation level used for readability.

Step-by-step Examples

Example 1: A simple settings block

Input TOML:

title = "My App"
port = 8080
debug = true

What happens:

"My App""title"\text{"My App"} \rightarrow \text{"title"},,8080"port"8080 \rightarrow \text{"port"},,true"debug"\mathrm{true} \rightarrow \text{"debug"}

Output JSON (formatted):

{
   "title": "My App",
   "port": 8080,
   "debug": true
}

Example 2: Nested tables

Input TOML:

[database]
host = "localhost"
port = 5432

[database.pool]
min = 1
max = 10

TOML tables become nested JSON objects:

database.pool.max=10\text{database.pool.max} = 10

Output JSON (formatted):

{
   "database": {
      "host": "localhost",
      "port": 5432,
      "pool": {
         "min": 1,
         "max": 10
      }
   }
}

Real-World Examples / Use Cases

Git-friendly config diffs

Convert TOML into formatted JSON so code review tools display consistent indentation and object structure.

Tip: If you also store YAML in the repo, convert it with YAML to JSON.

Scripting and CI pipelines

Many scripts can parse JSON easily. Use this converter to turn a TOML config into JSON and then consume it in your build steps.

TOMLJSONscript inputs\mathrm{TOML} \rightarrow \mathrm{JSON} \rightarrow \mathrm{script\ inputs}

Tooling compatibility

Some validators and dashboards only accept JSON. Convert once, paste JSON, and move on.

Debugging configuration

Converting to JSON can help you quickly see the resolved nested structure and confirm values are in the place you expect.

Pro tip: If you’re converting multiple formats in a project, standardize on JSON as an intermediate format. Convert TOML → JSON, then JSON → YAML if needed using our JSON to YAML converter.

Common Scenarios / When to Use

Convert config for an API

Paste TOML and share JSON with a service that only accepts JSON payloads.

Quick sanity-check structure

Nested TOML tables become nested JSON objects, making structure easier to spot.

Make configs diff-friendly

Pretty JSON reduces noise in pull requests and helps code review.

Move between formats

Use JSON as a bridge between TOML and YAML when needed.

Prototype tooling quickly

Many languages parse JSON easily—great for quick scripts and prototypes.

Share examples safely

Share non-sensitive parts of config without exposing secrets.

When it might not be a fit

If your TOML contains values that don’t map cleanly to JSON types in your target system (especially date/time types), you may need to normalize them after conversion.

Tips & Best Practices

Practical tips

  • Start by converting a small snippet, then paste the full file once the structure looks right.
  • If conversion fails, remove trailing commas or invalid quotes—TOML is strict about syntax.
  • Keep secrets out of browser tools; replace with placeholders before sharing output.
  • Use JSON as an intermediate format when migrating between TOML, YAML, and other config formats.

Formatting tip: pretty JSON is perfect for reading. If you need compact JSON for size, you can later minify it in your build pipeline.

Calculation Method / Formula Explanation

This converter does two main steps: it parses TOML text into a JavaScript object, then formats that object into JSON.

O=parseTOML(T)O = \mathrm{parse}_{\mathrm{TOML}}(T)==object\text{object},,J=stringify(O,3)J = \mathrm{stringify}(O,\,3)

TT: TOML input text

OO: parsed object representation

JJ: formatted JSON output

About TOML dates

TOML supports date/time types. JSON doesn’t have a native date type, so different parsers may output dates differently (string vs structured object). If you rely on dates downstream, verify how your target system expects them.

Related Concepts / Background Info

TOML is a configuration format designed to be easy to read and edit by humans.

JSON is a data interchange format commonly used by APIs.

A practical workflow is to treat JSON as an intermediate representation:

TOMLJSONYAML\mathrm{TOML} \rightarrow \mathrm{JSON} \rightarrow \mathrm{YAML}

If you need to go the other direction, try YAML to TOML.

Frequently Asked Questions (FAQs)

Does this run locally or on a server?

It runs locally in your browser. Your input isn’t uploaded.

Why is my TOML marked invalid?

TOML is strict. Common issues include mismatched quotes, invalid dates, and duplicate keys.

Why does the output have indentation?

The tool formats JSON for readability. Conceptually it outputs J=stringify(O,3)J = \mathrm{stringify}(O,\,3).

Can JSON represent all TOML types?

Not perfectly. JSON lacks a native date type, and some TOML values may be represented as strings or special objects depending on the parser.

What if I need YAML instead of JSON?

Convert TOML → JSON here, then use JSON to YAML.

Limitations / Disclaimers

  • This tool is for format conversion and readability; it does not validate business rules for your application.
  • Do not paste secrets (API keys, private tokens). Treat configuration as sensitive.
  • Some TOML types (especially date/time) may need extra handling in downstream systems.

External References / Sources

TOML to JSON | CalculatorVast