Markdown to HTML Converter
Convert Markdown to HTML with live preview. GitHub Flavored Markdown support.
Markdown Input
Output
Convert Markdown into Clean HTML Code
This Markdown to HTML converter takes Markdown you already have, such as a README, release notes, or a draft exported from a notes app, and gives you the HTML markup to paste into a CMS, an email template, a static site, or any page that does not render Markdown itself. The output is the point: you can read the generated tags in the Code tab, copy them as a fragment, or download a complete .html file. If you want to write and format a long document with a toolbar and live preview, the Markdown Editor is built for that instead.
How to Use the Markdown to HTML Converter
- Type or paste into Markdown Input. You can also click Sample Markdown to load an example, or Upload .md to open a .md, .markdown or .txt file from your device.
- The Output pane updates as you type. Preview shows the rendered result; Code shows the raw HTML.
- Set the options: Sanitize HTML (on by default), Line Numbers on Code, and Include CSS in Download.
- Click Copy HTML to copy the HTML fragment, Download .html to save it as converted.html, or Download .md to save your Markdown as content.md.
The stats bar shows the length of your Markdown (MD Chars), the length of the generated HTML (HTML Chars), and an estimated size.
Example: Markdown In, HTML Out
This Markdown uses a heading, bold text, a link, a single line break, a task list and a table with a right-aligned column:
## Install
Run the **build** step, then read the [docs](https://example.com).
Keep this line separate.
- [x] Tests pass
- [ ] Deploy
| File | Size |
|------|-----:|
| a.md | 2 KB | With Sanitize HTML on, the converter produces:
<h2>Install</h2>
<p>Run the <strong>build</strong> step, then read the <a href="https://example.com" target="_blank" rel="noopener noreferrer">docs</a>.<br>Keep this line separate.</p>
<ul>
<li><input checked="" disabled="" type="checkbox"> Tests pass</li>
<li><input disabled="" type="checkbox"> Deploy</li>
</ul>
<table>
<thead>
<tr>
<th>File</th>
<th align="right">Size</th>
</tr>
</thead>
<tbody><tr>
<td>a.md</td>
<td align="right">2 KB</td>
</tr>
</tbody></table> A few things to notice:
- Single line breaks become
<br>. The converter treats every newline inside a paragraph as a hard break, the way GitHub comments do. Standard Markdown would join the two lines with a space. Leave a blank line between paragraphs to get separate<p>elements. - Task list items become disabled checkboxes, and table alignment set with colons in the divider row is written as an
alignattribute. - Headings have no
idattributes, so add them yourself if you need anchor links such as#install. - Links open in a new tab when sanitizing is on: every link gets
target="_blank"andrel="noopener noreferrer". With sanitizing off, links are output exactly as written.
Supported Markdown Syntax
The converter uses the marked library with GitHub Flavored Markdown (GFM) enabled. That covers headings, bold, italic, ~~strikethrough~~ (output as <del>), links, images, inline code, fenced code blocks, ordered and unordered lists, task lists, blockquotes, tables, horizontal rules, and bare URLs such as https://example.com, which are turned into links automatically. Footnotes and emoji shortcodes like :smile: are not supported.
Fenced code blocks keep their language label as a class, so ```js produces <pre><code class="language-js">. The converter does not color the code itself. To get syntax highlighting, load a highlighter such as Prism or highlight.js on the page where you publish the HTML; both read these class names.
Sanitize On or Off
Markdown allows raw HTML, and the converter passes it through. What happens next depends on Sanitize HTML:
- On: the HTML is cleaned with DOMPurify. Script tags, event-handler attributes such as
onclick, andjavascript:links are removed. This page also strips<style>and<form>elements and allstyleattributes, so<span style="color:red">becomes a plain<span>. - Off: you get exactly what the Markdown parser produced, including any raw HTML from your input. Use this only for Markdown you wrote or trust, for example when you deliberately embed a
<video>tag or inline styles.
The Preview tab always renders inside a sandboxed frame that cannot run scripts, so previewing is safe either way. The setting matters for the HTML you copy or download, because that code may end up on a live site.
Copy HTML vs. Download .html
Copy HTML gives you only the converted fragment, which is what you want for a CMS field or an existing template. Download .html wraps the same fragment in a complete document with a doctype, UTF-8 charset, viewport meta tag and the title "Converted HTML". Tick Include CSS in Download to add a small stylesheet for readable fonts, code backgrounds and table borders; it affects only the downloaded file. Line Numbers on Code inserts a numbered <span class="line-number"> before every line of each code block, blank lines included, and adds a with-line-numbers class next to the existing language-* class. The spans become part of the copied HTML and of the code's text, so leave the option off if you plan to use a syntax highlighter or want readers to copy the code cleanly.
If the HTML is headed for production, you can shrink it with the HTML, CSS and JS minifier. To go the other way and turn an existing web page into Markdown, use the HTML to Markdown converter.
Frequently Asked Questions
Does this converter support GitHub Flavored Markdown?
Yes. Tables, task lists, strikethrough, fenced code blocks and automatic links for bare URLs all work. Unlike a GitHub README, single line breaks become <br> tags, headings do not get anchor IDs, and code blocks are not colored.
Why did my line breaks turn into <br> tags?
The converter treats each newline inside a paragraph as a hard line break. If your Markdown is wrapped at a fixed width, join each paragraph into one line, or separate paragraphs with a blank line so they become <p> elements.
What does "Sanitize HTML" do?
It runs the generated HTML through DOMPurify, which removes scripts, event handlers and javascript: links. This page also removes style and form elements and style attributes, and makes every link open in a new tab. Keep it on whenever the Markdown comes from someone else.
Does it add syntax highlighting to code blocks?
No. It adds a class such as language-js or language-python to each fenced code block that has a language label. A highlighting library like Prism or highlight.js on your own site can use that class to color the code.
Can I get a full HTML page instead of a fragment?
Yes. Download .html saves a complete document with doctype, head and body. Copy HTML copies only the fragment that goes inside the body.
Is my Markdown uploaded anywhere?
No. The page loads the marked and DOMPurify libraries, then converts your Markdown in your browser. Your text and uploaded files are not sent to a server.
Love using BreezyTools?
Go Pro for an ad-free experience, priority features, and support independent development — for less than a coffee a month.