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)
JSON to TOML Converter

JSON to TOML Converter

Convert JSON data to TOML format instantly. Supports null handling, inline tables, array of tables, and automatic datetime detection.

What is JSON to TOML Converter?

JSON to TOML Converter transforms JSON (JavaScript Object Notation) data into TOML (Tom's Obvious Minimal Language) format. It handles objects, arrays, nested structures, and automatically detects datetime values to produce clean and valid TOML output.

When Do You Need This?

Project Configuration

Convert JSON config files to TOML for tools like Cargo (Rust), Hugo, or Python's pyproject.toml

DevOps Workflows

Transform JSON settings into TOML format for deployment configurations

Data Migration

Move data between systems that use different configuration formats

Learning TOML

See how familiar JSON structures translate to TOML syntax

Your Data Stays Private

100% Client-Side Processing: All conversion happens directly in your browser. Your data never leaves your device, and we don't collect or store any input data.
  • No uploads — Your data never leaves your device
  • No tracking — We don't collect or store any input data
  • No server processing — Everything runs locally in your browser

How to Use

1

Input Your JSON

Paste or type your JSON data into the left panel. You can also click the upload icon to load a JSON file from your device.

2

Automatic Conversion

The TOML output appears automatically in the right panel as you type, with real-time validation and formatting.

3

Adjust Options

Configure conversion settings like null value handling and inline table formatting to match your needs.

4

Export Result

Copy the TOML output to your clipboard or download it as a .toml file for immediate use in your project.

Conversion Options

Null Value Handling

Choose how to handle null values in your JSON:

  • Skip — Omit null keys from output entirely
  • Empty String ("") — Convert null to empty string

Inline Tables

Compact formatting for small objects:

  • Objects with ≤3 primitive keys display as { key = "value" }
  • Produces more readable, compact output

File Upload

Click the upload icon in the toolbar to load a JSON file from your device. The file content will be automatically loaded into the editor and converted to TOML format instantly.

Key Features

Real-time Conversion

JSON is converted to TOML as you type, with intelligent debouncing to optimize performance. Changes to conversion options trigger instant re-conversion, giving you immediate feedback on your output.

Smart Structure Mapping

The converter intelligently maps JSON structures to their TOML equivalents with precision:

JSON Structure TOML Output Example
Objects TOML tables with [table] headers [database]
Nested objects Dotted path notation [server.config]
Arrays of objects Array of tables syntax [[products]]
Primitive arrays Inline arrays ["a", "b", "c"]
Primitives Direct value mapping port = 8080

Null Value Handling

TOML Limitation: TOML does not natively support null values. This converter provides two strategies to handle this limitation effectively.
Skip Strategy

Omit Null Keys

  • Null keys don't appear in output
  • Warning message shows omitted keys
  • Cleaner output for optional fields
Convert Strategy

Empty String Conversion

  • Null becomes ""
  • Preserves all keys in output
  • Maintains structure consistency

Inline Tables

Small objects with up to 3 primitive values can be displayed as TOML inline tables instead of separate table sections, producing more compact and readable output.

Inline Table Example
# Without inline tables
[point]
x = 1
y = 2
z = 3

# With inline tables enabled
point = { x = 1, y = 2, z = 3 }

Datetime Detection

Strings matching RFC 3339 date, time, or datetime patterns are automatically recognized and output as bare TOML datetime values without quotes, ensuring proper type handling.

  • Date format: 2024-01-15
  • Datetime format: 2024-01-15T10:30:00Z
  • Time format: 10:30:00

Smart Key Quoting

JSON keys containing spaces, dots, or special characters are automatically quoted in the TOML output for validity. Simple alphanumeric keys use bare format for maximum readability.

Key Quoting Examples
# Simple keys (no quotes needed)
name = "John"
age = 30

# Special keys (automatically quoted)
"user.name" = "John"
"first name" = "John"
"api-key" = "secret"

Status Bar

The bottom status bar provides real-time feedback on your conversion:

  • Validation state — Shows Valid, Invalid, or Ready status
  • Key count — Total number of keys in the output
  • File size — Output size in bytes for download planning

Frequently Asked Questions

Why can't I convert a JSON array as the root?

TOML requires the root to be a table (key-value pairs). A JSON array at the root level has no equivalent in TOML specification.

Solution: Wrap your array in an object first. For example:

Wrapping Array Example
// Instead of: [1, 2, 3]
// Use:
{
  "items": [1, 2, 3]
}

How are null values handled?

TOML has no null type. You can choose between two strategies:

  • Skip — Null keys won't appear in the output. A warning message shows which keys were omitted.
  • Convert to empty string — Null values become "", preserving all keys in the output.

Select the strategy that best fits your use case in the conversion options.

What are inline tables?

Inline tables are a compact TOML syntax for small objects, displayed on a single line:

Inline Table Format
point = { x = 1, y = 2 }

Enable the Inline Tables option to use this format for objects with up to 3 primitive values. This produces more compact and readable output for simple structures.

How are arrays of objects converted?

Arrays where every element is an object become TOML array of tables using the [[name]] syntax:

Array of Tables Example
[[products]]
name = "Hammer"
price = 9.99

[[products]]
name = "Nail"
price = 0.05

Note: Mixed arrays (containing both objects and primitives) are treated as inline arrays instead.

Are datetime strings automatically detected?

Yes. Strings matching RFC 3339 patterns are automatically recognized and output as bare TOML datetimes without quotes:

  • 2024-01-15 — Date format
  • 2024-01-15T10:30:00Z — Datetime with timezone
  • 10:30:00 — Time format

This ensures proper type handling and compatibility with TOML parsers.

Is there a size limit?

Since all processing happens in your browser, the practical limit depends on your device's available memory and processing power.

Performance Note: The converter handles large JSON files efficiently, but extremely large datasets (several MB) may cause slower performance on older devices.

For optimal performance, we recommend files under 5MB. Larger files will still work but may take longer to process.

Null:
JSON
TOML
Error
Warning

                

Paste JSON on the left to convert to TOML

|
Paste or type JSON on the left panel to see TOML output on the right
Use Null: Skip to omit null values, or "" to convert them to empty strings
Enable Inline Tables to display small objects as { key = "value" }
Click the cube icon to load sample config-style data
TOML root must be an object — arrays and primitives are not valid TOML root values
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