Markdown Editor v2 for Visual StudioDownload this extension from the Visual Studio Marketplace or get the CI build. This extension delivers a full featured Markdown editor with live preview, syntax-aware editing, and turnkey workflows for GitHub flavored Markdown.
Getting Started
Feature HighlightsEditing essentials
Live preview
Navigation and structure
Media workflows
Productivity tools
The sections below dive deeper into each area and include screenshots for quick orientation. Live Preview WindowMarkdown documents can be viewed in three modes:
Use the document toolbar to select a mode directly.
Every time the markdown document is modified, the preview window will update. The preview window is automatically scrolled to match the scroll position of the document. As the document is scrolled up and down, the preview window will follow. Live preview can be managed in the settings. The preview follows the document host's available size, including on high-DPI displays. Switching to Preview view and resizing the window preserves the saved split size for when you return to Split view. The document toolbar fills the available width and adapts to the native Visual Studio toolbar height rather than clipping it to a fixed height. When preview click synchronization is enabled, a plain click updates the source position without taking keyboard focus away from the preview. Selecting text or double-clicking a word does not trigger an additional source navigation. Syntax highlightingAll fonts can be changed in Tools -> Options -> Environment -> Fonts and Colors dialog.
GitHub and other flavorsAdvanced markdown extensions are supported to give more features to the syntax. This includes pipe tables, emoji, mathematics and a lot more. Azure DevOps wiki syntaxThe editor supports Azure DevOps wiki-specific syntax for generating a table of contents. Table of Contents ( Add
This syntax is case-sensitive and must appear on its own line, matching Azure DevOps wiki behavior. Mermaid diagram supportThe editor supports all Mermaid diagram types for visualizing complex information. Mermaid diagrams are rendered in the live preview window using the native Mermaid.js library. Supported diagram types include:
Example - Flowchart:
Example - Sequence Diagram:
Mermaid diagrams automatically adapt to the current Visual Studio theme (light or dark mode). Standalone Mermaid filesIn addition to Mermaid code blocks in Markdown, the extension also supports standalone Mermaid files with
This is useful when you want to maintain complex diagrams as separate files or share them across multiple documents. Root path configuration for Jekyll/GitHub PagesWhen working with static site generators like Jekyll or GitHub Pages, you may want to use root-relative paths (paths starting with Option 1: YAML front matter (per-file)Add
Option 2: .editorconfig (project-wide)Add
This is useful when you want to set the root path once for an entire project rather than adding front matter to each file.
Priority: YAML front matter takes precedence over In these examples:
Key features:
Preview path boundariesFor security, local images and links are rendered only when their resolved paths remain within the preview root. The preview root is selected in this order:
Relative references can traverse any number of parent directories as long as they remain inside that root. For example, Typical Jekyll structure:
This feature is particularly useful when editing Jekyll blog posts where the actual URL structure differs from the file system layout. Table formattingUse Visual Studio's standard format commands to align and beautify pipe tables: Ctrl+K, Ctrl+D formats all tables in the document. Ctrl+K, Ctrl+F formats tables within the current selection. Suggested action: When your cursor is inside a pipe table, a lightbulb suggestion offers Format Table to align and pad the table in place. The formatter aligns columns, pads cells to consistent widths, and respects column alignment markers ( Enable or disable this behavior in Tools -> Options -> Text Editor -> Markdown -> Advanced -> Auto-format tables. Before:
After:
Table sortingDouble-click any table header to sort the table by that column. Double-click again to toggle between ascending and descending order. Table headers are underlined to indicate they are clickable. Before (unsorted):
After clicking "Name" header (sorted ascending):
The sorter handles numeric values intelligently, so columns with numbers sort numerically rather than alphabetically. Column alignment is preserved after sorting. Enable or disable this feature in Tools -> Options -> Text Editor -> Markdown -> Advanced -> Enable table sorting. IntelliSenseEmoji IntelliSenseYou get full IntelliSense for over 1,600 emoji and smiley characters.
File path IntelliSenseWhen typing links
Filesystem discovery runs in the background, and canceled or superseded completion requests are discarded so slow folders do not block typing. Anchor IntelliSenseType
Headings are shown with their level indicator (H1, H2, etc.) and automatically generate GitHub-compatible anchor slugs. Duplicate headings are handled with Headings ending in inline HTML icons no longer acquire an incidental trailing
hyphen (for example, Cross-document anchors: You can also get anchor completions for other markdown files by typing the file path followed by
IntelliSense will parse the target markdown file and show all available headings. Go to linked filesPlace the caret anywhere on a local Markdown link or image reference and press Markdown heading fragments navigate directly to the matching heading. VS Code-style
line fragments such as Heading-based navigationThe NavigationBar shows all of the document headings, like a table of contents. Select a heading to jump to that section of the document.
Document OutlineThe Document Outline tool window (View -> Document Outline) provides a persistent, hierarchical view of all markdown headings in your document. This is especially useful for navigating large documents. Features:
The Document Outline complements the NavigationBar dropdown by providing an always-visible overview of your document structure.
Line links to source filesLinks to local files in the preview can include a VS Code-style line fragment to jump straight to a specific location when the file is opened. This is especially useful when an AI assistant generates links into your codebase. Syntax:
Line and column numbers are 1-based and are clamped to the file's contents, so out-of-range values still open the file at the closest valid position. The targeted line is centered in the editor and focus is moved to the opened document. Drag 'n drop imagesDrag an image directly from Solution Explorer onto the document to insert the appropriate markdown that will render the image. Paste imagesThis is really helpful for copying images from a browser or for inserting screen shots. Simply copy an image into the clipboard and paste it directly into the document. This will prompt you for a file name relative to the document and then it inserts the appropriate markdown. It will even parse the file name and make a friendly name to use for the alt text. Image Optimizer integrationThis extension integrates with the Image Optimizer extension to optimize images. Automatic optimization on paste: When you paste an image into a markdown document, it can be automatically optimized using lossless compression. This feature is enabled by default and can be toggled in Tools -> Options -> Text Editor -> Markdown -> Advanced -> Optimize images on paste. Suggested actions: When your cursor is on an image reference in markdown (e.g.,
OutliningAny fenced code and HTML blocks can be collapsed, so that this:
...can be collapsed into this:
Keyboard shortcutsCtrl+Alt+R Refresh the preview window. Ctrl+Alt+K Inserts a new link. Ctrl+B makes the selected text bold by wrapping it with Ctrl+I makes the selected text italic by wrapping it with Ctrl+Space checks and unchecks task list items.
Tab increases indentation of list items. Shift+Tab decreases indentation of list items. Ctrl+K,C wraps the selection with HTML comments. Ctrl+K,U removes HTML comments surrounding the selection/caret. Markdown document toolbarMarkdown documents include a native Visual Studio toolbar above the editor. Use Source, Split, and Preview to switch directly between document views. F7 cycles forward through the views and Shift+F7 cycles backward. The toolbar is initialized after the document tab becomes visible and its initial layout and rendering have run. Opening a Markdown file in a background tab does not initialize its native controls until that tab is selected. Once created, the toolbar is retained across tab switches and released when the document closes, rather than being torn down and recreated on each activation. Preview browser controls are also created only for a visible preview, after initial layout and rendering. Source-only and background documents do not construct WebView2 controls on the initial file-opening path. Caret, selection, and typing updates are coalesced over 150 ms. Formatting buttons share analysis of the current snapshot and selection instead of rescanning the document separately for each button. Tables of contents enclosed in Available actions:
Formatting commands are disabled in Preview mode because the Markdown source is hidden. AutomationVS command URL scheme supportThe markdown editor now supports executing Visual Studio commands directly from links in the preview window using the Example usage:
When you click these links in the preview window, the corresponding Visual Studio commands will be executed. A status message will show the result of the command execution. Custom styles and templateYou can provide your own .CSS and HTML templates used to render the preview window. The extension will look for the files md-styles.css and md-template.html in the same folder and any parent folder. If one or both of these files are found, they are being applied in the preview. The HTML template must contain the string [content] which is where the rendered markdown will be injected. You have to refresh the preview window after making changes to the custom CSS and HTML file. You can do that from the markdown editor context menu or by hitting Ctrl+Alt+R. HTML generation in Solution ExplorerRight-click a markdown file in Solution Explorer and select Generate HTML file to enable automatic HTML output.
Automatic regeneration requires a project that supports nesting the generated HTML
under the markdown file using Context menuRight-click anywhere in the markdown document to access the Markdown submenu with common tasks, such as toggling the preview window scroll sync, see Markdown references, and getting to the settings dialog.
SettingsControl the settings for this extension under Tools -> Options -> Text Editor -> Markdown
Community Feature RequestsThis extension addresses several popular feature requests from the Visual Studio Developer Community:
How can I help?If you enjoy using the extension, please give it a ★★★★★ rating on the Visual Studio Marketplace. Should you encounter bugs or if you have feature requests, head on over to the GitHub repo to open an issue if one doesn't already exist. Pull requests are also very welcome, since I can't always get around to fixing all bugs myself. This is a personal passion project, so my time is limited. Another way to help out is to sponsor me on GitHub. DevelopmentNuGet versions are maintained in
To run this formatting check before each commit, configure Git to use the local
The hook checks formatting only; run tests separately as described below. Running testsBuild the solution on Windows using Visual Studio with the extension development tools
and .NET Framework 4.8 targeting pack installed. Tests also require Node.js 22 or newer
on Run the tests from Test Explorer, or from the repository root after building:
The normal MSTest run also executes Browser test output includes render timings and retained MathItem counts. Timings include browser IPC and test polling, not Visual Studio typing-to-paint latency. These tests do not replace profiling the installed extension during a long editing session: verify colorization while typing, edits and undo in a large mixed-content document, and retained managed/native memory after repeatedly opening and closing editors. DOM reuse currently matches exact block markup, so changes to line-marker IDs can recreate otherwise unchanged blocks. For preview-host changes, also test the installed extension in Visual Studio: repeatedly detach and redock a Markdown document, switch between Source, Split, and Preview (including moving the window while in Source), and click between the floating preview and another document to verify activation. Close a document while its preview initializes and verify that inactive previews do not steal focus. |









