TOML to JSON
Convert TOML config into indented JSON, with exact integers and clear error locations.
TOML input
JSON output
Paste TOML to see JSON
Conversion runs locally; nothing is uploaded.
Details
TOML to JSON parses TOML 0.5 and most TOML 1.0 syntax — tables, arrays of tables, dotted keys, inline tables, dates and multiline strings — and emits indented JSON. Integers beyond 2^53 are written as exact decimal digits with a warning that JavaScript's JSON.parse will round them; date-times become ISO strings because JSON has no date type; inf and nan become null. Invalid input such as duplicate keys or impossible calendar dates gets a line-and-column diagnostic instead of a silent correction. Everything runs locally.
More examples
Package manifest
[package]
name = "devtools"
version = "1.0.0"
tags = ["tools", "web"]Tables become JSON objects and TOML arrays become JSON arrays; the output is indented two spaces by default.
Dates and large integers
released = 1979-05-27T07:32:00Z
id = 9223372036854775807The date becomes an ISO string and the 64-bit integer stays exact in the text, with warnings explaining both mappings.
Duplicate key
name = "a"
name = "b"TOML forbids duplicate keys, so conversion is blocked with the offending position while the input is preserved for editing.
Examples
Manifest
[package]
name = "devtools"
version = "1.0.0"
tags = ["tools", "web"]{
"package": {
"name": "devtools",
"version": "1.0.0",
"tags": ["tools", "web"]
}
}A table header becomes an object and the TOML array becomes a JSON array.
Lossy values
released = 1979-05-27T07:32:00Z
id = 9223372036854775807
score = nan{
"released": "1979-05-27T07:32:00.000Z",
"id": 9223372036854775807,
"score": null
}The date becomes a string, the integer keeps all digits and nan becomes null; each mapping is warned about.
About this tool
TOML to JSON turns configuration written in TOML into indented JSON you can paste into an API payload, a fixture or another tool. The converter runs entirely in your browser and implements the TOML value grammar directly, with no parser dependency and no upload.
It understands tables, arrays of tables, dotted keys, inline tables, multiline strings, dates and signed 64-bit integers. Invalid input produces a line-and-column diagnostic rather than a silent repair, and every mapping JSON cannot represent exactly is called out in a warning.
What this tool does not do
- The parser covers TOML 0.5 and the common TOML 1.0 grammar, not experimental extensions.
- Offset date-times are normalised to UTC; the original offset is not kept in the JSON string.
- Integers beyond 2^53 stay exact in the text but lose precision when JavaScript parses them.
- TOML requires a table at the root, so a bare array document is rejected.
How to use this tool
Paste or upload TOML
Type into the input panel, use the File action, or choose one of the example chips.
Read the diagnostics
Errors show the offending line and column; warnings explain dates, big integers and inf/nan.
Copy the JSON
Copy the result or download converted.json.
Fix in place
Your original TOML is never replaced, so you can edit the failing line and watch the result update.
Use cases
Config migration
Move a Cargo, Poetry or app config into a JSON pipeline without hand-editing keys.
Test fixtures
Keep readable TOML in docs and generate JSON fixtures for JavaScript test runners.
API payloads
Paste a TOML example into a JSON request body while keeping the source readable.
How TOML values map to JSON
| TOML | JSON |
|---|---|
| string, boolean | string, boolean |
| integer | number |
| float | number |
| date / date-time | string |
| inf / nan | null |
| [table] / [[array of tables]] | object / array of objects |
A comment-only or empty document converts to an empty JSON object.
Common mistakes
Mistake:Assuming a date-time stays a typed date.
Fix:JSON has no date type. Parse the ISO string into a Date in the consumer if you need one.
Mistake:Trusting large integers after JSON.parse.
Fix:The JSON text is exact, but JavaScript rounds above 2^53. Quote such identifiers in TOML.
Mistake:Expecting duplicate keys to be last-wins.
Fix:TOML rejects duplicates. The tool reports the second definition instead of choosing one.
Frequently asked questions
Does this upload my TOML file?
No. The parser, converter and diagnostics all run in your browser tab. There is no network request, account or storage.
Why is a TOML date a string in the JSON?
JSON has no date type. Date, time and date-time values are written as ISO-style strings, and offset date-times are normalised to UTC. A warning explains the mapping.
Why do I see a warning for a large integer?
The JSON text keeps the exact 64-bit digits, but JavaScript's JSON.parse rounds values above 2^53. Quote identifiers that need to survive as strings.
What happens to inf and nan?
They become null because JSON cannot express them. The warning lets you decide whether to represent them as strings instead.
Why was my conversion blocked?
TOML forbids duplicate keys, duplicate table headers, impossible dates and integers outside the signed 64-bit range. The tool shows the exact line and column so you can fix the source.
Related guides
TOML vs YAML vs JSON: Choosing the Right Config Format
Why Rust and Python both settled on TOML, what each format actually gives you, and how to validate your Cargo.toml without guessing.
Moving Configuration Between TOML, JSON and YAML: What Survives the Trip
Converting config formats sounds trivial until your dates vanish, your comments disappear, and your multiline string gets folded into one line.
References & standards
Related tools
Base32 Encoder / Decoder
Encode and decode Base32 (RFC 4648) with hex input mode and Crockford variant. Handles TOTP secrets. Runs in-browser.
Base58 Encoder / Decoder
Convert hex or text to Base58 and back, with Base58Check validation (version byte + checksum). IPFS CIDs too. In-browser.
Base64 Toolbox
Professional Base64 workspace for text, files and images with Base64URL, MIME, Data URI, strict validation, image preview and ready-to-use snippets.
BibTeX to JSON Converter
Parse .bib bibliographies into structured JSON with authors, months, macros and LaTeX cleanup, all in-browser.
C# to VB.NET Converter
Convert a subset of C# — classes, methods, variables, loops — into VB.NET
CSV Data Viewer
Paste CSV and inspect it as a sortable, searchable table with delimiter detection and inline export.