How to Preview Markdown and Mermaid in Sublime Text 4

For an ordinary Markdown preview in Sublime Text 4, install MarkdownPreview and open the rendered file in your browser. For live updates with Mermaid diagrams, use MarkdownPreviewEnhanced. Both workflows let you put Sublime Text and the browser side by side.

Test Both Previews With One Markdown File

Save this as preview-check.md. The heading, table, and diagram give you three independent checks. Start with this small file before troubleshooting a README with custom styles or a large architecture diagram.

# Release checklist

| Task | Owner |
| --- | --- |
| Check preview | Alex |
| Review diagram | Kim |

```mermaid
flowchart LR
    Draft[Draft] --> Review[Review]
    Review --> Publish[Publish]
```

Open a Markdown Preview in Your Browser

  1. Open Sublime Text's Command Palette and select Package Control: Install Package.
  2. Install MarkdownPreview, then open preview-check.md.
  3. Run Markdown Preview: Preview in Browser. Select the built-in Markdown parser for local conversion.
  4. Check that the title and table are rendered. If the table remains plain text, check the selected parser and its table support before editing the file.

MarkdownPreview also documents an enable_autoreload option for updates on save. If you choose its GitHub or GitLab API parser, the source is sent to the selected service for rendering. Use the local parser for files you do not want to send to those services. See the MarkdownPreview usage guide.

Preview Mermaid Live

  1. Install MarkdownPreviewEnhanced through Package Control.
  2. With the same file active, run MarkdownPreviewEnhanced: Toggle Preview.
  3. In the browser, check that the Mermaid block appears as three boxes joined by arrows. Change Review[Review] to Review[Peer review] and look for the label to update.

MarkdownPreviewEnhanced documents live browser updates, scroll sync, and Mermaid support. The preview opens in a browser tab. On Windows, snap the Sublime window to one side and the browser to the other. On another operating system, arrange the two windows side by side with its window manager. This keeps the editor available even if the preview tab needs to be refreshed. MarkdownPreviewEnhanced documentation

Fix Common Preview Problems

What you see What to check
The command is missing Check which package you installed. Markdown Preview: Preview in Browser and MarkdownPreviewEnhanced: Toggle Preview belong to different packages.
The diagram appears as source Confirm the fence starts with three backticks followed by mermaid, and that you opened the preview that renders Mermaid.
The test diagram works but your diagram fails Compare the supported Mermaid syntax with the version that generated the diagram. Start with the Mermaid version compatibility guide.
The wrong file updates Focus the intended .md file in Sublime Text, run its preview command again, and change one word to confirm the tab is paired with that file.
A local image is missing Check its path relative to the Markdown file and verify that the image stayed next to the file when you moved it. See how local Markdown images work.

For a second rendering check, open the same file in mdview.io or paste just its diagram into the Mermaid viewer. If the small example fails in one preview but works in another, you have narrowed the problem to the selected preview or its configuration.

For previewing in other editors, see the JetBrains, Sublime, Neovim, and Emacs comparison.