DevTools

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 →
Loading tool…

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

  1. Choose the source language (TypeScript or Java).
  2. Paste or type your code in the left editor.
  3. Read the generated Mermaid on the right and the rendered diagram below.
  4. 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