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.
One .td file in. Three outputs out.
typeDiagram is a tiny, language-neutral DSL for describing your data model — records, tagged unions, generics, aliases.
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.
SVG diagrams
Automatic orthogonal layout — no dragging, no fiddling. Versionable in git and rendered the same on every machine.
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.
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.
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.
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.
Install the .vsix manually
- Download
typediagram.vsixabove. - Open VS Code and press
Ctrl+Shift+P(Cmd+Shift+Pon macOS). - Run Extensions: Install from VSIX… and select the downloaded file.
- Or from the terminal:
code --install-extension typediagram.vsix
Complex diagrams, simplified by code.
Stop fighting with drag-and-drop tools. typeDiagram treats your architecture as a living document, versionable and strictly typed.