Paste JSON and get idiomatic TOML for Cargo.toml, pyproject.toml, Hugo or any config file. Choose [table] sections or inline tables, keep 64-bit integers exact and see the precise line of any JSON error.
Last updated:
Strict JSON validation and a TOML v1.0 writer run in this tab; nothing is uploaded. Going the other way? Use TOML to JSON. Tip: Ctrl + Enter converts.
Advertisement
Advertisement
How to use the JSON to TOML Converter
Paste your JSON into the left box, drop a .json file on it or press Open .json. A sample config is loaded to start.
Pick the layout: [table] sections or inline tables for nested objects, and [[array of tables]] or inline arrays for lists of objects.
Set the details: date handling, multi-line strings, null values, sorting and indentation.
Fix any JSON error shown under the editors; press Show in input to jump to the exact spot.
name = "demo"
[server]
host = "localhost"
ports = [8080, 8081]
[[users]]
name = "Ada"
[[users]]
name = "Alan"
admin = true
JSON types and their TOML equivalents
JSON
TOML output
Notes
string
"text", 'C:\path', """…"""
Literal strings when the text has backslashes; triple quotes for multi-line text
integer
8080
64-bit signed range
decimal number
0.75, 1.0, 6.02e23
Copied exactly as written
true / false
true / false
Same keywords
ISO date string
2026-03-14T09:30:00Z
Unquoted TOML date-time (optional)
object
[table] or { k = v }
Your choice of layout
array of objects
[[table]]
Or an inline array of inline tables
null
(none)
Left out, "" or commented
Tips for clean TOML
Keys: letters, digits, _ and - stay bare; any other key, such as one with a dot or space, is quoted so it is not read as a nested key.
Cargo and pyproject: tools expect sections like [dependencies] or [tool.poetry], so keep the default [table] layout for those files.
Round trip: paste the output into the TOML to JSON converter to confirm it reads back to the same data.
Frequently asked questions
How is JSON converted to TOML?
The top-level JSON object becomes the root table. Plain values (strings, numbers, booleans, arrays of values) are written first as key = value lines, then nested objects become [table] sections and arrays of objects become [[array of tables]] sections. This order matters in TOML because every key after a header belongs to that table.
What is the difference between [table] sections and inline tables?
Both describe the same data. A section like [server] followed by host = "localhost" is easier to read for larger objects, while an inline table server = { host = "localhost", port = 8080 } keeps small objects on one line. TOML 1.0 inline tables must stay on a single line, so long objects are best as sections. Inline when short picks per object.
Why are null values missing?
TOML has no null type. By default keys with null are left out and the message says how many. You can instead write them as empty strings or keep them as comments so you can see where they were.
Can the top level be an array?
A TOML document is always a table. If you paste a JSON array, it is placed under the key "items", which becomes [[items]] sections for an array of objects. A bare string or number cannot be converted.
How are dates handled?
With ISO strings as TOML dates on, strings such as 2026-03-14, 2026-03-14T09:30:00Z or 07:32:00 that are valid dates or times are written without quotes, so TOML reads them as date-time values. Turn it off to keep them as quoted strings.
Are large numbers kept exactly?
Yes. Numbers are copied from your JSON text rather than through floating point, so 9007199254740993 and 1.0 keep every digit. TOML integers are 64-bit, so an integer beyond ±9,223,372,036,854,775,807 is written as a string with a warning.
Is my JSON uploaded?
No. Parsing and conversion run in JavaScript inside this page, so config files containing secrets never leave your device.
Are all the tools on FreeToolCabin tested for quality and accuracy?
Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.