What does "Parse error" mean in Mermaid, and how do I fix it?
About 3 min · Updated 2026-09-13
Parse error means the syntax didn't go through, not that the diagram is wrong. Four causes cover most of it: the reserved word end, mixed arrow styles, full-width punctuation, and quotes inside node labels.
Short answer
Parse error means the parser couldn't read the text — it says nothing about whether the diagram makes sense. Paste the code into the editor and the error is reported in plain language with the line number. It's almost always one of four things.
1. The reserved word end
end closes a block in Mermaid, so it can't be a node label:
flowchart TD
A[Start] --> B[end]
Fix: use another word, or quote it — B["end"].
2. Mixed arrow styles
-->, -> and ==> in the same diagram, or a dash short:
flowchart TD
A --> B
B -> C
Fix: in a flowchart, use --> throughout. Sequence diagrams use ->> — the two syntaxes don't mix.
3. Full-width punctuation
If any of the text came from a CJK keyboard, the brackets, colons and commas may be full-width characters that look right but aren't. The reported line often looks fine — that's the tell. Structural punctuation has to be ASCII; punctuation inside a label can be anything.
4. Quotes or brackets inside a label
A[The "new" release] cuts the parser off. Fix: wrap the whole label — A["The new release"] — or drop the inner characters.
All four avoided
This one gets all four right — open it in the editor and compare:
flowchart TD
A[Start] --> B{Over 5,000?}
B -- Yes --> C["Director approves (with attachments)"]
B -- No --> D[Manager approves]
C --> E([Archived])
D --> EThen check
The diagram re-renders as you type; the error bar disappearing means it parsed. If you still can't spot it, the error bar has an "AI fix" button that makes the smallest change needed and shows you a line-by-line diff before anything is applied.
Related
More guides
- How do I get a flowchart from ChatGPT into a Word document?
- Do I have to strip the code block out of the AI reply?
- How do I put a Mermaid diagram into PowerPoint?
- The Mermaid code my AI gave me won't render. Now what?
All guidesLooking for a specific answer? Try the Help Center