Class Diagram Generator
Describe your classes, fields, methods and relationships as text — get a UML class diagram instantly. Paste Mermaid classDiagram code — or start from the e-commerce example — and this free online class diagram generator renders it in your browser, ready to download as a crisp PNG. No sign-up, and nothing you paste leaves your device.
The demo above is live — edit the code and hit Generate. The example that loads with the page is free; each Generate click uses one of your 10 free generations per day.
How it works
From classes written as text to a UML diagram in four steps.
List your classes
Each class with its fields and methods — plus how the classes relate: owns, places, inherits.
Turn it into Mermaid code
Write a block per class and connect them with arrows like Order "1" *-- "1..*" OrderItem — or let ChatGPT or Claude write the code for you.
Pick “Mermaid diagram” and hit Generate
The visual type is pre-selected on this page. Your class diagram is drawn instantly in your browser — nothing is uploaded.
Download PNG
One click, no watermark — ready for design docs, wikis or slides.
What goes into a class diagram
Three building blocks describe any object model — and all three are just text.
Classes
Each box is a class — Customer, Order, Product — with its name on top and members listed inside.
Fields & methods
One per line, with a visibility symbol: +String name for public fields, +placeOrder() for methods.
Relationships & multiplicity
Arrows connect classes; quoted numbers like “1” and “0..*” say how many, and *-- marks composition.
From text to class diagram, the AI-friendly way
You never have to write Mermaid by hand: describe your domain to ChatGPT or Claude and paste what it returns here — no sign-up, and everything renders locally on your device.
Describe your domain in English
Tell ChatGPT or Claude the classes you need — “an e-commerce model: customers place orders, orders contain line items that refer to products” — and ask for Mermaid classDiagram code.
Paste the code here
Copy the class diagram code it returns and drop it into the box above, skipping the fence lines around the code block.
Generate, download PNG
Hit Generate: the UML diagram draws instantly in your browser and exports as a crisp, watermark-free PNG for docs and slides.
Private by design: your class diagrams never leave your browser
Domain models often describe unreleased products. Text2Viz renders them locally, so nothing is uploaded.
No sign-up, no account
There is nothing to create and nothing to log into. Open the page and start diagramming.
Rendered locally
Your diagram is drawn by JavaScript running on your own device. Your model text is never sent to our servers.
Safe for unreleased designs
Pre-launch product models, internal services, client projects — render them here without a second thought.
What people make with it
Three common ways people use this free class diagram generator.
Model a domain before building
Sketch the entities and relationships first — spot missing pieces and tangled ownership before you write a line of code.
Document an existing codebase
Turn your class structure into one diagram for onboarding docs, wikis and architecture reviews.
From AI chat to image
ChatGPT or Claude drafted your model as classDiagram code? Paste it here and export a shareable PNG.
Frequently asked questions
Is this class diagram generator free?
How do I turn text into a class diagram online?
How do I write member visibility in Mermaid class diagrams?
How do I show inheritance, composition and aggregation?
Can AI write the classDiagram code for me?
Can I download the class diagram as a PNG?
More text-to-diagram tools
The same paste-and-generate flow, tuned for other diagram types.
ER Diagram Maker
Entity relationship diagrams for database schemas from Mermaid erDiagram syntax.
State Diagram Generator
State machine diagrams for lifecycles from Mermaid stateDiagram-v2 syntax.
User Journey Map Generator
Map customer journey steps, satisfaction scores and actors from Mermaid journey syntax.
Quadrant Chart Generator
Plot options on a 2x2 matrix with Mermaid quadrantChart syntax.
Git Graph Generator
Visualize commits, branches and merges with Mermaid gitGraph syntax.
Sankey Diagram Maker
Show how budget, energy or users flow between stages with Mermaid sankey-beta code.
Block Diagram Maker
Lay out system components in a grid of blocks and arrows from Mermaid block-beta code.
Requirement Diagram Maker
Map requirements, elements and satisfies links from Mermaid requirementDiagram code.
C4 Context Diagram Maker
Draw a C4 context diagram — people, systems and relationships — from Mermaid C4Context code.
C4 Container Diagram Maker
Zoom inside a system's containers with Mermaid C4Container syntax.
Text to Timeline Maker
Dates and events become a clean horizontal timeline. Also see the horizontal, project and history timeline makers.