TOML to JSON Converter
This TOML to JSON converter turns TOML configuration into clean JSON right in your browser, updating the output as you type. TOML (Tom's Obvious Minimal Language) powers files like Rust's Cargo.toml, Python's pyproject.toml, and Hugo's hugo.toml, and this tool maps each TOML structure to its JSON equivalent instantly.
Paste TOML, type it by hand, or upload a .toml file, then read the result as syntax-highlighted text or an interactive tree. It is built for developers migrating config, debugging a tricky file, or feeding TOML data into a JSON-based API.
How to Use
Add your TOML
Paste or type TOML into the left editor, click Upload File to load a .toml file from your device, or hit Sample Data for an example Cargo.toml.
Read the JSON
The JSON output appears automatically on the right as you type. The status bar shows a Valid, Invalid, or Ready state along with line, key, and size counts.
Format the output
Set Indent to 2, 4, or 8 spaces, or pick Min for compact one-line JSON. Toggle Sort Keys to alphabetize every key, and switch between Text and Tree views.
Copy or download
Use Copy to send the JSON to your clipboard, or Download to save it as a data.json file.
Features
Real-Time Conversion
Output updates automatically as you type with a short debounce, and instantly when you paste content.
Syntax Highlighting
JSON output is color-coded by type, with distinct colors for keys, strings, numbers, booleans, and null values.
Collapsible Tree View
Explore nested data as an interactive hierarchy, expanding or collapsing each object and array with item counts shown.
Indent & Minify Options
Choose 2, 4, or 8 spaces of indentation, or minify the JSON to a single compact line.
Sort Keys
Toggle alphabetical sorting to order every JSON key at every level of nesting.
Full TOML Type Support
Handles strings, integers and floats, booleans, dates, arrays, arrays of tables, inline tables, and dotted keys.
Date to ISO Strings
TOML date and datetime values, which JSON has no native type for, are converted to ISO 8601 strings.
Clear Error Reporting
When TOML is invalid, a plain error message appears and the problem line is highlighted in the editor.
Upload, Sample & Export
Upload a .toml file, load a sample Cargo.toml, then copy the JSON or download it as data.json.
Live Status Bar
A status bar reports the validation state plus running line, key, and output size statistics.
Frequently Asked Questions
How do I convert a TOML file to JSON?
Paste your TOML into the left editor or click Upload File to load a .toml file. The JSON output appears automatically on the right, ready to copy or download as data.json.
Is the conversion done in my browser?
Yes. Every conversion runs locally in your browser and your TOML is never sent to any server. You can safely convert sensitive configuration files without privacy concerns.
Are TOML comments kept in the JSON output?
No. JSON has no concept of comments, so the converter parses TOML into data and outputs only that data. Lines starting with # in your TOML are dropped from the JSON result.
Can I upload a .toml file or only paste text?
Both. Click Upload File to load a .toml file from your device, or paste and type TOML directly in the editor. You can also load a sample Cargo.toml with one click.
What happens to TOML dates and arrays of tables?
TOML date and datetime values are converted to ISO 8601 strings, since JSON has no native date type — for example 2024-01-15T10:30:00Z becomes "2024-01-15T10:30:00.000Z". Arrays of tables map to JSON arrays of objects, exactly as you would expect.
What is the difference between Text and Tree views?
Text view shows the raw JSON with syntax highlighting, ideal for copying or reviewing the exact output. Tree view shows a collapsible hierarchy, ideal for exploring deeply nested structures and understanding the data layout.
Which TOML version is supported?
The converter supports the TOML v1.0 specification, covering tables, arrays of tables, inline tables, dotted keys, multiline strings, and every standard data type. Large files convert fully in the browser, with at most a brief delay on very large inputs.
No comments yet. Be the first to comment!