Skip to main content

TOON JSON Converter

TOON JSON Converter is a powerful Python-based command-line tool that enables seamless bidirectional conversion between TOON (a human-readable structured data format) and JSON/JSONL formats. With automatic format detection and support for both single-file and batch conversions, it’s designed to make data transformation effortless.

What is TOON?

TOON is a structured data format designed to be more readable and writable than JSON while maintaining full compatibility with JSON’s data model. It features:
  • Cleaner syntax with minimal punctuation
  • Tabular data support for arrays of objects
  • Flexible delimiters (comma, tab, pipe)
  • Key folding for nested structures
  • Human-friendly with optional line markers

Key Features

Bidirectional Conversion

Convert seamlessly between TOON and JSON formats in both directions with automatic format detection

Batch Processing

Process entire folders of files or convert JSONL files to multiple TOON files in one command

Flexible Configuration

Customize output with multiple delimiter options, indentation settings, and formatting preferences

Format Preservation

Maintains data integrity with proper type handling, escaping, and round-trip conversion support

Conversion Modes

The converter automatically detects the conversion direction based on file extensions:
InputOutputDescription
.json file.toon fileSingle JSON document to TOON format
.jsonl fileFolder of .toon filesMultiple JSON objects to individual TOON files
.toon file.json fileSingle TOON document to JSON format
Folder of .toon files.jsonl fileMultiple TOON files to JSON Lines format

Quick Example

Convert a JSON file to TOON format:
python toon_json_converter.py data.json
The tool automatically creates data.toon with a human-readable representation:
{
  "name": "Alice",
  "age": 30,
  "cities": ["New York", "London", "Tokyo"]
}

Use Cases

  • Data interchange between systems with different format requirements
  • Human-readable data storage for configuration files and datasets
  • Data transformation pipelines with support for batch processing
  • API response formatting to make data more accessible
  • Database exports to readable tabular formats

Next Steps

Installation

Get started by installing the converter

Quickstart Guide

Learn the basics with practical examples

CLI Reference

Explore all command-line options

TOON Format

Understand the TOON format specification

Build docs developers (and LLMs) love