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.
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.
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.
- 1Open MarkdownPreview.net.
- 2Drag a
.md,.markdown, or.txtfile onto the editor, click Open File, or paste Markdown into the left pane. - 3Read it in the right pane — or switch to Preview mode for a full-width reading view.
- 4Optional: Export to HTML, PDF, or PNG, or Share a link that contains the document.
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.
- 1Open the GitHub Markdown Preview.
- 2Paste
owner/repo, a repository URL, or a link to a specific file (github.com/owner/repo/blob/branch/docs/setup.md). - 3Click Fetch & Preview. Relative image links are rewritten so images load.
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.
- 1Go to
vscode.dev. - 2Choose Open Folder (or Open File) and grant access when the browser asks.
- 3Open a
.mdfile and press Ctrl+Shift+V (⇧⌘V on Mac), or Ctrl+K V for a side-by-side preview.
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.
- 1On any repository or pull request on github.com, press . (or change
github.comtogithub.devin the URL). - 2Open the
.mdfile and press Ctrl+Shift+V / ⇧⌘V for the preview.
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.
- 1For a file in a repository, just open it on github.com — Markdown files are rendered automatically.
- 2While editing a file in the browser, switch to the Preview tab before committing.
- 3For text that isn’t in a repository, create a gist at
gist.github.com, name the filesomething.md, and choose Create secret gist.
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.
- 1Install an open-source viewer such as Markdown Viewer (by simov; available for Chrome, Firefox, Edge, Opera, Brave, and Vivaldi).
- 2In Chrome or Edge, open
chrome://extensions(oredge://extensions), click Details on the extension, and turn on Allow access to file URLs. - 3Open a
.mdfile with the browser (drag it in or press Ctrl+O). - 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.
Comparison table
| Method | You need | Local files | Rendering | Mermaid | Math | Your text uploaded? |
|---|---|---|---|---|---|---|
| Online previewer (this site) | Nothing | Yes | GFM + alerts | Yes | KaTeX | No |
| GitHub URL fetch (this site) | Public repo | No | GFM + alerts | Yes | KaTeX | No (downloads from GitHub) |
| vscode.dev | Nothing | Yes | CommonMark (VS Code) | Yes | KaTeX | No |
| github.dev | GitHub account | No | CommonMark (VS Code) | Yes | KaTeX | Already on GitHub |
| github.com / secret gist | GitHub account | No | Exact GitHub output | Yes | MathJax | Yes |
| Markdown Viewer extension | Extension | Yes | GFM (configurable) | Opt-in | Opt-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.
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?
Can I preview Markdown offline?
Is it safe to preview confidential Markdown online?
How do I preview a .md file on my phone?
Which method shows exactly what GitHub will display?
Can I preview Markdown with Mermaid diagrams and math in the browser?
Sources
- VS Code docs — Visual Studio Code for the Web — opening local files and folders, browser support
- GitHub Docs — Using VS Code for the Web from GitHub (github.dev) — the "." shortcut and sign-in requirement
- GitHub Docs — Creating gists — secret gists are not private
- Markdown Viewer (simov) — README — supported browsers, file access, default options
- MDN — FileReader — how browsers read local files without uploading them