d2 VS mermaid

Compare d2 vs mermaid and see what are their differences.

d2

D2 is a modern diagram scripting language that turns text to diagrams. (by terrastruct)

mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown (by knsv)
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
d2 mermaid
96 147
18,209 72,804
8.0% 1.4%
9.5 10.0
14 days ago 7 days ago
Go TypeScript
Mozilla Public License 2.0 MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

d2

Posts with mentions or reviews of d2. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-10-15.

mermaid

Posts with mentions or reviews of mermaid. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-11-29.
  • My QA Tech Stack in 2025
    4 projects | dev.to | 29 Nov 2024
    Notion serves as a knowledge base and documentation hub for our whole company, and as QA we use it to document our practices and store some test data references. In particular, I love the ability to reference pages in other pages, creating a web of knowledge across all our documents - and with the native integration of Mermaid.js, creating flowcharts is fun and easy.
  • From Audio to Diagram
    2 projects | dev.to | 21 Nov 2024
    mindmap-to-mermaid: last agent transform the mind-map representation in a mermaid syntax ready for the visualization
  • LLM + Mermaid: How Modern Teams Create UML Diagrams Without Lucidchart
    3 projects | dev.to | 18 Nov 2024
    Today, tools like Mermaid and PlantUML have taken center stage, thanks to their ability to generate diagrams with text-based commands. Even better, AI-powered assistants like Claude, ChatGPT, and GitHub Copilot have made generating diagrams even easier. These tools work directly within a developer's environment, creating diagrams that are version-controlled and integrated seamlessly into workflows.
  • From Diagram to Code with Amazon Q Developer
    2 projects | dev.to | 31 Oct 2024
    The secret is that Q will not draw a diagram (like we would do on a piece of paper), I will ask Q to generate diagram as code with mermaid. So, my diagram will be a text that I can modify in a code editor and that I can reuse as a source for multiple tools. In this case I will use it later to rebuild my project.
  • Mermaid ASCII Diagrams
    6 projects | news.ycombinator.com | 15 Oct 2024
    Some nits:

    The "Example" buttons don't jump out at me; I found them but it took a while. Also consider labeling them with their point, e.g. "Example 3: Color"

    If you change the input text to something well-formed, the graph seems to update immediately. But if you change it to something ill-formed, the graph doesn't update immediately — and then if you click "Generate" manually, it blanks the input box. Either this is a bug, or the "Generate" button doesn't do what I think it does (i.e. generate output). Again, adding a noun to the verb might help. Or just adding some usage information somewhere on the page.

    For those like me who've never heard of "Mermaid," apparently it's like GraphViz's dot language but different. https://github.com/mermaid-js/mermaid

  • MySQL + Docker: Initial Setup
    1 project | dev.to | 30 Sep 2024
    * Drawn by mermaid.
  • Draw Diagrams in READMEs using Mermaid
    1 project | dev.to | 15 Sep 2024
    The Markdown format is a blessing for documentation. While many are aware it can create headings, tables, text styles, and lists, not many know about extensions available to the basic Markup language. Today, we'll learn about Mermaid.js. This powerful yet simple diagramming tool speaks to the aspirations of Markdown format.
  • Auth: Local-First Access Control
    3 projects | news.ycombinator.com | 12 Sep 2024
    The diagrams in the first half of the article are made with tldraw https://www.tldraw.com/

    The lower half look like the output from Mermaid https://mermaid.js.org/

  • Extending AstroJS Markdown Processing With Remark and Rehype Plugins
    4 projects | dev.to | 17 Aug 2024
    Lets, assume we want to add rendered Mermaid diagrams to our page by transforming the source code in fenced code blocks like the following:
  • Mermaid: Diagramming and Charting Tool
    7 projects | news.ycombinator.com | 15 Aug 2024

What are some alternatives?

When comparing d2 and mermaid you can also consider the following projects:

C4-PlantUML - C4-PlantUML combines the benefits of PlantUML and the C4 model for providing a simple way of describing and communicate software architectures

plantuml - Generate diagrams from textual description

d3 - Bring data to life with SVG, Canvas and HTML. :bar_chart::chart_with_upwards_trend::tada:

Mermaid - Edit, preview and share mermaid charts/diagrams. New implementation of the live editor.

aws-icons-for-plantuml - PlantUML sprites, macros, and other includes for Amazon Web Services services and resources

diagrams - :art: Diagram as Code for prototyping cloud system architectures

draw.io - draw.io is a JavaScript, client-side editor for general diagramming.

excalidraw - Virtual whiteboard for sketching hand-drawn like diagrams

mermaid-cli - Command line tool for the Mermaid library

graphviz

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured

Did you konow that Go is
the 4th most popular programming language
based on number of metions?