Language
English English Vietnamese (Tiếng Việt) Vietnamese (Tiếng Việt) Chinese (简体中文) Chinese (简体中文) Portuguese (Brazil) (Português do Brasil) Portuguese (Brazil) (Português do Brasil) Spanish (Español) Spanish (Español) Indonesian (Bahasa Indonesia) Indonesian (Bahasa Indonesia)
TOML to JSON Converter

TOML to JSON Converter

Convert TOML configuration files to JSON format instantly with real-time preview, syntax highlighting, and tree view.

What is TOML to JSON Converter?

TOML to JSON Converter is an online tool that transforms TOML (Tom's Obvious Minimal Language) configuration files into JSON format. TOML is widely used in modern development workflows — from Rust's Cargo.toml to Python's pyproject.toml and Hugo's hugo.toml.

This tool provides real-time conversion as you type, with syntax highlighting, a collapsible tree view, and flexible formatting options. Whether you need to migrate configuration data, debug a TOML file, or integrate TOML data into a JSON-based system, this converter handles it instantly in your browser.

Privacy First: All processing happens locally in your browser. Your data never leaves your device — no uploads, no tracking, completely secure.

Why Convert TOML to JSON?

API Integration

Many APIs and services expect JSON input, while your configuration may be in TOML format

Debugging

Visualize complex TOML structures in JSON's familiar tree format for easier troubleshooting

Data Migration

Convert configuration files between formats for different tools and platforms

Learning

Understand how TOML structures map to JSON objects and arrays

How to Use

Quick Start

1

Input Your TOML

Paste or type your TOML data in the left panel

2

Automatic Conversion

The JSON output appears automatically in the right panel as you type

3

Customize Format

Adjust indent size, sort keys, or switch between text and tree views

4

Export Result

Copy to clipboard or download the JSON file

Input Methods

Paste Content

Paste TOML content directly into the editor for instant conversion

Type Manually

Write TOML manually with Tab support for proper indentation

Upload File

Click the upload button to load a .toml file from your device

Load Sample

Click the sample button to load an example Cargo.toml file

Formatting Options

Indentation Control

  • 2 spaces — Compact, space-efficient formatting
  • 4 spaces — Standard, balanced readability (default)
  • 8 spaces — Maximum clarity for deeply nested structures
  • Minified — Compact single-line output for production use

Sort Keys: Toggle alphabetical sorting of all JSON keys at every nesting level

View Modes

Text View
Syntax-Highlighted JSON
  • Color-coded keys, strings, numbers
  • Easy to copy and paste
  • Perfect for code review
  • Shows exact output format
Tree View
Interactive Hierarchy
  • Collapsible nested structures
  • Item counts for arrays/objects
  • Type-based color coding
  • Ideal for exploration

Export Options

  • Copy to Clipboard — One-click copy of the entire JSON output
  • Download as File — Save the result as data.json to your device

Features

Real-Time Conversion

Conversion happens automatically as you type with a 300ms debounce for smooth performance, and instantly when you paste content. The status bar provides live feedback on your conversion:

Valid

TOML parsed successfully

Invalid

Syntax error detected

Ready

Waiting for input

Statistics

Line count, keys, size

Syntax Highlighting

The JSON output features professional color-coded syntax highlighting for maximum readability:

Element Type Color Example
Keys Purple "name":
Strings Green "hello world"
Numbers Orange 42, 3.14
Booleans Blue true, false
Null Gray Italic null

Tree View

Switch to Tree View to explore your data as an interactive collapsible hierarchy. This view is particularly useful for understanding complex nested structures at a glance.

  • Expand and collapse objects and arrays with one click
  • Item counts displayed for quick reference ({5} for objects, [3] for arrays)
  • Values color-coded by type for easy scanning
  • Navigate deep nesting levels without losing context

TOML Data Type Support

The converter handles all TOML v1.0 data types with full specification compliance:

Strings

Complete string support

  • Basic strings
  • Literal strings
  • Multiline strings

Numbers

All numeric formats

  • Integers
  • Floats
  • Scientific notation

Booleans

True/false values

  • true
  • false

Dates & Times

Converted to ISO strings

  • Offset datetime
  • Local datetime
  • Local date/time

Arrays

All array types

  • Standard arrays
  • Arrays of tables
  • Nested arrays

Tables

All table formats

  • Standard tables
  • Inline tables
  • Dotted keys

Error Handling

When your TOML input contains syntax errors, the tool provides clear, actionable feedback to help you fix issues quickly:

Smart Error Detection: The problematic line is highlighted directly in the editor with a descriptive error message. Fix the error and the output updates automatically.

Common errors detected include:

  • Invalid syntax or malformed structures
  • Duplicate keys in the same table
  • Incorrect date/time formats
  • Unclosed strings or brackets
  • Type mismatches in arrays

Your Data Stays Private

Privacy and security are built into the core architecture of this tool:

Traditional Tools

Server-Side Processing

  • Files uploaded to servers
  • Data stored temporarily
  • Potential privacy risks
  • Requires internet connection
This Tool

Client-Side Processing

  • 100% browser-based
  • No data uploads
  • No tracking or analytics
  • Works offline after loading

All conversion happens locally in your browser using WebAssembly. Your TOML data never leaves your device, making it safe to convert sensitive configuration files without any privacy concerns.

Frequently Asked Questions

What is TOML?

TOML (Tom's Obvious Minimal Language) is a configuration file format designed to be easy to read and write due to its clear semantics. It maps unambiguously to a hash table and is designed to be minimal and straightforward.

Popular tools using TOML:

  • Rust — Cargo package manager (Cargo.toml)
  • Python — pip and poetry (pyproject.toml)
  • Hugo — Static site generator (hugo.toml)
  • Alacritty — Terminal emulator configuration
  • Netlify — Deployment configuration

How are TOML dates handled in JSON?

TOML supports native date and datetime types, but JSON does not have built-in date types. This tool converts all TOML date values to ISO 8601 strings in the JSON output.

Date Conversion Example
# TOML Input
published = 2024-01-15T10:30:00Z
updated = 2024-01-20

# JSON Output
{
  "published": "2024-01-15T10:30:00.000Z",
  "updated": "2024-01-20"
}

Supported TOML date formats:

  • Offset datetime: 2024-01-15T10:30:00Z
  • Local datetime: 2024-01-15T10:30:00
  • Local date: 2024-01-15
  • Local time: 10:30:00

Can I convert large TOML files?

Yes. The converter runs entirely in your browser using optimized WebAssembly and can handle large files efficiently.

Performance: Files with thousands of lines convert successfully. For very large files, there may be a brief processing delay (typically under 1 second), but the conversion will complete without issues.

Typical performance:

Small files (< 100 lines) Instant
Medium files (100-1000 lines) < 0.5s
Large files (1000+ lines) < 1s

What TOML version is supported?

This tool uses the smol-toml parser which supports the TOML v1.0 specification, covering all standard TOML features.

Full support includes:

  • Tables and nested tables
  • Arrays of tables
  • Inline tables
  • Dotted keys
  • Multiline strings (basic and literal)
  • All data types (strings, integers, floats, booleans, dates)
  • Comments (preserved during parsing)

Is my data secure?

Absolutely. All conversion happens locally in your browser. Your TOML data is never sent to any server.

Privacy Guarantee: You can safely convert sensitive configuration files, API keys, credentials, or proprietary data without any privacy concerns. The tool works completely offline after the initial page load.

Security features:

  • No server uploads — Files never leave your device
  • No tracking — We don't collect usage data or analytics
  • No cookies — No persistent tracking mechanisms
  • Open source — Code can be audited for transparency
  • Offline capable — Works without internet after loading

What's the difference between Text View and Tree View?

Both views display the same JSON data but optimized for different use cases:

Feature Text View Tree View
Format Raw JSON text Interactive hierarchy
Best For Copying, reviewing exact output Exploring nested structures
Interaction Read-only, scrollable Collapsible nodes
Highlighting Syntax colors Type-based colors
Use Case Code integration, documentation Data exploration, debugging

Pro tip: Use Text View when you need to copy the JSON output, and Tree View when you want to understand the structure of deeply nested data.

Indent:
TOML
JSON
Error

                

Paste TOML data on the left to convert

| |
Paste your Cargo.toml, pyproject.toml, or any TOML config file to convert
Use Sort Keys to alphabetically organize all JSON keys
Switch to Tree View to explore nested data with collapsible nodes
Press Tab in the editor to insert spaces
Click Min for compact single-line JSON output
All conversion happens in your browser — no data is sent to any server
Want to learn more? Read documentation →
1/7
Start typing to search...
Searching...
No results found
Try searching with different keywords