Markdown to HTML

Converts Markdown to HTML — headings, emphasis, lists, links, images, code blocks and tables — with the output ready to paste into a page or a template.

Live demo · real result from this tool

HTML

<h1>Weekly update</h1><p>Shipped <strong>offline mode</strong> and fixed <em>three</em> bugs.</p><ul><li>Faster start-up</li><li><a href="https://example.com/docs">Docs</a></li></ul><table><thead><tr><th>Plan</th><th align="right">Price</th></tr></thead><tbody><tr><td>Free</td><td align="right">€0</td></tr></tbody></table><pre><code class="language-js">console.log(&quot;hello&quot;);</code></pre>

Preview

Processed on your device — nothing is uploaded.

How to use Markdown to HTML

  1. Paste your Markdown.
  2. The HTML appears alongside it.
  3. Copy it into your page or template, and add styling for the bare elements.
  4. A single newline joins lines into a paragraph; use a blank line or two trailing spaces for a break.
  5. Raw HTML in the Markdown passes through — sanitise anything user-supplied.
  6. The output has no classes and no image dimensions; both usually need adding.

There is no single Markdown

John Gruber’s 1.0 description from 2004 left plenty ambiguous, and implementations diverged. CommonMark is the strict specification that settles those cases. GitHub Flavored Markdown adds tables, task lists, strikethrough and automatic linking on top of it, and is what most people mean when they say Markdown today. Notion, Obsidian, Discord and Slack each add or omit things. So Markdown that renders correctly in one place can render differently in another, particularly around nested lists and line breaks.

The line-break rule that surprises everyone

A single newline in Markdown does not produce a line break — consecutive lines are joined into one paragraph, which is deliberate, so that prose can be wrapped in a source file without affecting output. To force a break you need either two trailing spaces at the end of the line, which are invisible and get eaten by editors that trim whitespace, or a backslash, or a blank line to start a new paragraph. GitHub renders single newlines as breaks in comments and issues but not in files, which is why the same text behaves differently in two places on the same site.

Markdown allows raw HTML, and that matters for safety

You can drop HTML directly into Markdown, and most converters pass it straight through. That is convenient for a video embed or an attribute a converter cannot express — and it means Markdown from an untrusted source is exactly as dangerous as untrusted HTML. If you accept Markdown from users, sanitise the rendered output; do not assume the format is safe because it looks like plain text.

Where the output still needs work

Converted HTML carries no classes, so it inherits whatever your stylesheet says about bare h2, p and ul elements — which in a modern CSS reset is usually nothing. Either write styles for a wrapping class, or use a typography plugin. Images come through without width and height attributes, so add them to avoid layout shift. And code blocks come through as plain pre and code without syntax highlighting, which is a separate step.

Frequently asked questions

What Markdown syntax is supported?
Standard Markdown including headings (#), lists (- *), links ([]()), images (![]()), code (`), blockquotes (>), and emphasis (* _) is fully supported.
Does it support GitHub Flavored Markdown?
Yes, features like tables, strikethrough (~~), task lists (- [ ]), and fenced code blocks (```) are supported.
Is the HTML output styled?
The output is semantic HTML without styling. Add your own CSS or use it with a Markdown CSS framework for styled output.
Why are my line breaks being ignored?
Because Markdown joins consecutive lines into one paragraph by design. Use a blank line for a new paragraph, or end a line with two spaces or a backslash to force a break. GitHub comments are an exception and do break on single newlines, which is why the behaviour seems inconsistent.
Can I use HTML inside Markdown?
Yes — raw HTML is passed through, which is how people embed videos and elements Markdown cannot express. The corollary is that Markdown from an untrusted source is as dangerous as untrusted HTML and needs sanitising.
Which Markdown flavour does this follow?
The common GitHub-flavoured set: headings, emphasis, lists, links, images, code blocks and tables. Extensions specific to one tool — Obsidian's wikilinks, Notion's blocks — are not part of it and will come through as plain text.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close