Convert JSON to TOML
Turn a JSON object into a valid TOML config file for Cargo, pyproject or your own app. You are told about anything TOML cannot hold. All in your browser.
- No registration
- No server involved
- TOML dates detected
- Nulls reported
- Runs on your device. Files are never uploaded.
- Free and unlimited. No sign-up, no watermark.
JSON to TOML in three steps
No account, no email, no waiting for an upload.
- STEP 01
Bring in your JSON
It should be an object at the top level, since TOML starts with keys.
- STEP 02
Decide about dates
Leave 'Write date and time strings as TOML dates' on to turn values like 2024-03-01 into real TOML dates.
- STEP 03
Copy or download the TOML
The note lists adjustments made, such as nulls left out.
What JSON to TOML does, and what it doesn't
We'd rather tell you up front than surprise you after the download.
What you get
- Proper tablesNested objects become [table] sections, and lists of objects become [[array of tables]].
- Date and time detectionStrings in ISO form, such as 2024-03-01, 2024-03-01T09:30:00Z or 07:32:00, are written as TOML date and time values. You can turn this off.
- Honest about nullsTOML has no null. Null values are left out and the note says how many.
- Top-level lists handledA JSON list at the top is placed under an 'items' key, with a note, because TOML must start with keys.
- Clear failuresA single number or string at the top level is rejected with an explanation.
Good to know
- Nulls are removedIf null means something in your data, replace it with an explicit value first.
- 1.0 and 1 look the sameThe browser reads JSON numbers without keeping the difference between 1.0 and 1, so whole-valued floats become integers.
- No commentsJSON has none. Add comments to the TOML afterwards.
Your data never leave your device
The tool runs inside your browser instead of on our servers, so there is nothing to upload, store or delete afterwards.
Typical online tool upload
Your file travels over the internet, sits on someone else's computer for a while, and you wait for the upload and the download.
Mediaextractr no upload
The tool loads into your browser once, then works on your file locally. Nothing is sent, so nothing can leak.
When people use JSON to TOML
Migrate a config to TOML
Move settings from JSON into a tool that reads TOML, such as a Rust or Python project.
Draft a TOML file from an API result
Start from JSON you already have.
Compare formats
See how the same data looks in JSON, YAML and TOML.
Prepare deployment settings
Create a clean file for a tool that prefers TOML.
Mediaextractr vs typical upload tools
| MediaextractrPrivate | Typical upload tools | |
|---|---|---|
| Your file is uploaded | Never | Yes |
| Sign-up needed | No | Often, after a few files |
| Daily file limit | None | Often 1–2 free files |
| Watermark | Never | Sometimes |
| Wait for upload & download | No | Yes |
| Speed on very large files | Depends on your device | Depends on their servers |
How JSON becomes TOML
Simple values become key = value lines. Objects become tables with a header like [server]. Lists of objects become repeated [[servers]] headers. Strings are quoted, and numbers and booleans are written plainly.
Because TOML is typed more strictly than JSON, the converter can only produce a valid file for data that fits its model.
What TOML cannot hold
Be aware of these limits before you convert:
- No null. Those keys are dropped, and you are told.
- The top level must be a table. A plain list is wrapped under items.
- Dates are a real type. If a string only looks like a date by accident, turn the date option off.
- Go back with TOML to JSON, or convert from YAML to TOML.
Using the TOML
Tools like Cargo, Poetry and Hugo expect particular table names, so treat the output as a starting point. Rename tables to match what the tool reads, and put simple values before sub-tables for readability. If the note says nulls were dropped, decide whether the missing keys should get real default values.
Questions, answered
How do I convert JSON to TOML?
Paste a JSON object, and copy the TOML it produces.
What happens to null values?
TOML has no null, so those keys are left out and the result tells you how many.
Can it convert a JSON array?
Yes. The list is put under an items key, because TOML files must begin with keys.
Is my JSON sent to a server to be turned into TOML?
No. The conversion runs in your browser tab and the document is not uploaded.
Why did a string become a date?
Strings in ISO date or time form are written as TOML date values. Switch off the date option to keep them as text.
Can I convert on a phone or tablet?
Yes. Safari and Chrome on iOS and Android run the converter. Copy the TOML into your editor app.