JSON to TOML Converter
The JSON to TOML Converter turns JSON (JavaScript Object Notation) data into clean, valid TOML (Tom's Obvious Minimal Language). Paste your JSON on the left and the TOML output appears on the right as you type, with objects, nested structures, arrays of objects, and datetime values mapped to the right TOML syntax automatically.
It is built for the config files that use TOML — Cargo's Cargo.toml for Rust, Python's pyproject.toml, Hugo, and similar tools — as well as DevOps settings and data migrations between systems that speak different formats. If you are learning TOML, it is also a quick way to see how a JSON structure you already know translates into TOML tables and keys.
How to Use
Add your JSON
Paste or type JSON into the left panel, or click Upload File to load a .json file from your device. Press Sample Data for a ready-made config example to try.
Watch it convert
The TOML output appears automatically in the right panel. The status bar shows whether the input is Valid or Invalid, along with the key count and output size.
Tune the options
Set Null to Skip (omit null keys) or "" (turn them into empty strings), and toggle Inline Tables to keep small objects compact. The output re-converts instantly.
Copy or download
Use Copy to put the TOML on your clipboard, or Download to save it as a .toml file. Clear empties both panels to start over.
Features
Real-Time Conversion
JSON is converted to TOML as you type, and changing any option re-converts the output instantly.
Smart Structure Mapping
Objects become [table] headers, nested objects use dotted paths like [parent.child], and primitive arrays stay inline.
Array of Tables
Arrays where every element is an object are written as TOML array of tables using [[array]] syntax.
Inline Tables Toggle
Small objects with up to three primitive values can be rendered as compact inline tables like { key = "value" }.
Null Handling
TOML has no null type, so choose to skip null keys (with a warning) or convert them to empty strings.
Datetime Detection
Strings matching RFC 3339 date, time, or datetime patterns are output as bare TOML datetimes without quotes.
Automatic Key Quoting
Keys with spaces, dots, or special characters are quoted automatically, while simple keys stay bare for readability.
Upload & Download Files
Load a JSON file straight from your device and save the result as a .toml file in one click.
Validation & Warnings
Invalid JSON shows a clear error message, and warnings flag values that cannot map cleanly into TOML.
Status Bar Stats
A bottom status bar reports the Valid / Invalid / Ready state, the total key count, and the output file size.
Frequently Asked Questions
How do I convert JSON to TOML?
Paste or type your JSON into the left panel, or upload a .json file. The TOML appears in the right panel automatically as you type. From there you can copy it or download it as a .toml file — there is nothing to install or sign up for.
Is the conversion done in my browser, and is my data safe?
Yes. All parsing and conversion happen locally in your browser, including files you upload — they are read on your device and never sent to a server. Your JSON is not stored or tracked.
What is the difference between JSON and TOML?
Both describe structured data, but TOML is designed to be an obvious, human-friendly configuration format. It uses [table] headers, dotted paths, and bare datetimes, and its root must always be a table. JSON is more general-purpose and allows arrays, primitives, or null at the root, none of which TOML accepts there.
Why can't I convert a JSON array as the root?
TOML requires the root to be a table of key-value pairs, so a top-level JSON array has no equivalent. Wrap your array in an object first, for example {"items": [1, 2, 3]}, and it will convert cleanly.
How are null values handled?
TOML has no null type, so you choose how to handle them with the Null option. Skip omits null keys from the output and shows a warning listing which keys were dropped, while "" converts them to empty strings.
Does it support nested objects and arrays of objects?
Yes. Nested objects become dotted sub-tables like [parent.child], and arrays where every element is an object are written as a TOML array of tables using [[name]]. Mixed arrays that contain both objects and primitives are treated as inline arrays instead.
What are inline tables?
Inline tables are a compact TOML syntax for small objects, such as point = { x = 1, y = 2 }. Enable the Inline Tables option to use this format for objects that have up to three primitive values, producing a more compact result.
Are datetime strings detected automatically?
Yes. Strings matching RFC 3339 patterns — like 2024-01-15, 2024-01-15T10:30:00Z, or 10:30:00 — are output as bare TOML datetimes without quotes, so they stay valid datetime values rather than plain strings.
Is there a size limit?
There is no fixed limit. Because everything runs in your browser, the practical ceiling depends on your device's memory. The converter handles large JSON files efficiently, though extremely large datasets may convert more slowly.
No comments yet. Be the first to comment!