Open files in VS Code and Cursor / Docs and diagrams

Preview Mermaid diagrams in VS Code

VS Code has no Mermaid preview of its own. Install the free Mermaid Viewer, open a .mmd file and click the preview icon at the top right of the editor, or press Ctrl+K V (Cmd+K V on macOS). The preview follows your typing, names the line of any error and keeps the last good diagram on screen. On a Markdown file it lists every mermaid block with its own export buttons. Mermaid 12.3.0 ships inside the extension, so there is no sign-in and no network.

Install in VS CodeMarketplace pageOpen VSX (Cursor, Windsurf, VSCodium)JetBrains IDEs

Free, MIT license. Extension ID zovo.mermaid-viewer, version 0.3.3. Needs VS Code 1.90.0 or newer.

This guide is also in Deutsch, Español, Français, Italiano, 日本語, Polski, Português (Brasil), 简体中文.

A README.md with five mermaid blocks next to the Mermaid Viewer preview, which lists the diagrams with their line numbers, types and Zoom, SVG, PNG and Copy PNG buttons, and underlines a broken block in red
A README.md with five mermaid blocks next to the Mermaid Viewer preview, which lists the diagrams with their line numbers, types and Zoom, SVG, PNG and Copy PNG buttons, and underlines a broken block in red.

Steps in VS Code

  1. Install Mermaid Viewer from the Marketplace, or press Ctrl+P (Cmd+P on macOS) and run ext install zovo.mermaid-viewer.
  2. Open a .mmd or .mermaid file and click the preview icon in the editor title, or press Ctrl+K V (Cmd+K V on macOS).
  3. For a Markdown file with ```mermaid blocks, click the same preview icon. Each diagram shows with its line number.
  4. Scroll to zoom at the pointer and drag to pan. Fit and 100% are in the toolbar.
  5. Click Export for PNG at 1x, 2x or 4x, SVG, Copy PNG or Copy SVG code.

Steps in Cursor, Windsurf or VSCodium

  1. Open the Extensions view with Ctrl+Shift+X (Cmd+Shift+X on macOS).
  2. Search for zovo.mermaid-viewer and click Install. Cursor, Windsurf and VSCodium install from Open VSX, where it is published as zovo/mermaid-viewer.
  3. If your editor has no gallery, download the .vsix from the Open VSX page and run "Extensions: Install from VSIX...".
  4. Then use it the same way as in VS Code.

What Mermaid Viewer handles

What it does not do

In JetBrains IDEs (IntelliJ IDEA, PyCharm, WebStorm, CLion and others)

Other options

Install counts and Open VSX status were checked on 9 November 2026. Descriptions in quotes are the extensions' own.

Questions

Why does VS Code not show my mermaid block in the Markdown preview?

VS Code's built-in Markdown preview does not draw Mermaid. Either add Markdown Preview Mermaid Support, which draws diagrams inside that preview, or use Mermaid Viewer, which opens its own panel with zoom and export.

Can I export a diagram as PNG or SVG?

Yes. Export saves PNG at 1x, 2x or 4x, with an optional largest width or height, or SVG. Copy PNG puts the image on the clipboard.

Does it need an account or the internet?

No. Mermaid 12.3.0 is bundled, there is no sign-in and no AI, and the preview blocks every network request.

More about Mermaid Viewer

Read the Mermaid Viewer page for every feature and setting, or the source code on GitHub.

Zovo Pro and support

Zovo Pro: USD 19 once, every Zovo viewer. It turns on the Pro tools in this extension and in the other Zovo extensions you use. The free features stay free.

After a card payment your license key shows on the next page. Paste it with the command "Zovo Pro: Enter a key".

You can also support the work with no Pro:

Need your format supported?

Open a format request with a sample file, and I reply there whether it can be done. For USD 299 once, through this GitHub Sponsors tier, I add your file format or a missing feature to this extension, with tests, within 7 days.