TOML to JSON Converter
Convert TOML configuration text to JSON format with custom indentation and optional key sorting.
Run tool
This online tool converts TOML configuration text into structured JSON format. You can paste configuration tables, key-value pairs, nested sections, inline arrays, and scalar values into the input field to generate formatted JSON output. The converter handles standard TOML data types, translating nested tables into nested JSON objects, lists into JSON arrays, and date, time, or datetime entries into ISO-formatted strings. Adjust the output structure to suit your workflow by configuring the indentation space count or sorting object keys alphabetically. Setting indentation to zero produces compact JSON, while positive numbers format lines for readability. Leaving the input empty produces an empty JSON object structure. If the source text contains syntax errors or invalid formatting, the conversion stops and displays an error message rather than invalid data. Use this converter to prepare configuration files for web services, migrate project settings between tools, or inspect TOML payloads in standard JSON format.
Instructions
- Paste or type your TOML text into the TOML input area.
- Set the indentation spacing to your preferred number of spaces, or leave it at 2 for standard formatting.
- Check the sort keys option if you want output keys ordered alphabetically.
- Click the convert button to transform the TOML text into JSON.
- View or copy the formatted JSON text directly from the result panel.
Examples
- Converting a basic package manifest: entering package metadata with name and version fields generates a clean JSON object with those nested properties.
- Converting server settings with timestamps: entering host, port, and ISO datetime entries produces structured JSON with numeric values and standardized ISO date strings.
FAQ
How are TOML dates and times converted into JSON?
TOML dates, times, and timestamps are serialized as ISO-8601 formatted text strings in the JSON output.
What happens if I submit empty or whitespace-only input?
Submitting an empty text field or whitespace produces an empty JSON object in the result area.
Can this tool fix invalid TOML syntax?
No, the converter requires valid TOML syntax. If the input text has syntax mistakes or unsupported characters, the conversion stops and reports an error.
How does the key sorting option work?
When enabled, the converter sorts all object keys in alphabetical order throughout the resulting JSON structure.