Key differences

  • Mermaid has 3.5× as many GitHub stars as D2 (91.1K vs 25.9K).
  • Mermaid had more development activity over the last 12 months: 2,832 commits vs 328.
  • D2 is licensed under MPL-2.0; Mermaid under MIT.
  • D2 is written primarily in Go, Mermaid in TypeScript.
  • Mermaid is the older project: its repository was created in 2014, D2's in 2022.

By the numbers

  • D2
  • Mermaid
GitHub stars
25.9K 91.1K
Commits, last 12 months
328 2.8K
Contributors
66 364
Forks
779 9.5K
Show data as a table
D2 vs Mermaid by the numbers
MetricD2Mermaid
GitHub stars25,85991,143
Commits, last 12 months3282,832
Contributors66364
Forks7799,510

Development activity

Commits per month to each default branch, last 12 complete months.

  • D2
  • Mermaid
0200400600 Nov 2025 Dec Jan 2026 Feb Mar Apr May Jun Jul Aug Sep OctD2Mermaid
0200400600 Nov 2025 Feb 2026 May Aug D2Mermaid
Show data as a table
D2 vs Mermaid: commits per month
MonthD2Mermaid
Nov 20250143
Dec 2025061
Jan 2026089
Feb 20260186
Mar 20260230
Apr 20262277
May 20260435
Jun 20260327
Jul 2026075
Aug 2026160331
Sep 2026158303
Oct 20268375

Side by side

AttributeD2Mermaid
DescriptionDeclarative diagram scripting language that turns text into diagrams.Generate diagrams and flowcharts from markdown-like text definitions, with a live editor.
CategoryDiagrams as codeDiagrams as code
LicenseMPL-2.0MIT
LanguageGoTypeScript
StatusActiveActive
Latest releasev0.9.0 ()@mermaid-js/examples@2.1.0 ()
Last commit
Repository created
Open issues4861,377
Install
go get github.com/d2lang/d2
npm install mermaid

Which should you choose?

Popularity and activity are only part of the story. Consider which ecosystem you work in, the chart types and interactions you need, how much data you render, and whether the license fits your project. Both tool pages list alternatives if neither is quite right.

  • D2

    Declarative diagram scripting language that turns text into diagrams.

    25.9K starsGoMPL-2.0

  • Mermaid

    Generate diagrams and flowcharts from markdown-like text definitions, with a live editor.

    91.1K starsTypeScriptMIT

More comparisons