How to add a Mermaid diagram in Notion
Learn how to add a Mermaid diagram in Notion with a code block: pick the Mermaid option, write your diagram text, and expand it fullscreen.

Quick answer
To add a Mermaid diagram in Notion, type /code on an empty line of a page and choose Code - Mermaid from the menu. Notion adds a sample diagram. Replace the sample with your own Mermaid text and the diagram renders below it. Click the diagram to expand it.
Steps at a glance
- Open a page and click an empty line.
- Type /code to open the block menu.
- Choose Code - Mermaid from the menu.
- Replace the sample with your own Mermaid text.
- Click the rendered diagram to expand it.
Interactive demo
Summary
Notion renders Mermaid text as a diagram inside a code block. You write a few lines of text and get a flowchart without a drawing tool, and the diagram updates as you edit the text.
Step-by-step guide
Step 1
Type the slash command
Open the page you want to edit and click an empty line. Type /code to open the block menu, which lists matching blocks as you type.
Step 2
Choose the Mermaid code block
In the menu, select Code - Mermaid. Notion inserts a code block with Mermaid as its language and shows a rendered sample diagram under the code.
Step 3
Replace the sample code
Select the sample text in the code block and type your own Mermaid text, for example a short flow from Draft to Review to Publish. The diagram below the code redraws with your labels.
Step 4
Expand the diagram
Click the rendered diagram to open it fullscreen. The nodes you wrote, Draft, Review and Publish, appear as connected boxes you can read at a larger size.
Why this matters
You are documenting a release process and a bulleted list hides the order of work. A Mermaid block turns a few lines of text into a flow you can edit in place, so the page stays accurate as the process changes.
Frequently asked questions
Does Notion show the diagram and the code together?
Yes. The Mermaid code sits at the top of the block and the rendered diagram appears directly below it.
Can I see the diagram larger?
Yes. Click the rendered diagram to expand it fullscreen.
Related guides
Continue with more step-by-step guides for getting work done.
How to add a code block in NotionLearn how to add a code block in Notion: type a slash command on an empty line, pick Code from the menu, and enter your snippet in four quick steps.
How to add blocks in NotionLearn how to add blocks in Notion using the slash command menu to insert text, headings, images, databases, and 50+ block types.
How to add a callout block in NotionAdd a callout block to a Notion page with the slash menu, type your highlighted note, and swap the default icon for an emoji that fits your message.
How to add a relation between databases in NotionLearn how to link two Notion databases with a relation property so records like customers and orders stay connected.
How to add a table of contents in NotionLearn how to add a self-updating table of contents in Notion using heading blocks, so readers can jump to any section instantly.
How to add a toggle block in NotionType / in Notion and choose Toggle list to add a collapsible block, then press Tab to nest content under it. Keeps long pages tidy. Includes a demo.
Create interactive demos like this one — free, no coding required.
Start for free →