#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
⚡ FREE · SVG AND PNG

UML Class Diagram Maker: Turn Python Classes into a Diagram

Paste Python classes or write Mermaid code and get a clean UML class diagram to download.

  • 🐍 Reads Python classes
  • 🔗 Inheritance and associations
  • ⬇️ SVG and PNG export

How to use the UML Class Diagram Maker

  1. 1. Paste Python classesOr switch to the code tab and write Mermaid classDiagram code.
  2. 2. ConvertClasses, attributes, methods and relationships become a diagram.
  3. 3. DownloadSave as SVG for documents, or PNG for slides.

How Python becomes UML

  • Each class Name: becomes a box. class Student(Person): becomes an inheritance arrow, Person <|-- Student.
  • self.name = … lines become attributes. Types come from hints (self.age: int), from typed __init__ parameters, or from simple values ("text" → str, 3 → int, [] → list).
  • Methods become operations with their parameters and return types from -> hints.
  • Visibility follows Python's naming habits: name is public (+), _name is protected (#) and __name is private (-).
  • An attribute typed as another class, like courses: list[Course], becomes an association with multiplicity, 1 to many (*).

The code is only read, never run. Mermaid 10.9.0 draws the diagram in your browser with its strict security setting.

Worked example

The sample has 3 classes: Person, Course and Student. The diagram shows Student inheriting from Person, and a Student "1" --> "*" Course : courses association, because courses is typed as a list of Course. Person's _phone shows as protected (#), and Student's __total_fees() as private (-) with return type float.

Switch to Edit diagram code to adjust anything, such as adding a composition with *-- or an aggregation with o--, and the diagram redraws as you type. Mermaid code also renders directly in GitHub READMEs inside a ```mermaid block, so the diagram can live next to your code. For college projects and design documents, export SVG for crisp printing, or PNG at 2× size for slides.

The Python reader handles normal class code well. Classes built with decorators like @dataclass fields or metaclasses may need a small manual edit.

Frequently asked questions

Does it work with Java or C++ classes?

The automatic reader is for Python. For other languages, write the diagram in the Mermaid code tab, which uses simple class syntax.

Are dataclasses supported?

Class-level typed fields like name: str are read as attributes, so most dataclasses work.

Is my code uploaded?

No. It is read and drawn in your browser.

Do I have to pay for the uml class diagram maker?

No, it is free. Downloading your first diagram asks for your name and WhatsApp number one time only. Then the uml class diagram maker and all other Uncodemy tools stay open for you with no form.

More free tools

See all free tools