TOML to JSON
Paste TOML and get JSON in this tab, or convert a JSON object back to TOML. This page uses the same smol-toml converter already offered under Configuration to JSON on JSON Formatter. Dates and some numbers are written as strings. Nothing is uploaded.
Input
Result
How to use TOML to JSON
- Paste or open a fileType, paste, or open a .toml or .json file. The limit is 1 MB, the same cap as Configuration to JSON on JSON Formatter.
- Choose a directionConvert TOML to JSON, or a JSON object back to TOML. For JSON output, pick an indent of 2 or 4 spaces.
- Copy or downloadCopy the result or download output.json or output.toml. If the input is invalid, an error is shown instead of the contents.
Limits and how it works
- The input is limited to 1 MB of UTF-8 text, including files you open. That matches the existing smol-toml converter on JSON Formatter.
- TOML keys named __proto__, prototype, or constructor, and some unsafe nested keys, are rejected.
- A syntax error is reported without repeating the input. The file is not repaired automatically.
- JSON to TOML cannot start from an array or a primitive at the root.
How TOML becomes JSON
TOML to JSON reuses convertConfigToStructured, already used on JSON Formatter. The parser is smol-toml 1.9.1 (BSD-3-Clause), with a maximum depth of 64. Integers outside JSON’s safe range become decimal strings. Non-finite floats become the strings nan, inf, or -inf. Dates and times become ISO strings with millisecond precision; local dates and times keep a timezone-free shape.
JSON to TOML uses smol-toml’s stringify on a JSON object. The root must be an object, not an array or a single value. Stringified dates and large integers stay text; they are not turned back into TOML date or integer types automatically.
This is a converter, not a YAML tool. Use YAML to JSON or JSON to YAML if your file is YAML.
Frequently asked questions
Is my text or file uploaded?
No. Everything runs in your browser tab with JavaScript. Nothing you type, paste or drop is sent to a server, logged or stored by ALink Tools.
Is this the same as the box on JSON Formatter?
Yes for TOML to JSON. That page’s Configuration to JSON section uses the same converter, and also accepts INI and dotenv. This page is the dedicated TOML entry, and it can also write TOML from a JSON object.
Why did a date or a large number become a string?
JSON cannot represent every TOML type exactly. Dates are written as ISO strings with millisecond precision. Integers larger than 2^53−1, and non-finite floats, are written as decimal or named strings so the value is not rounded or turned into null.
Can I convert JSON to TOML?
Yes, if the JSON root is an object. Arrays and single values at the root are rejected because a TOML document must start with a table.
Related tools
All toolsJSON Formatter & Validator
Format, minify, sort keys, and catch syntax errors cleanly.
YAML to JSON
Convert YAML to JSON in your browser with js-yaml. Read multiple documents in one file and get an error for duplicate keys.
JSON to YAML
Convert JSON to YAML in your browser with js-yaml. Set the indentation and sort keys if you need a consistent output.
YAML Formatter
Format, compact, or validate YAML in your browser with js-yaml.