Home/Text & Encoding/TOML ↔ JSON
Back to tools

TOML ↔ JSON Converter

Convert between TOML and JSON formats with syntax validation and proper formatting

Examples:

About TOML and JSON

  • TOML (Tom's Obvious, Minimal Language) is designed for configuration files
  • JSON (JavaScript Object Notation) is a lightweight data interchange format
  • • TOML is more readable for humans, especially for configuration
  • • JSON is more widely supported and used in APIs
  • • TOML supports comments, dates as first-class values, and multi-line strings
  • • Both formats are commonly used in modern applications

Conversion Notes:

  • • TOML comments are not preserved when converting to JSON
  • • Date/time values in TOML become ISO 8601 strings in JSON
  • • Arrays of tables in TOML become arrays of objects in JSON
  • • Some JSON structures may not have a clean TOML representation
  • • Unicode and special characters are preserved

TOML Features:

  • • Tables: [table] for objects
  • • Array of tables: [[array]]
  • • Comments: # This is a comment
  • • Multi-line strings: """ or '''
  • • Dates and times: native support