# TOML-JSON Converter

Convert between TOML and JSON formats with support for comments and complex data structures

> Canonical page: https://elysiatools.com/en/tools/toml-json-converter

- **Category:** Format Conversion

- **Keywords:** toml, json, convert, transform, toml converter, json to toml, toml to json, config, configuration

## Overview

The TOML-JSON Converter is a reliable utility designed to seamlessly transform configuration data between TOML and JSON formats, ensuring your complex data structures remain intact during the conversion process.

## Inputs

- **Input Data** (textarea): Enter TOML or JSON data...
- **Conversion Direction** (select)
- **JSON Indent Size** (number): Enter indent size for JSON output (1-8)

## When to use

- When migrating configuration files from TOML-based systems to JSON-based environments.
- When you need to validate or inspect the structure of a TOML file by viewing it as JSON.
- When preparing JSON-based application settings for use in tools that require TOML syntax.

## How it works

- Paste your source TOML or JSON data into the input field.
- Select your desired conversion direction (TOML to JSON or JSON to TOML).
- Adjust the JSON indent size if necessary to improve readability.
- Click convert to generate and copy your transformed data.

## Use cases

- Standardizing configuration files across different microservices.
- Quickly debugging TOML configuration errors by converting them to JSON for validation.
- Updating legacy application settings to modern JSON-based formats.

## Frequently asked questions

### Does this tool support nested data structures?

Yes, the converter fully supports nested tables, arrays, and complex data structures in both formats.

### Can I convert JSON back to TOML?

Yes, simply select 'JSON to TOML' in the conversion direction settings.

### Is there a limit to the size of the data I can convert?

The tool is designed for standard configuration files; very large datasets may be limited by your browser's memory.

### Does the converter preserve comments?

While the tool parses the data structure, comments in the original file may not be preserved in the output format.

### Can I customize the output formatting?

Yes, you can specify the JSON indent size from 1 to 8 spaces to match your preferred coding style.

## Related tools

- [HCL-JSON Converter](https://elysiatools.com/en/tools/hcl-json-converter): Convert between HashiCorp Configuration Language (HCL) and JSON formats for Terraform configurations
- [YAML-JSON Converter](https://elysiatools.com/en/tools/yaml-json-converter): Convert between YAML and JSON formats
- [Text to Excel Converter](https://elysiatools.com/en/tools/text-to-excel): Convert various text formats to Excel with customizable parsing and formatting options
- [Text to JSON Converter](https://elysiatools.com/en/tools/text-to-json): Convert various text formats to JSON with customizable parsing options
- [BOM Character Remover](https://elysiatools.com/en/tools/data-bom-remover): Remove BOM (Byte Order Mark) characters from text and file content. Perfect for cleaning up text files that have encoding issues, fixing CSV imports, and preparing data for processing. Features: - Detect and remove UTF-8 BOM (EF BB BF) - Detect and remove UTF-16 BOM (FE FF or FF FE) - Detect and remove UTF-32 BOM (00 00 FE FF or FF FE 00 00) - Support multiple input formats - Visual BOM character display - Detailed detection report - Support for batch text processing Common Use Cases: - Fix CSV file import errors - Clean up text file encoding issues - Prepare data for JSON parsing - Fix XML parsing problems - Resolve API data encoding conflicts - Standardize text data format
- [JSON Key Extractor](https://elysiatools.com/en/tools/json-key-extractor): Extract all keys from JSON objects with multiple output formats. Perfect for analyzing JSON structure, documentation generation, and understanding complex nested objects.
- [BSON Converter](https://elysiatools.com/en/tools/bson-converter): Encode and decode data to/from BSON (Binary JSON) format
- [CSON to JSON Converter](https://elysiatools.com/en/tools/cson-to-json): Convert CSON (CoffeeScript Object Notation) data to JSON format

## Samples

- [Chat Transcript JSON Samples](https://elysiatools.com/en/samples/chat-transcript-json): JSON examples for multi-role chat transcripts
- [Rich Media JSON Samples](https://elysiatools.com/en/samples/rich-media-json): JSON examples for popular rich text editors (TipTap, Quill, Slate)
- [JSON Samples](https://elysiatools.com/en/samples/json): JSON (JavaScript Object Notation) format examples from simple to complex structures
- [Terraform Plan JSON Samples](https://elysiatools.com/en/samples/terraform-plan-json-samples): Sample Terraform plan JSON files exported from terraform show -json style payloads for dependency visualization and change review

## Related content

- [Environment and Configuration Format Workflow](https://elysiatools.com/en/hubs/config-workflows): Inspect, validate, convert, merge, and diff configuration without exposing secrets or losing the source of truth.
- [JSON Normalization and Interchange Workflow](https://elysiatools.com/en/hubs/json-convert): Turn a structured source into a checked JSON representation, then export the exact table, configuration, document, API, XML, CSON, EDN, BSON, or UBJSON form required downstream.
