Markdown to HTML Converter
Convert Markdown to clean HTML and see a rendered preview, entirely in your browser. CommonMark + GitHub tables. Nothing is uploaded.
Your stuff stays yours. The conversion happens in this page's JavaScript. Nothing you paste here leaves your machine, and the tool keeps working with the network unplugged.
Write or paste Markdown on the left; the raw HTML appears on the right and a rendered preview appears underneath, so you can check both what the markup is and what it looks like. Conversion uses marked, a widely used CommonMark-compliant parser, with GitHub-style extensions: tables, fenced code blocks, task lists, and strikethrough all work. The HTML output is unstyled and portable - paste it into a CMS, an email template, or a static site. And because the parser runs in this tab, drafts never leave your machine.
How to convert Markdown to HTML
- Paste or write your Markdown in Markdown in.
- Press Convert. The generated markup appears in HTML out, and a rendered preview appears below that box.
- Check the preview for structure: headings at the right level, lists nested where you meant, tables with the right columns. The preview is display only, and it does not run scripts.
- Press Copy result to copy the HTML (not the preview) and paste it into your CMS, email builder, or template. Clear empties the input and output boxes. If the old preview is still showing afterward, press Convert with the input empty and the preview is removed too.
How Markdown turns into HTML
Markdown is parsed in two passes. The first finds blocks: paragraphs, headings, lists, block quotes, code blocks, tables, and raw HTML. The second pass looks inside each block for inline elements: emphasis, links, code spans, and line breaks. Most confusing results come from the block pass, because blocks are decided by blank lines and indentation, which are hard to see.
A few block rules worth knowing:
- Paragraphs are separated by blank lines. A single line break inside a paragraph is kept as a newline in the HTML, which browsers display as a space. To force a visible line break, end the line with two spaces or a backslash, which produces
<br>. - Headings come from
#through######, or from a line underlined with===(level 1) or---(level 2). That second form is why a line of dashes directly under text turns the text into a heading instead of a horizontal rule. - Ordered lists use the first item's number as the start. A list beginning
3.becomes<ol start="3">, and the numbers after it are ignored. - Loose and tight lists: if list items are separated by blank lines, each item's text gets wrapped in
<p>tags, which usually adds vertical space. - Raw HTML blocks are passed through as they are, and Markdown directly inside them is not processed unless a blank line separates it from the tags.
The GitHub extensions this tool supports are defined in the GitHub Flavored Markdown spec, which is a good reference when a table or task list refuses to render.
A worked example
Input:
# Release notes
Version **2.1** adds a [changelog](https://example.com/changes) & fixes:
- [x] Faster export
- [ ] Dark mode
| Key | Default |
|-----|--------:|
| `timeout` | 30 |
~~Deprecated~~ flag removed.
Next line same paragraph.
Output in HTML out:
<h1>Release notes</h1>
<p>Version <strong>2.1</strong> adds a <a href="https://example.com/changes">changelog</a> & fixes:</p>
<ul>
<li><input checked="" disabled="" type="checkbox"> Faster export</li>
<li><input disabled="" type="checkbox"> Dark mode</li>
</ul>
<table>
<thead>
<tr>
<th>Key</th>
<th align="right">Default</th>
</tr>
</thead>
<tbody><tr>
<td><code>timeout</code></td>
<td align="right">30</td>
</tr>
</tbody></table>
<p><del>Deprecated</del> flag removed.
Next line same paragraph.</p>
Points to notice: the bare & was escaped to &, the colon in --------: right-aligned that column with an align attribute, the task list items became disabled checkboxes, and the last two lines stayed in one paragraph. Headings get no id attributes, so add them yourself if you need anchor links.
Common problems and how to fix them
A line of text became a heading
You wrote a paragraph and then --- on the next line, intending a divider. Put a blank line between the text and the dashes to get <hr> instead of <h2>.
Markdown inside a <div> shows up as literal asterisks
Once a raw HTML block starts, the parser copies lines through untouched until it reaches a blank line. Add a blank line after the opening tag and before the closing tag, and the content between is parsed as Markdown.
A link with spaces in the URL does not render
[report](my file.pdf) stays as plain text because a space ends the link destination. Wrap the destination in angle brackets, [report](<my file.pdf>), and the output is <a href="my%20file.pdf">. Better still, avoid spaces in file names.
Asterisks in math or prices turn into italics
2*4* becomes 2<em>4</em>. Escape the asterisks with a backslash, 2\*4\*, or put the expression in backticks as code. Underscores inside words such as snake_case_name are safe and stay literal.
A table row is missing cells, or a cell is split
Short rows are padded with empty cells, and extra cells beyond the header count are dropped. A literal pipe inside a cell splits it into two; escape it as \|.
Related tasks
To show HTML as visible text on a web page, for example in a tutorial, escape the output with the HTML entity encoder.
Questions this tool gets asked
Which Markdown flavor is this?
CommonMark via the marked parser, with GitHub Flavored Markdown extensions enabled: pipe tables, fenced code blocks, autolinks, and strikethrough. If it renders on GitHub, it should convert here.
Is the HTML output sanitized?
No - conversion is faithful, so raw HTML embedded in your Markdown passes through. That is what you want for your own documents. If you republish Markdown from strangers, run the output through a sanitizer like DOMPurify server-side.
Why does my nested list render flat?
Markdown nesting is indentation-sensitive: nested list items need consistent leading spaces (2-4 depending on the marker). Mixed tabs and spaces are the usual culprit.
Can I convert HTML back to Markdown?
Not with this tool - that reverse conversion is lossy and heuristic. This tool does the well-defined direction: Markdown to HTML.