How to convert Markdown to HTML
Short answer: Markdown was designed to be turned into HTML, so most Markdown tools can do it. For control, use pandoc. For a quick, readable copy of one file, export from Typora or VS Code, or use a viewer’s HTML download.
Updated 15 October 2026. pandoc options follow the pandoc manual.
pandoc: the flexible way
- Install pandoc
Download it from pandoc.org, or install it with your package manager.
- Convert to a full page
Run
pandoc -s notes.md -o notes.html. The-s(standalone) flag adds the<head>and<body>; without it you get a fragment to paste into another page. - Match GitHub’s dialect if needed
Add
-f gfmto read the file as GitHub-Flavored Markdown, so tables and task lists are read the way GitHub reads them. - Make it self-contained
Add
--embed-resourcesto put stylesheets and images inside the HTML file, so it works when sent on its own.
Useful extras: --toc adds a table of contents (standalone output only), --css style.css links your own stylesheet, and --metadata title="My notes" sets the page title. pandoc can also go the other way, from HTML to Markdown.
Typora
Typora has File › Export › HTML, which keeps its theme, and HTML (without styles), which gives you clean markup to style yourself.
VS Code
VS Code’s built-in preview shows HTML but doesn’t save it. The Markdown PDF extension adds Markdown PDF: Export (html) to the Command Palette.
In Chrome, with Quire Markdown
Quire Markdown is our extension, free on the Chrome Web Store. It is a reader, but it can save what you are reading as a single HTML file.
- Open the file
Choose Open file, drop a .md file onto the viewer, or paste Markdown.
- Download
Open the More menu and choose Download as HTML. The file takes the document’s name, ending in .html.
What you get is one self-contained file with simple built-in styling: a readable column, bordered tables, shaded code blocks and linkable headings. It has no scripts and loads nothing from other websites, so it opens the same way anywhere. Things to know:
- Code keeps its shading but not its syntax colours.
- Images are not included; they appear as “[Image not loaded: …]” labels. The file also tells the browser not to load any images.
- Relative links such as
docs/setup.mdbecome plain text; fullhttps://links stay clickable. - Scripts, forms and embedded content in the Markdown are removed, which makes it a safe copy of an untrusted file.
Which should you use?
- A web page or documentation site: pandoc with your own CSS, or a static site generator.
- A styled copy to send to someone: Typora’s export, or pandoc with
--embed-resourcesif it has images. - A plain, safe copy of something you were reading: Quire’s HTML download.
Questions
Is HTML allowed inside Markdown?
Usually yes; most Markdown dialects pass HTML through. Converters and viewers differ in what they keep. pandoc keeps raw HTML by default, while viewers that handle untrusted files, including Quire, remove scripts and other active content.
Can I convert Markdown to HTML online?
Many sites will, but they receive your text. For private notes, use one of the local tools above.