Atlas
  • All-in-one
  • Solutions
  • Compare
  • Pricing
PricingGet started
All guides
July 11, 2026·10 min read·mermaid, gantt chart, project management, tutorial

Mermaid Gantt Chart Tutorial (Project Timelines)

A gantt chart shows a project's tasks across a timeline. Mermaid lets you write one in text and update it as fast as the plan changes.

A gantt chart lays a project's tasks out along a timeline, with each task drawn as a horizontal bar whose length shows its duration and whose position shows when it happens. It is the classic project-planning view, making it easy to see what runs when, what overlaps, and what depends on what. Mermaid's gantt syntax lets you build one from text, which is a genuine convenience for developers and technical teams who would rather write a plan than wrestle with project-management software.

This tutorial covers the gantt essentials: setting up the chart and date format, organizing tasks into sections, defining task durations, chaining dependencies so tasks follow one another automatically, and marking milestones. As with all Mermaid, you can paste each snippet into the live editor at /diagram-tools/mermaid-editor and watch it render. Gantt charts have a few unique syntax quirks around dates and dependencies that are worth understanding clearly.

Setting up the chart

A gantt chart starts with the keyword `gantt` on its own line. You then typically set a title with `title Project Plan` and a date format with `dateFormat YYYY-MM-DD`, which tells Mermaid how to interpret the dates you write for tasks. The date format line is important - it defines the pattern your task dates must match, and getting it consistent avoids a common source of rendering errors.

You can also configure the axis format to control how dates display along the top with `axisFormat`, and set the chart to exclude weekends or specific dates from duration calculations, which makes the timeline reflect actual working days. These setup lines go right after the `gantt` keyword and configure the whole chart before you define any tasks. For a first chart, just `gantt`, a title, and a dateFormat are enough to get going.

Sections and tasks

Tasks are grouped into sections, which appear as labelled rows of the chart. You declare a section with `section Design`, and every task after it belongs to that section until the next `section` line. Sections are how you organize a plan into phases or workstreams - Design, Development, Testing, Launch - so the timeline is readable rather than a flat list of bars.

A task line has a name, a colon, and then its parameters: an optional task ID and status, a start point, and a duration or end date. The simplest task is `Write spec :2026-08-01, 5d`, which starts on that date and lasts five days. You can give a task an ID for referencing in dependencies: `Write spec :spec1, 2026-08-01, 5d` names it `spec1`. Task status keywords like `done`, `active`, and `crit` change how the bar renders - `crit` marks a critical task in a distinct color, useful for highlighting the critical path.

Dependencies and milestones

The most powerful feature of Mermaid gantt is automatic dependencies. Instead of writing a fixed start date, you can start a task `after` another task, and Mermaid calculates the date. Writing `Build feature :dev1, after spec1, 10d` means the build starts as soon as `spec1` finishes and runs ten days. This is enormously useful because when you change an earlier task's duration, everything downstream shifts automatically - the whole plan re-flows, which is exactly what you want when a schedule slips.

  • `after taskId` starts a task when another finishes, chaining dependencies automatically.
  • Change an upstream duration and all dependent tasks shift - no manual date edits.
  • A task can depend on several others: `after task1 task2` waits for both.
  • Mark a milestone with the `milestone` keyword and a zero duration - it renders as a diamond marker.
  • Use `done` for completed tasks, `active` for in-progress, and `crit` to highlight critical ones.
  • Give every task you will reference an ID so dependencies can point to it.
  • Sections keep phases visually separated, which matters as the plan grows.

A complete example and its limits

Putting it together, a small project might read: `gantt`, a title, `dateFormat YYYY-MM-DD`, then `section Planning` with `Write spec :spec1, 2026-08-01, 5d`, then `section Build` with `Develop :dev1, after spec1, 10d` and `Test :after dev1, 4d`, and finally a milestone `Launch :milestone, after dev1, 0d`. In a dozen readable lines you have a real project timeline that recalculates itself when durations change. That responsiveness is the big advantage of a text-based gantt over a hand-drawn one.

The honest limits: Mermaid gantt is great for straightforward timelines but not a substitute for full project-management software when you need resource allocation, percent-complete tracking, or complex dependency types. Its strength is a lightweight, versionable timeline that lives with your docs and updates in seconds. For a polished timeline in a presentation, or when you want to arrange things precisely, you can bring the chart into a visual tool - Atlas Diagram Studio supports Mermaid import and visual editing at /diagrams, and you can generate a first draft from a written plan using the AI diagram generator at /diagram-tools/ai-diagram-generator.

Keep reading

  • Best Diagramming Software in 2026: The Overall Buyer Guide
  • How to Make Diagrams for Confluence
  • How to Make Diagrams for Notion
  • Free PDF tools
  • The all-in-one work OS

FAQ

Questions, answered.

How do I start a gantt chart in Mermaid?
Begin with the keyword gantt on its own line, then add a title and a dateFormat line like dateFormat YYYY-MM-DD that tells Mermaid how to read your task dates. After that, organize tasks into sections and define each task with a name, start point, and duration. Those few setup lines are enough to render a working timeline.
How do I make one task depend on another in a Mermaid gantt?
Give the first task an ID and start the second one after it: Build :dev1, after spec1, 10d starts the build when spec1 finishes. Mermaid calculates the dates, so changing an upstream task's duration shifts everything downstream automatically. This is the biggest advantage of a text gantt - the whole plan re-flows when the schedule changes.
How do I add a milestone to a Mermaid gantt chart?
Use the milestone keyword with a zero duration, like Launch :milestone, after dev1, 0d. Milestones render as diamond markers rather than bars, marking a significant point in the project such as a launch or a review, rather than a task with duration.
What do the task status keywords do?
Keywords in a task line change how its bar renders: done marks a completed task, active marks one in progress, and crit highlights a critical task in a distinct color, useful for showing the critical path. You place them before the dates, like Test :crit, active, after dev1, 4d, to combine status and criticality.
Is Mermaid gantt a replacement for project management software?
For lightweight, versionable timelines that live with your docs, yes. But it does not replace full project-management tools when you need resource allocation, percent-complete tracking, or complex dependencies. Its sweet spot is a simple timeline you can write and update in seconds, kept in sync with the rest of your documentation.

Ready when you are

One workspace, not ten.

Atlas replaces the stack with one platform for tasks, projects, CRM, contracts, e-signature, PDF tools, and analytics. Start free.

Get started freeSee pricing
AtlasWork, planned itself.

The AI-native, all-in-one work platform. Tasks, projects, CRM, contracts, and analytics in one calm workspace.

All systems operational
  • SOC 2 II
  • ISO 27001
  • HIPAA
  • GDPR

Product

  • Overview
  • PDF tools
  • People & HR
  • Integrations
  • Marketplace
  • Pricing

Resources

  • Guides
  • Docs
  • API reference
  • Support
  • Changelog
  • Status

Company

  • About
  • Careers
  • Press
  • Contact

Legal & trust

  • Trust center
  • Security
  • Privacy
  • Terms
  • DPA
  • GDPR
  • SLA
  • Refunds
Atlas, a product by wrxstack.com·© 2026 wrxstack·All rights reserved
PrivacyTermsSecurityStatus