Browser Workflow Guide

How to Preview Markdown in a Browser (6 Free Ways)

Someone sent you a README, or you just want to read a .md file properly — but your browser shows a wall of asterisks and hash marks. Here are six free ways to render it in Chrome, Edge, Firefox, or Safari, what each is best at, and what happens to your file with each one.

Updated 8 min readBy the MarkdownPreview.net team
Quick answer

The quickest option is to drag the file onto MarkdownPreview.net (or click Open File). It renders immediately — tables, task lists, Mermaid diagrams, and math included — and the file never leaves your browser. For a folder of linked files, use vscode.dev; to see GitHub’s exact output, view the file on github.com.

Why browsers show Markdown as raw text

Browsers ship built-in viewers for HTML, images, and PDFs — not Markdown. We opened a local .md file in Chromium 141: it was treated as text/markdown and shown as plain text, with every # and ** visible. To see headings, tables, and links you need something that converts Markdown to HTML first — which is what every method below does, in a different place.

Where the conversion happens matters for privacy: in your browser (methods 1, 3, and 6), or on GitHub after you upload the content (method 5).

Method 1: Open or drag the file into an online previewer

Best for: Any .md file on your computer or phone, privately, with diagrams and math.

You need: Nothing — any modern browser.

  1. 1Open MarkdownPreview.net.
  2. 2Drag a .md, .markdown, or .txt file onto the editor, click Open File, or paste Markdown into the left pane.
  3. 3Read it in the right pane — or switch to Preview mode for a full-width reading view.
  4. 4Optional: Export to HTML, PDF, or PNG, or Share a link that contains the document.
The file is read with your browser’s FileReader API and rendered in the tab; it isn’t uploaded. Your document is autosaved in the browser, and previewing keeps working offline once the page has loaded. GitHub Flavored Markdown, alerts, footnotes, Mermaid, and KaTeX math are built in. Open a sample document to see it.

Method 2: Load a README or .md file from a GitHub URL

Best for: Reading documentation of a public repository without cloning it.

You need: The repository must be public.

  1. 1Open the GitHub Markdown Preview.
  2. 2Paste owner/repo, a repository URL, or a link to a specific file (github.com/owner/repo/blob/branch/docs/setup.md).
  3. 3Click Fetch & Preview. Relative image links are rewritten so images load.
Your browser downloads the file directly from GitHub (raw.githubusercontent.com, falling back to the GitHub API for READMEs with unusual names or branches). Unauthenticated API use is rate-limited by GitHub, so very frequent fetches may briefly fail.

Method 3: Use VS Code in the browser (vscode.dev)

Best for: A folder of Markdown files with cross-links, using VS Code's editor and preview.

You need: Chrome or Edge to open a local folder; other browsers can open individual files.

  1. 1Go to vscode.dev.
  2. 2Choose Open Folder (or Open File) and grant access when the browser asks.
  3. 3Open a .md file and press Ctrl+Shift+V (⇧⌘V on Mac), or Ctrl+K V for a side-by-side preview.
Opening a local folder relies on the browser’s File System Access API; per the VS Code docs, browsers without it can open files but not folders. The preview behaves like desktop VS Code — see our VS Code Markdown preview guide for settings and shortcuts.

Method 4: Use github.dev for files already in a repository

Best for: Reviewing and editing Markdown in your own (or any) GitHub repository, including pull requests.

You need: A GitHub account — github.dev requires you to be signed in.

  1. 1On any repository or pull request on github.com, press . (or change github.com to github.dev in the URL).
  2. 2Open the .md file and press Ctrl+Shift+V / ⇧⌘V for the preview.
github.dev is VS Code for the Web connected to the repository: no clone, no install, and you can commit your edits. It has no terminal, and only web-compatible extensions work.

Method 5: Let github.com render it (file view, Preview tab, or a gist)

Best for: Seeing exactly how GitHub will display a README or comment.

You need: A GitHub account to edit or create gists.

  1. 1For a file in a repository, just open it on github.com — Markdown files are rendered automatically.
  2. 2While editing a file in the browser, switch to the Preview tab before committing.
  3. 3For text that isn’t in a repository, create a gist at gist.github.com, name the file something.md, and choose Create secret gist.
This is the only option that is GitHub’s own renderer, so it’s the final word on GitHub-specific output. But your text is uploaded to GitHub, and — per GitHub Docs — secret gists aren’t private: anyone with the URL can view them. Don’t paste confidential content.

Method 6: Install a Markdown viewer extension for file:// links

Best for: Double-clicking local .md files and having them render in the browser every time.

You need: Installing an extension and granting it access to file URLs.

  1. 1Install an open-source viewer such as Markdown Viewer (by simov; available for Chrome, Firefox, Edge, Opera, Brave, and Vivaldi).
  2. 2In Chrome or Edge, open chrome://extensions (or edge://extensions), click Details on the extension, and turn on Allow access to file URLs.
  3. 3Open a .md file with the browser (drag it in or press Ctrl+O).
  4. 4Turn on the extras you need in the extension’s options: Mermaid, MathJax, table of contents, task lists, and footnotes are all off by default.
Convenient once set up, and it can auto-reload the page when the file changes. Only install extensions you trust: file-URL access lets an extension read local files you open in the browser.

Comparison table

MethodYou needLocal filesRenderingMermaidMathYour text uploaded?
Online previewer (this site)NothingYesGFM + alertsYesKaTeXNo
GitHub URL fetch (this site)Public repoNoGFM + alertsYesKaTeXNo (downloads from GitHub)
vscode.devNothingYesCommonMark (VS Code)YesKaTeXNo
github.devGitHub accountNoCommonMark (VS Code)YesKaTeXAlready on GitHub
github.com / secret gistGitHub accountNoExact GitHub outputYesMathJaxYes
Markdown Viewer extensionExtensionYesGFM (configurable)Opt-inOpt-in (MathJax)No

Which method should you use?

  • You just want to read or check one file: Method 1 — drag it into the online previewer.
  • The file is confidential: Method 1, 3, or 6 — rendering stays on your device. Avoid gists.
  • You have a folder of docs that link to each other: Method 3 (vscode.dev) in Chrome or Edge.
  • The file is in a GitHub repository: Method 2 to read it, method 4 (github.dev) to edit and commit.
  • You need GitHub's exact rendering: Method 5 — view it on github.com or in a secret gist.
  • You open local .md files every day: Method 6 — a viewer extension renders them on double-click.
  • You are on a phone or tablet: Method 1 — tap Open File and pick the file.
How we verified this guide

We opened a local .md file in Chromium 141 to confirm how a browser handles Markdown without help. Capabilities and requirements of vscode.dev, github.dev, gists, and the Markdown Viewer extension come from their official documentation, linked below — including which Markdown Viewer options are off by default.

The behavior described for MarkdownPreview.net (local file reading, autosave, rendering features) reflects how this site’s code works; see our privacy policy for details. Corrections are welcome at hello@markdownpreview.net.

Frequently asked questions

Why does my browser show raw text when I open a .md file?

Browsers have built-in viewers for HTML, images, and PDFs, but not for Markdown. When we opened a local .md file in Chromium 141, it was served as text/markdown and displayed as plain text, with every # and ** visible. You need a previewer, an editor such as vscode.dev, or an extension to render it.

Can I preview Markdown offline?

Yes. Once MarkdownPreview.net has loaded, opening, editing, and previewing files keep working without a connection, and drafts are autosaved in your browser. A viewer extension also works offline. Methods that load from GitHub need a connection.

Is it safe to preview confidential Markdown online?

It depends on where the rendering happens. On MarkdownPreview.net the file is read and rendered inside your browser and is not uploaded. Pasting into a gist or committing to GitHub uploads the content, and secret gists can be opened by anyone with the link.

How do I preview a .md file on my phone?

Open MarkdownPreview.net in your mobile browser, tap Open File, and pick the file from Files (iOS) or your file manager (Android). Use the Preview button for a full-width reading view. Files stored in a GitHub repository can also be read directly on github.com.

Which method shows exactly what GitHub will display?

Only GitHub itself: view the file on github.com, use the Preview tab while editing, or paste it into a secret gist. Our GitHub Markdown Preview supports the same syntax (tables, task lists, alerts, footnotes, Mermaid, math) and catches structural mistakes before you push, but uses different software, so tiny differences are possible.

Can I preview Markdown with Mermaid diagrams and math in the browser?

Yes. MarkdownPreview.net, vscode.dev, and github.dev render ```mermaid blocks and $...$ math out of the box. The Markdown Viewer extension supports both after you enable them in its options.

Sources

Have a .md file to read right now?
Drop it into the previewer — it never leaves your browser.
Open Markdown Previewer

More Markdown Tools & Guides

All tools are free, run in your browser, and require no account.

Live Markdown PreviewerTool

Edit Markdown with a real-time preview, Mermaid, KaTeX math, drag-and-drop files, and one-click export.

Open the tool
GitHub Markdown PreviewTool

Load any public README, test it, and look up any GitHub syntax in the complete cheat sheet.

Open the tool
Mermaid Live EditorTool

13 diagram types with examples, live rendering, and SVG/PNG download.

Open the tool
LaTeX Math PreviewTool

Typeset equations as you type, with a copy-ready KaTeX cheat sheet of 180+ commands.

Open the tool
README Template GeneratorTool

Pick sections, fill in your project, and download a GitHub-ready README.md with badges and a TOC.

Open the tool
AI Markdown ViewerTool

Paste ChatGPT, Claude, or Gemini output and read it formatted, with tables, code, and math.

Open the tool
What Is Markdown?Guide

A plain-English introduction: what Markdown and .md files are, where it came from, and where it is used.

Read the guide
Markdown in Google DocsGuide

Preview .md files in Drive, edit in Docs' Markdown mode, and paste, convert, or export Markdown.

Read the guide
Best Online Markdown ViewersGuide

Six free tools tested with the same document: rendering, privacy, and phone support compared.

Read the guide
GitHub Markdown Not Rendering?Guide

16 causes found by symptom — tables, lists, image paths, code fences, alerts, Mermaid, math — with tested fixes.

Read the guide
Markdown Preview in VS CodeGuide

Preview shortcuts, settings verified on VS Code 1.141, built-in Mermaid and math, extensions, and fixes.

Read the guide
How to Open an .md FileGuide

Open and read Markdown files formatted on Windows, Mac, Linux, iPhone, Android, Word, and Google Docs.

Read the guide
Markdown Preview in Any EditorGuide

Exact preview shortcuts for Visual Studio, JetBrains, Zed, Xcode, Sublime, Neovim, Obsidian, and more.

Read the guide