Code to UML
Turn TypeScript or Java source into a Mermaid class diagram — classes, interfaces, enums, fields, methods, inheritance, and interfaces — rendered live in your browser.
Prefer the terminal? See the CLI equivalent →About the Code to UML
- Live Mermaid class diagram
- Syntax highlighting
- Send to UML to Code
- Instant results
- 100% private — runs in your browser
- Free, no sign-up
Paste TypeScript or Java and get a Mermaid class diagram of its structure: each class, interface, and enum becomes a box with its fields and methods, and extends/implements relationships become the connecting arrows. It is the reverse of the UML to Code tool — read structure out of existing code instead of scaffolding code from a diagram.
The diagram renders live beside the editor, and the underlying Mermaid text is right there to copy, download as a .mmd file, or send onward. Because it emits standard Mermaid, you can drop the result into a README, a wiki, or any Markdown that supports Mermaid.
It runs entirely in your browser. The parser recognizes the common declaration shapes and skips anything it can’t classify, so it stays useful on partial snippets — and your code is never uploaded.
How to use it
- Choose the source language (TypeScript or Java).
- Paste or type your code in the left editor.
- Read the generated Mermaid on the right and the rendered diagram below.
- Copy or download the diagram, or send it to UML to Code to regenerate a skeleton in another language.
What gets mapped
- class / interface / enum
- Each becomes a diagram node with the matching stereotype.
- Fields & methods
- Captured with visibility (+ - # ~), types, params, and return types.
- extends
- An inheritance arrow (parent <|-- child).
- implements
- A realization arrow (interface <|.. class).
- Generics
- List<String> is rendered as List~String~ in Mermaid syntax.
- Constructors
- Skipped — they carry no structural information.
Frequently asked questions
Which languages are supported?+
TypeScript and Java today — the two brace-and-type languages whose declarations map cleanly to a class diagram. The parser reads classes, interfaces, enums, fields, methods, and extends/implements relationships.
Does it need my code to compile?+
No. It is a pragmatic, lenient parser, not a full compiler: it recognizes common declaration patterns and skips whatever it can’t classify, so it works on partial snippets and single files.
What can I do with the Mermaid output?+
Copy it into any Markdown that renders Mermaid (GitHub, GitLab, many wikis), download it as a .mmd file, or send it to the UML to Code tool to scaffold the same structure in another language.
Is my code uploaded?+
No. Parsing and rendering both run locally in your browser; nothing is sent to a server.
Works well with
Code to UML chains with these tools — send your result straight on:
Related tools
Color Converter
Convert colors between HEX, RGB, HSL, HSV, and OKLCH, with a picker, alpha, and a WCAG contrast checker — all in your browser.
CSS Unit Converter
Convert between CSS units — px, rem, em, pt, vw, vh, and more — with live visual feedback and a full conversion table.
Encoder / Decoder
Encode and decode text with Base64, URL, and Hex — UTF-8 safe, instant, and fully in your browser.
HEIC to JPG Converter
Convert iPhone HEIC/HEIF photos to JPG, PNG, or WebP — fast, multi-threaded batch conversion entirely in your browser. Nothing is uploaded, and location and metadata are removed by default.
Image Compressor
Fast, multi-threaded image compression — shrink many images at once by quality or to a target file size, with WebP/JPEG output and optional resizing, entirely in your browser.
Image Converter
Convert, resize, and compress images between PNG, JPEG, and WebP, or copy them as a Base64 data URI — entirely in your browser.