Markdown cheatsheet · Markdown to HTML
Markdown to HTML
Markdown was designed as a shorthand for HTML, so this is the one conversion every tool handles natively: the syntax maps straight onto tags.
What conversion produces
Each construct becomes one element: # is a heading, **bold** is <strong>, a blank line starts a new paragraph. A converter walks the file and emits exactly those tags, nothing else.
# Title Some **bold** text.
<h1>Title</h1>
<p>Some <strong>bold</strong> text.</p>
Pandoc
Pandoc is the standard command line converter; it reads and writes dozens of formats, and markdown to HTML is the most common pair. Once installed, it is one command.
pandoc notes.md -o notes.html pandoc -s notes.md -o notes.html
The first writes an HTML fragment: body content only, no <html> or <head>. Good for pasting into an existing page.
The second adds -s (standalone) and produces a complete page, ready to open in a browser.
marked / markdown-it (Node)
If you have Node installed, marked converts a file with no setup at all:
npx marked README.md > readme.html
markdown-it ships a command line tool as well, but both projects matter mostly as libraries: they are the parsers you embed when your own app needs to turn markdown into HTML.
Static site generators
One file is a conversion; a folder of files is a website. Hugo, Jekyll, Eleventy and Astro all follow the same model: point them at a directory of .md files, pick a theme or write a few templates, and they build every page, the navigation and the feed in one pass. For a blog or a documentation site this is the right route; converting files by hand stops scaling around the third page.
From an editor
maxdown exports the note you are editing as a styled, standalone HTML file. Open the .md file (or the whole folder), export, and you get a page that carries its own styling and reads as a finished document, not browser defaults on bare tags. It is the shortest route to sharing a single note as a web page, with no pipeline to maintain.
Also on paper: the same export produces PDF when the destination is print rather than the web. See markdown to PDF.
Common questions
Does the output include styling?
No. Converters emit bare semantic HTML and leave presentation to you. Link your own stylesheet, pass one to pandoc with -s --css style.css (or supply a custom template), or use an editor's styled export and skip the CSS step entirely.
Can I mix HTML into markdown?
Yes. Raw HTML passes through untouched wherever the renderer allows it, so a <details> block or a styled <span> can sit in the middle of a markdown file. Sites that render untrusted markdown (GitHub among them) sanitize the output and strip tags like <script>.