Markdown to HTML converter

Type or paste Markdown and get clean HTML with a live preview. Raw HTML is escaped by default, so the output is safe to publish. Runs in your browser; nothing is uploaded.

How to use the converter

  1. Type in the Markdown box, paste text, or press Open file to load a .md file (it is read by your browser, not uploaded). The example shows most of the supported syntax.
  2. Watch the Preview update as you type. Switch to HTML to see the code.
  3. Press Copy HTML to paste it into a CMS, email template or web page, or Download .html for a complete page you can open in any browser.

Supported Markdown

Markdown is a way of writing formatted text with plain characters, created by John Gruber in 2004. Today most tools follow CommonMark, a precise specification of the original idea, and many add the GitHub Flavored Markdown (GFM) extensions for tables, strikethrough and task lists. This converter handles:

ElementMarkdownHTML
Heading# Title … ###### Small<h1> to <h6>
Heading (underlined)Title then === or ---<h1>, <h2>
Bold**bold** or __bold__<strong>
Italic*italic* or _italic_<em>
Strikethrough~~gone~~<del>
Link[text](https://example.com "title")<a href>
Reference link[text][id] and [id]: https://…<a href>
Image![alt text](photo.png)<img>
Inline code`code`<code>
Code block``` or ~~~ fences, or 4-space indent<pre><code>
Bullet list- item (or * or +)<ul><li>
Numbered list1. item (or 1) item)<ol><li>
Task list- [ ] to do / - [x] donecheckbox
Quote> quoted text<blockquote>
Table| a | b | then |---|:-:|<table>
Horizontal rule--- or *** or ___<hr>
Line breaktwo spaces or \ at line end<br>

Use a backslash to show a character that would otherwise be formatting, for example \*not italic\*. HTML entities such as &copy; are passed through unchanged.

Safety: raw HTML and links

Markdown lets you mix in HTML, which is convenient for your own writing and dangerous for anything someone else wrote: a pasted <script> tag or an onerror attribute could run code on any page that shows the result. So by default this converter escapes all raw HTML: it appears in the output as visible text, never as tags. Link and image addresses are checked too. Links may use http, https, mailto, tel and ftp or be relative; images may use http, https or a relative path. Anything else, including javascript: and data:, is dropped and only the text is kept.

If you tick Keep raw HTML, HTML tags and blocks are copied into the output as written, which is what most Markdown tools do. The preview is shown in a sandboxed frame that cannot run scripts either way, but the HTML you copy is not cleaned in that mode, so use it only for your own Markdown. Note that images in the preview are loaded by your browser from wherever they are hosted, as on any web page.

Limits (please read)

This is a compact converter written for this page, not a full CommonMark implementation, and it is not checked against the official CommonMark test suite. For everyday documents (notes, READMEs, blog posts, release notes) the output should match what GitHub or a CommonMark library produces. The differences show up in edge cases:

If you need exact CommonMark output for a build pipeline, use a library such as commonmark.js, markdown-it or cmark-gfm. For quick conversions, previews and copying HTML into another tool, this page does the job without installing anything.

Tips

Related tools

Check the length of your text with the character counter, or clean up text pasted from a PDF with remove line breaks. Working on an API? The JSON formatter pretty prints responses. If you write in Markdown every day, our Obsidian review covers a popular notes app built on plain Markdown files.

Frequently asked questions

How do I convert Markdown to HTML? +

Paste or type Markdown into the left box. The preview shows how it will look and the HTML tab shows the generated code, which you can copy or download. Everything updates as you type, and the conversion happens in your browser.

Is the HTML output safe to put on my website? +

With the default settings, yes: any raw HTML in your Markdown is escaped so it shows as text, and links or images with javascript:, data: and other unsafe address schemes are dropped. If you turn on Keep raw HTML, only do so for Markdown you wrote or trust.

Does this support GitHub Flavored Markdown? +

It supports the parts of GitHub Flavored Markdown people use most: tables with column alignment, strikethrough with double tildes, task list checkboxes and bare links that start with http:// or www. It does not do GitHub-specific features such as @mentions, issue references, emoji shortcodes or footnotes.

How do I make a line break in Markdown? +

End the line with two spaces or a backslash, then press Enter. A plain line break inside a paragraph is treated as a space, which is standard Markdown. If you want every Enter to become a line break, as in GitHub comments, tick Line breaks become <br>.

Why does my list or code block not look right? +

Indentation is the usual cause. Nested list items need to be indented to line up with the text of the item above (usually 2 spaces for - and 3 for 1.). Fenced code blocks need the same number of backticks to open and close, each on its own line.

Related