Skip to content

Markdown to HTML Converter

Convert Markdown to HTML source code you can paste into any page.

Markdown

Tab inserts indentation. Press Escape, then Tab, to move focus out of the editor.

HTML

Output view

How to convert Markdown to HTML

  1. Paste Markdown on the left, or open a .md file such as a README.md.
  2. The HTML source code appears on the right and updates as you type. Switch to Preview to see how it renders.
  3. Choose the Output: HTML fragment (the default) for an existing page, or Full HTML document for a standalone file.
  4. Copy the HTML or download it as converted.html. The file contains exactly what is shown on the right: with the default setting a fragment without <!DOCTYPE>, <head> or <body>; with Full HTML document a complete page with a title from the first heading and simple inline styles.

The conversion runs in your browser; the Markdown is not sent to a server. Images your Markdown links to are loaded from their own sites when the preview shows them.

Convert a README.md to HTML

Click Open file and choose the README.md, or drag it onto the converter. Copy the HTML, or set the Output to Full HTML document and download a standalone page. This README:

README.md
# csv2json

Convert CSV files to JSON from the command line.

## Install

```bash
npm install -g csv2json
```

| Option | Default |
| :----- | ------: |
| `--pretty` | false |

- [x] CSV input
- [ ] Excel input

Jump to [Install](#install), read [CONTRIBUTING.md](CONTRIBUTING.md) or visit the [website](https://example.com).
HTML (fragment)
<h1 id="csv2json">csv2json</h1>
<p>Convert CSV files to JSON from the command line.</p>
<h2 id="install">Install</h2>
<pre><code class="language-bash">npm install -g csv2json
</code></pre>
<table>
<thead>
<tr>
<th align="left">Option</th>
<th align="right">Default</th>
</tr>
</thead>
<tbody><tr>
<td align="left"><code>--pretty</code></td>
<td align="right">false</td>
</tr>
</tbody></table>
<ul>
<li><input checked="" disabled="" type="checkbox"> CSV input</li>
<li><input disabled="" type="checkbox"> Excel input</li>
</ul>
<p>Jump to <a href="#install">Install</a>, read <a href="CONTRIBUTING.md">CONTRIBUTING.md</a> or visit the <a href="https://example.com" rel="nofollow noopener noreferrer">website</a>.</p>

The code block keeps its language as a language-bash class for syntax highlighters such as Prism or highlight.js, the table's column alignment becomes an align attribute, and task list items become disabled checkboxes. The relative link to CONTRIBUTING.md stays as written, while the link to another site gets rel="nofollow noopener noreferrer".

Headings get GitHub-style id attributes (## Install becomes id="install"), so table-of-contents links such as #install jump to the right section in the HTML. Relative image paths only work if the images sit next to the HTML file. To just read a README rendered, open it in the Markdown reader.

Rendered preview vs. HTML source

The Code view is the HTML source you copy into a template, CMS or email. The Preview view shows what a browser makes of it. The preview runs in a locked-down frame without scripts, so even HTML you chose to keep can't affect this page.

Features

  • CommonMark and GitHub Flavored Markdown (tables, task lists, strikethrough, autolinks).
  • HTML fragment or complete document with a title and basic styles.
  • Three modes for raw HTML: allow safe tags, show as text or keep as written.
  • Markdown links with unsafe URLs such as javascript: are always removed; raw HTML is only passed through unchanged with Keep as written.
  • Deterministic output: the same input always gives the same HTML.

Other Markdown and HTML tools

Write and preview Markdown first in the Markdown editor, or read finished files in the Markdown reader. Re-indent the generated HTML with the HTML formatter, open it in the HTML viewer, or keep working on it in the online HTML editor. To turn the result into a document you can print or attach, paste it into the HTML to PDF converter.

Frequently asked questions

Fragment or full HTML document — which do I need?
Choose a fragment to paste into an existing page, template or CMS. Choose a full document to get a standalone .html file with a <head>, a title taken from the first heading and simple readable styles.
Does it support GitHub Flavored Markdown?
Yes, it is on by default. Tables (with column alignment), task lists, ~~strikethrough~~ and bare URLs become HTML the way GitHub renders them. Untick GitHub Flavored Markdown to convert only standard CommonMark; those then stay plain text.
Is the HTML output sanitized?
By default, yes: raw HTML in the Markdown is rebuilt from a list of safe tags, so <script> tags, event handlers such as onclick and style attributes are removed, and links with unsafe URLs such as javascript: are dropped. Show as text displays raw HTML as code instead. Keep as written passes raw HTML through unchanged, so use it only for Markdown you trust.
Is my Markdown uploaded to a server?
No. The conversion runs in your browser, also for files you open, and the HTML is created on your device. Only images your Markdown links to are loaded from their own sites when the preview shows them.
Is the output the same every time?
Yes. The same Markdown and options always produce exactly the same HTML, so the output is safe to commit or compare in a diff.