Skip to content

Mermaid Validator & Diagram Inventory

Validate Mermaid and audit every fenced diagram in your Markdown

Scan a Markdown document for every mermaid, math, or other fenced block — then validate Mermaid syntax with the official parser before you commit. Runs locally using the same Mermaid bundle as our live editor preview.

1 mermaid1 math1 other
KindLang tagStarts at lineLinesPreview
mermaidmermaidL54flowchart LR A[Start] --> B{Done?} B -->|yes| C[Ship] B -->|no| D[Iterate]
mathtexL141E = mc^2…
othergraphqlL201type Query { hello: String }

How to use the diagram tools

Inventory diagrams in a Markdown document

  1. Paste a Markdown document, or click Open .md to load one from disk.
  2. The table lists every fenced code block with its kind (mermaid / math / other), language tag, starting line, line count, and a short preview.
  3. The badge row above shows totals at a glance — useful when auditing a large docs repo before a static-site build.
  4. Click Send first Mermaid block to validator to forward a diagram into the validator tab.

Validate Mermaid syntax

  1. Paste Mermaid source, or pull one in from the inventory tab.
  2. Press Validate syntax. The tool loads the official Mermaid parser and reports either a green confirmation with the diagram type, or a red error with the parser message.
  3. Fix the issue and validate again — there is no round trip to any server.

Why a separate Mermaid validator?

GitHub and most static-site generators render Mermaid silently — if the syntax is wrong, the block stays as plain text or shows an unhelpful "Unable to render" message. By validating before you commit, you avoid landing broken diagrams in a release. The same applies to a docs CI pipeline: catching parse errors in pre-flight is much faster than discovering them after git push.

The diagram inventory adds a second layer of value: it gives you an instant overview of where diagrams live in a document or repo, which is invaluable when:

  • Migrating doc platforms and you need to budget for diagram conversion.
  • Theming or rebranding — finding every flowchart to update colors.
  • Replacing PNGs with code-first diagrams and tracking progress.

Mermaid diagram types at a glance

DiagramUse caseExample fence tag
FlowchartProcess flows, decision treesmermaid
SequenceAPI calls, messaging between actorsmermaid
ClassObject-oriented domain modelsmermaid
StateFinite-state machinesmermaid
ERDatabase entity relationshipsmermaid
GanttProject timelinesmermaid
PieQuick percentage breakdownsmermaid
MindmapBrainstorms, taxonomiesmermaid
JourneyUser journey mappingmermaid
Git graphBranching workflowsmermaid

All of these are recognized by the validator. If the parser returns a diagram type you don't expect, double-check that the first non-empty line declares the intended diagram (e.g. sequenceDiagram vs. flowchart LR).

Tips for writing Mermaid that just works

  • Keep one diagram per fence. Two diagrams in the same \``mermaid` block won't parse.
  • Avoid reserved keywords in unquoted labels. Wrap labels containing end, class, or punctuation in double quotes.
  • Use simple ASCII first. Smart quotes and en-dashes pasted from Notion or Word cause parse failures. Run new diagrams through this validator before committing.
  • Pin Mermaid versions for production docs. Diagram types and node syntax sometimes evolve; pinning prevents a Mermaid upgrade from silently breaking pages.

Companion tools

Privacy & data

  • The Mermaid library, the parser, and the inventory scan all run inside your browser tab.
  • Security level is set to strict — no JavaScript inside diagram labels is ever executed.
  • We never upload, log, or store diagram source.

Frequently asked questions

What is a Mermaid validator?
A Mermaid validator parses your diagram source the same way Mermaid itself does and reports whether the syntax is valid. It catches mistakes — wrong arrow direction, missing brackets, unknown diagram type — before you push to a repo where the render will silently fail.
Which Mermaid diagram types are supported?
All diagram types shipped by the official Mermaid bundle: flowchart, sequenceDiagram, classDiagram, stateDiagram, erDiagram, journey, gantt, pie, mindmap, timeline, gitGraph, requirement, quadrantChart, sankey, xychart, block, and more — whatever the version of Mermaid we bundle currently supports.
What does the diagram inventory show?
It scans your Markdown for every fenced code block and labels each one as Mermaid, math (TeX / Math fences), or Other. You get the language tag, the starting line number, the line count, and a short preview — useful for auditing a docs repo before a static-site build.
Is my diagram uploaded to a server?
No. We import the official Mermaid library into your browser, configure it with `securityLevel: strict`, and parse locally. Nothing — neither the document, the diagram, nor any metadata — leaves your tab.
Why is my Mermaid diagram rejected on GitHub?
Common causes: a stray colon in a node label, a quoted string containing a reserved keyword, mismatched braces in a sequenceDiagram, or use of a diagram type that landed in Mermaid after the version GitHub renders with. Paste the source into the validator to see the exact parser error.
Can I validate a .mmd file from my computer?
Yes. Click Open .mmd / .md on the validator tab and pick the file. It loads locally, runs through the same parser, and shows the result without leaving your browser.