Type-safe diagrams and source code from one schema.

Define your domain once. Generate types for TypeScript, Python, Rust, Go, C#, F#, Dart, PHP, and Protobuf — and an auto-laid-out SVG diagram — from the same source.

Schema.td
Live Preview: Syncing

One .td file in. Three outputs out.

typeDiagram is a tiny, language-neutral DSL for describing your data model — records, tagged unions, generics, aliases.

code

Source code, 9 languages

TypeScript, Python, Rust, Go, C#, F#, Dart, PHP, and Protobuf — DTOs, data classes, discriminated unions, pattern-matchable enums — generated from the same definition, always in sync.

schema

SVG diagrams

Automatic orthogonal layout — no dragging, no fiddling. Versionable in git and rendered the same on every machine.

swap_horiz

Round-trip conversion

Convert existing TypeScript, Python, Rust, Go, C#, F#, Dart, PHP, or Protobuf types back to the DSL. Retrofit an existing codebase without rewriting it.

hub

A shared schema, not a diagramming tool

Unlike Mermaid or PlantUML, the diagram is a side effect — not the goal. The primary output is code, in as many languages as you need, kept strictly in sync by construction.

sync

One definition, N outputs

Python backend, Dart/Kotlin mobile app, TypeScript web client, Rust data pipeline, gRPC services — keeping DTOs aligned across nine languages is a full-time job. Change a field, regenerate, done.

VS Code Extension

Live preview in your editor.

Syntax highlighting, hover docs, and a side-by-side SVG preview that updates as you type. Available free on the Visual Studio Marketplace.

typeDiagram VS Code extension showing live SVG preview of a chat-model schema alongside .td source code
Install the .vsix manually
  1. Download typediagram.vsix above.
  2. Open VS Code and press Ctrl+Shift+P (Cmd+Shift+P on macOS).
  3. Run Extensions: Install from VSIX… and select the downloaded file.
  4. Or from the terminal: code --install-extension typediagram.vsix
Engineered for Scale

Complex diagrams, simplified by code.

Stop fighting with drag-and-drop tools. typeDiagram treats your architecture as a living document, versionable and strictly typed.