GitDiagram
Browse

GitDiagram vs Mermaid: who writes the diagram

Written by GitDiagram. Facts about Mermaid checked against its own docs on (sources).

Mermaid is a diagram language, not a code analysis tool: you write text and it draws the picture, and GitHub shows Mermaid inside Markdown files. GitDiagram reads a GitHub repository, decides which parts matter and how they connect, and writes that diagram in Mermaid for you. Choose Mermaid to draw and maintain exactly the diagram you want in your own docs, of any kind (sequence, class, state, Gantt and many more). Choose GitDiagram when you want an architecture diagram of a repository without writing it, then copy its Mermaid code as a first draft to edit.

Which to choose

Choose Mermaid whenChoose GitDiagram when
You know exactly what the diagram should show.You want an architecture diagram of a repository you haven't read yet.
You need a sequence, class, state, entity-relationship or other non-flowchart diagram.You don't want to write the diagram yourself.
The diagram lives in your docs and changes with your code reviews.You want each box linked to its code on GitHub.
You want to diagram something that is not a repository.You want a first draft in Mermaid to edit.

The same repository: GitDiagram's Mermaid output

GitDiagram's diagrams are Mermaid flowcharts. Here is the start of the code behind the Express diagram, exactly as Export, Copy Mermaid gives it. The full diagram has 16 components and 21 connections in 80 lines; paste it into a code block marked mermaid in any GitHub Markdown file and GitHub draws it.

Mermaid exported from gitdiagram.com/expressjs/express
flowchart TD

subgraph group_entry["Application Entry"]
  node_app["Express Application<br/>[application.js]"]
  node_factory["Application Factory<br/>[express.js]"]
end

subgraph group_routing["Routing Pipeline"]
  node_router["Router Integration<br/>[express.js]"]
  node_route_handlers["Application Handlers"]
end

node_client(("HTTP Client"))
node_node_http["Node HTTP Server"]

node_client -->|"sends request"| node_node_http
node_node_http -->|"dispatches request"| node_app
node_factory -->|"creates application"| node_app
node_app -->|"dispatches request"| node_router

What Mermaid does

Mermaid is open source (MIT) and turns text into diagrams: flowcharts, sequence, class, state, entity-relationship, Gantt, pie, C4, mindmap, timeline, Sankey, XY chart, block, kanban and more, with several newer types in beta. Write it in the Mermaid Live Editor, with the JavaScript library on your own site, or in Markdown on GitHub, which renders Mermaid blocks in issues, pull requests, discussions, wikis and files.

Mermaid does not read code: every diagram is written by hand (or by a tool such as GitDiagram). By default it caps a diagram at 50,000 characters of text and 500 connections. GitHub runs a fixed Mermaid version of its own, so the newest syntax may not render there yet. The company behind Mermaid also sells an editor with AI features (mermaid.ai, formerly Mermaid Chart): a free Basic plan, then $10 or $20 per user per month, billed yearly.

What GitDiagram does

An AI model reads the repository's file tree, README and up to 12 source files and returns a graph of the main components; GitDiagram checks every linked path against the repository and compiles the graph to Mermaid. On the page, each component opens its file or folder on GitHub.

GitDiagram's limits: it is a map of the important parts, not a complete dependency graph. It can simplify or leave things out, it works only with GitHub repositories, and it shows the repository as it was when the diagram was made (Regenerate makes a fresh one).

At a glance

QuestionGitDiagramMermaid
What you getOne interactive architecture diagram: up to 34 main components in groups, with labeled connections and a written overview. Each component links to its file or folder on GitHub.Whatever diagram you write, in more than 20 diagram types.
Reads the codeYes. An AI model reads the file tree, the README and up to 12 source files; every linked path is checked against the real repository.No. You write the diagram.
SetupNone. Replace hub with diagram in a GitHub URL, or paste the URL on the home page.None on GitHub or mermaid.live; npm install mermaid for your own site.
PriceFree. Making new diagrams is free within a shared daily limit; after that you can add your own OpenAI API key.The library is free (MIT). The hosted editor at mermaid.ai has a free plan and paid plans from $10 per user per month.
Open sourceYes, MIT (source).Yes, MIT, with about 91,000 GitHub stars.

Questions

Can Mermaid generate a diagram from my code?

No. Mermaid draws diagrams you write in its text syntax. Tools such as GitDiagram (any GitHub repository) and dependency-cruiser (JavaScript and TypeScript imports) can write Mermaid for you.

Can I edit a GitDiagram diagram?

Yes. Use Export, Copy Mermaid, then edit the code in the Mermaid Live Editor or in a Markdown file. Click links point to files on GitHub.

Does GitHub render Mermaid?

Yes, in Markdown files, issues, pull requests, discussions and wikis, inside a code block marked mermaid.

Sources

Checked on . Products change: if something here is out of date, open an issue.