My Tool Studio
Developer

Markdown to HTML Converter

This tool converts Markdown to HTML as you type, with a live preview beside your text. Write or paste Markdown on the left and switch between the Preview, HTML and CSS tabs on the right. It follows GitHub Flavored Markdown, so tables, strikethrough, task lists and fenced code convert along with headings, links and images. Options add ids to headings, turn single line breaks into <br>, open external links in a new tab, indent the HTML, and sanitize the output so scripts and event handlers are removed. Add your own CSS for the preview and the full page. Then copy the HTML, download it as a fragment or a full .html page, or print it to PDF. Conversion uses the marked library in your browser.

Always freeNo sign upRuns in your browser
Markdown to HTML cheat sheet
MarkdownHTML
# Heading 1 ... ###### Heading 6<h1> ... <h6>
**bold** or __bold__<strong>
_italic_ or *italic*<em>
~~strike~~<del>
[text](https://url)<a href="...">
![alt](image.png)<img src="..." alt="...">
- item or 1. item<ul><li> or <ol><li>
- [x] done<li><input type="checkbox" checked disabled>
> quote<blockquote>
`code`<code>
```js ... ```<pre><code class="language-js">
| a | b |, then | --- | --- |<table>
---<hr>
Two spaces at line end<br>

How to use

01

Write, paste or open Markdown

Type in the Markdown box, paste a document, or click Open .md file to load a .md, .markdown or .txt file. The starting sample shows headings, a table, a task list, a quote and code.

02

Set options and check the preview

Tick the options you want, such as Add id to headings or Sanitize HTML. The Preview tab shows the rendered page, the HTML tab the markup, and the CSS tab takes your own styles, all updating as you type.

03

Copy, download or print

Click Copy HTML, Download HTML only, Download full .html page or Download .md. Print or save as PDF opens your browser's print dialog, where you can choose Save as PDF.

Why Markdown to HTML Converter

Markdown syntax and the HTML it produces

Markdown is a shorthand for a small set of HTML elements. Knowing the mapping helps when a CMS or email tool accepts HTML but not Markdown, or when you need to style the output with CSS. The table shows what the converter produces for each piece of syntax.

Two details trip people up. A single line break inside a paragraph does not create a new line in the HTML unless you tick Single line break becomes <br>; otherwise leave a blank line to start a new paragraph. And a list needs a blank line before it when it follows a paragraph in some Markdown tools, so adding one is a safe habit.

MarkdownHTML
# Heading<h1>Heading</h1>
## Heading<h2>Heading</h2>
**bold**<strong>bold</strong>
*italic*<em>italic</em>
~~deleted~~<del>deleted</del>
[text](https://example.com)<a href="https://example.com">text</a>
![alt](photo.png)<img src="photo.png" alt="alt">
- item<ul><li>item</li></ul>
1. item<ol><li>item</li></ol>
> quote<blockquote><p>quote</p></blockquote>
`code`<code>code</code>
Three backticks around a block<pre><code>...</code></pre>
---<hr>
| a | b | table with a --- row<table> with <thead> and <tbody>

What each Markdown to HTML option does

The options change the HTML, not your Markdown, so you can switch them on and off and compare the HTML tab.

OptionEffect on the HTML
GitHub Flavored MarkdownTables, task lists, strikethrough and bare links. Untick for plain Markdown.
Single line break becomes <br>Every line break inside a paragraph becomes a <br>, like comments on GitHub.
Add id to headingsAdds id="what-changed" style ids so you can link to #what-changed.
Open external links in a new tabAdds target="_blank" and rel="noopener noreferrer" to http and https links.
Sanitize HTMLRemoves scripts, event handlers and other unsafe markup with DOMPurify.
Indent the HTML outputFormats the HTML with line breaks and indentation for reading.

Common questions

Does the Markdown to HTML converter support GitHub Flavored Markdown tables and task lists?
Yes. Pipe tables become table elements, - [ ] and - [x] items become disabled checkboxes, and ~~text~~ becomes a del element. Bare links starting with http or www are turned into links as well.
How do I turn a README.md into an HTML page?
Click Open .md file and choose the README, check the preview, then click Download full .html page. The file includes a doctype, a title from the first # heading, and CSS for readable text, tables and code blocks.
Can I add my own CSS to the Markdown HTML output?
Yes. Type it into the CSS tab and it is added after the default stylesheet, so your rules win. The preview and the full .html page both use it. The copied HTML fragment has no styles, so it picks up the styles of the page you paste it into.
Is the HTML from Markdown safe to paste into WordPress or another CMS?
With Sanitize HTML ticked, the default, DOMPurify removes script tags, event handlers such as onclick and javascript: links, so the output is safe to publish even from Markdown you did not write. Untick it only for trusted Markdown that needs embeds such as iframes. In WordPress, paste the fragment into a Custom HTML block.
Does anything get uploaded while I convert Markdown?
No. The marked library runs in your browser tab, and opened files are read locally. Your Markdown and the HTML never leave your device.
How does a fenced code block convert to HTML?
A block wrapped in three backticks becomes pre and code elements. If you add a language after the backticks, such as js, the code element gets class="language-js", which highlighters like Prism and highlight.js look for. The converter does not add colors itself.
Why is there no Convert button on the Markdown to HTML page?
Conversion is live. Every keystroke updates both the preview and the HTML, so there is nothing to press before copying or downloading.
Does the Markdown preview match the downloaded HTML page?
Yes. The preview renders the same full page you download, with the same small stylesheet and any CSS you added, inside a sandboxed frame where scripts cannot run. Fonts can still differ between computers, because the page uses each system's default sans-serif font.
Will raw HTML inside my Markdown be kept?
Yes, with Sanitize HTML unticked. Markdown allows HTML, and tags such as div, details or iframe pass through unchanged. With sanitizing on, safe tags like div and details stay, while script and iframe tags and event handler attributes are removed.
How do I save Markdown as a PDF?
Click Print or save as PDF. Your browser's print dialog opens with the formatted page, including any CSS you added; choose Save as PDF as the printer. Headings, tables and code blocks keep their styling.

More Developer tools

View all