{ }jsonkit
Format
Validate
Convert
Query
Generate
⇄toml

JSON to TOML & TOML to JSON Converter Online

Convert configuration data in either direction without an upload.
232 B · paste or drop a file
1 2 3 4 5 6 7 8 9
✓ complete232 B → 199 B0.0 ms

About JSON ⇄ TOML

The JSON and TOML converter moves configuration data between strict JSON and readable TOML. JSON objects become root keys and named tables, nested objects become nested tables, and arrays of objects become TOML array tables. The reverse direction produces formatted JSON for tools that do not read TOML.

Both conversions run in the browser and do not upload configuration content. That is useful when files include internal hostnames, feature flags or service settings. Use the direction switch to change formats while keeping one focused workspace for copying and review.

The built-in TOML reader covers the structures most often used in application configuration: standard and dotted keys, tables, array tables, primitive arrays, inline tables, booleans, numbers, strings and date-like values. Multiline strings and the full set of TOML numeric spellings are outside this dependency-free subset and are reported rather than silently misread.

How it works

Turn nested objects into TOML tables

Scalar values are written as key-value pairs and nested JSON objects receive table headers such as [server.database]. Keys that are not valid bare TOML keys are quoted automatically.

Represent arrays of objects as array tables

A JSON array whose elements are objects is emitted with repeated [[table]] headers. Primitive arrays stay inline, preserving the distinction between a list of values and a list of structured records.

Parse comments without altering quoted text

In TOML-to-JSON mode, hash comments are removed only when they appear outside quoted strings. Table paths, dotted keys and inline collections are then built into the corresponding nested JSON structure.

Handle the JSON null mismatch explicitly

TOML has no null value. JSON-to-TOML conversion therefore stops with an explanation when it encounters null instead of inventing a string, deleting the key or making another lossy choice without your approval.

Frequently asked questions

Can TOML represent JSON null?

No. TOML has no null type. Remove the field or choose an application-appropriate replacement before converting JSON that contains null.

Are TOML comments preserved when converting to JSON?

No. JSON has no comment syntax, so comments are ignored during parsing. The data values and hierarchy are converted, but explanatory comments cannot round-trip through JSON.

Does the converter support every TOML 1.0 feature?

It supports common tables, array tables, arrays, inline tables and scalar values. Multiline strings and some specialized number or date forms are not part of this lightweight parser.

Why must JSON-to-TOML input be an object?

A TOML document is a set of keys and tables, so it needs a root mapping. Wrap a root JSON array or primitive in a named object property before converting it.