JsonToonCraft for VS Code
Transform JSON to TypeScript, Zod, OpenAPI & TOON format instantly - right in your editor!

Features
🚀 Instant Conversion: Convert JSON with a single command
🎯 Multiple Formats: TypeScript, Zod, OpenAPI, TOON
💾 Flexible Output: Replace, insert, copy, or open in new file
⌨️ Keyboard Shortcuts: Fast workflow with keybindings
🔒 100% Local: All processing happens in your editor
📦 Zero Config: Works out of the box
Supported Conversions
- JSON → TypeScript Interfaces - Type-safe interfaces with nested support
- JSON → Zod Schemas - Runtime validation schemas
- JSON → OpenAPI 3.1 - API specification schemas
- JSON → TOON Format - Compact format (30-60% fewer tokens for LLMs)
- TOON → JSON - Bidirectional TOON support
Usage
Command Palette
- Select JSON text in your editor
- Open Command Palette (
Cmd/Ctrl + Shift + P)
- Type "JsonToonCraft" and choose your conversion:
JsonToonCraft: Convert to TypeScript Interface
JsonToonCraft: Convert to Zod Schema
JsonToonCraft: Convert to OpenAPI Schema
JsonToonCraft: Convert to TOON Format
JsonToonCraft: Convert TOON to JSON
- Select JSON text
- Right-click
- Choose "JsonToonCraft: Convert to..."
Keyboard Shortcuts
Cmd/Ctrl + Shift + T - Convert to TypeScript
Cmd/Ctrl + Shift + Z - Convert to Zod
Cmd/Ctrl + Shift + N - Convert to TOON
Example
Input (JSON):
{
"name": "John",
"age": 30,
"email": "john@example.com"
}
Output (TypeScript):
interface Root {
name: string;
age: number;
email: string;
}
Output (Zod):
import { z } from 'zod';
const RootSchema = z.object({
name: z.string(),
age: z.number(),
email: z.string(),
});
Output (TOON - 42% smaller!):
name: "John"
age: 30
email: "john@example.com"
TOON is a compact, human-readable data format designed to reduce LLM token usage by 30-60%. Perfect for:
- Reducing AI API costs
- Optimizing prompts
- Faster LLM processing
- Smaller context windows
Learn more about TOON format
Output Options
After conversion, choose what to do with the result:
- Replace selection - Replace selected text with output
- Insert below - Insert output below selection
- Copy to clipboard - Copy to clipboard for pasting elsewhere
- Open in new file - Open output in a new editor tab
Requirements
- VS Code version 1.85.0 or higher
Privacy
All conversions happen locally in your editor. Your data never leaves your computer.
Web Version
Prefer a web interface? Try JsonToonCraft Web App
Contributing
Found a bug or have a feature request?
Report an issue
License
MIT - Free and Open Source
Made with ❤️ by Krish
Follow on Twitter/X • GitHub