Key differences

  • Mermaid has 3.5× as many GitHub stars as D2 (90.5K vs 25.6K).
  • Mermaid had more development activity over the last 12 months: 2,472 commits vs 324.
  • 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.6K 90.5K
Commits, last 12 months
324 2.5K
Contributors
65 365
Forks
757 9.3K
Show data as a table
D2 vs Mermaid by the numbers
MetricD2Mermaid
GitHub stars25,56490,531
Commits, last 12 months3242,472
Contributors65365
Forks7579,322

Development activity

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

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

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/tiny@12.1.0 ()
Last commit
Repository created
Open issues4771,482
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.6K starsGoMPL-2.0

  • Mermaid

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

    90.5K starsTypeScriptMIT

More comparisons