Skip to content
MermaidViewer

AI Class Diagram generator

Describe your class diagram in plain English and get editable Mermaid code instantly. Model object-oriented code: classes, members and relationships (UML).

Free · no sign-up for your first few diagrams each day

Example prompts for a class diagram

  • “E-commerce domain model with orders, products and customers”
  • “Observer design pattern”
  • “Library management system”

What a Mermaid class diagram looks like

Example class diagram

Example class diagram diagram
mermaid
classDiagram
    class Animal {
      <<abstract>>
      +String name
      +int age
      +makeSound()* void
    }
    class Dog {
      +String breed
      +fetch() void
    }
    class Cat {
      -int lives
      +purr() void
    }
    class Owner {
      +String name
      +adopt(Animal a) void
    }
    Animal <|-- Dog
    Animal <|-- Cat
    Owner "1" --> "0..*" Animal : owns
Open in the live editor

Want to write it by hand? See the full Mermaid class diagram syntax and examples, or browse templates.

Frequently asked questions

How do I generate a class diagram with AI?

Describe the class diagram you need in the box above and click Generate. The AI writes valid Mermaid class diagram code that renders instantly, and you can open it in the editor to refine it.

Is the AI class diagram generator free?

You can try it free — 5 AI generations in total, no sign-up needed. Starter includes 500 AI conversations a month and Pro is unlimited. Manual editing and export stay free after that.

Can I edit the generated class diagram?

Absolutely. The output is plain Mermaid code — edit it by hand in the live editor, or ask the AI for changes in natural language.

Other AI generators