TOML ⇄ JSON Converter
Rust/Python configs · Bidirectional conversion
TOML conversion
Ready
ABOUT
About TOML ⇄ JSON Converter
Convert between TOML and JSON to edit Rust and Python project configs easily.
Rust Cargo, Python Poetry, Hugo configs—TOML is everywhere in typed and scripting ecosystems. Local conversion lets you inspect pyproject.toml structure without cargo or python -c.
DEEP DIVE
Learn more about TOML ⇄ JSON Converter
TOML (Tom's Obvious Minimal Language) is popular via Rust Cargo, Python Poetry/pyproject.toml, Hugo config, and more. Easier to read than JSON, but JavaScript has no built-in support. JSONSort converts TOML ↔ JSON locally—no Python tomllib or Rust toml crate install.
Preserves tables ([section]) and key/value structure: TOML tables → JSON objects, array of tables → JSON object arrays—quick view of Rust/Python config layout.
TOML tables and dotted keys map to nested JSON objects; [[array of tables]] → JSON object arrays. After conversion, use tree view to confirm [dependencies] and other sections—avoid dotted key vs table conflicts that overwrite.
FEATURES
Core capabilities
TOML → JSON
Parse TOML config files into JSON objects.
JSON → TOML
Generate well-formed TOML text from JSON.
Table support
Handles [section] and [[array of tables]] correctly.
Type preservation
Strings, integers, floats, booleans, and datetimes map correctly.
File import
Drag-and-drop .toml files to parse.
Local conversion
Cargo.toml may contain private crate sources—local is safer.
Date & time
TOML offset datetimes become ISO 8601 JSON strings.
Integer / float
Distinguishes TOML integers vs floats—correct types in JSON.
HOW TO USE
How to use
-
1
Paste TOML or JSON
-
2
Choose conversion direction
-
3
Copy and export results
-
4
On failure, check the error, fix source syntax, and retry
-
5
Pretty-print with the formatter or export for downstream scripts
WORKFLOW
Typical workflow
End-to-end flow from import to export so teams use TOML ⇄ JSON Converter consistently.
Import TOML
Paste Cargo.toml / pyproject.toml or drag a file.
Inspect JSON
Tree view to confirm table and array-of-tables structure.
Edit (optional)
Edit on the JSON side, convert back to TOML, and open a PR.
Pipeline integration
Copy JSON for internal tools that don't support TOML.
USE CASES
Use cases
Rust development
Cargo.toml → JSON, then browse dependencies in tree view.
Python development
pyproject.toml → JSON for CI scripts to read.
DevOps
Unify TOML configs with JSON-based config tooling.
Technical writing
Show JSON equivalents beside TOML examples in docs.
Rust ecosystem
Cargo.toml workspace members and features → JSON for CI matrices.
Static sites
Hugo config.toml → JSON for headless CMS config sync.
TIPS
Tips
- After Cargo.toml conversion, check crate version keys under [dependencies].
- TOML datetimes in JSON are usually ISO 8601 strings.
- JSON → TOML: deep nested objects become dotted keys or subtables.
- vs YAML tool: Rust uses TOML, K8s uses YAML—pick by project.
- On failure, check duplicate keys or unclosed strings in TOML.
- Pretty-print with the formatter for easier Git diff review.
- workspace.dependencies → JSON, then path extract for versions.
- After JSON → TOML, don't mix dotted keys and [table] at the same level.
- On failure, check duplicate keys or unclosed strings in TOML.
- vs YAML tool: pick source format by ecosystem—JSON as the bridge.
LOCAL VS ONLINE
Local vs online tools
JSONSort stays purely frontend—this comparison shows why local tools fit dev data better.
TROUBLESHOOTING
Common pitfalls & fixes
Issues you may hit in practice and how to handle them—save time on trial and error.
Duplicate key error
Tip:TOML forbids duplicate definitions—check dotted key vs table conflicts.
TOML order changed on round-trip
Tip:Functionally equivalent; adjust order manually if order matters.
Wrong date format
Tip:TOML datetime needs timezone; JSON side is ISO string.
Special character keys
Tip:Keys with dots: quote them "key.with.dots".
FAQ
FAQ
Does it support Cargo.toml?
Standard TOML 1.0 syntax. Cargo-specific semantics (e.g. workspace) convert structurally.
Does JSON → TOML lose information?
Any JSON-representable structure converts to TOML. TOML comments are lost going to JSON.
How is this different from the YAML tool?
TOML and YAML syntax differ—pick the tool matching your source format.
Does it support inline tables?
Yes—{ key = "value" } becomes nested JSON objects.
What about lost comments?
TOML comments can't enter JSON—keep the .toml source for comment context.
Is data uploaded to a server?
No. All JSONSort tools run locally in your browser—your input is never sent to any backend.
Do I need to sign up or install anything?
No. Open the page and go—no account, no client download, PWA offline cache supported.
How large can files be?
Depends on browser memory; multi-MB data usually runs smoothly. Split very large files or use merge & clean first.