Markdown to HTML Converter

Convert Markdown to HTML with a live preview as you type. GitHub Flavored Markdown — tables, fenced code blocks, task lists — is supported, powered by the Marked library.

Copied
Markdown Input0 B
HTML Output0 B
Live Preview

What this Markdown to HTML converter does

The converter turns Markdown into an HTML fragment with Marked (version 18), using its default settings: CommonMark syntax plus the GitHub Flavored Markdown (GFM) extensions for tables, task lists, strikethrough and bare-URL links. The HTML appears in the output pane and is rendered in the Live Preview below it, updating about a quarter of a second after you stop typing.

Markdown is a shorthand for a subset of HTML, so the conversion is one-way and mostly mechanical: **bold** is <strong>, a line starting with # is <h1>. The interesting differences lie in which flavour of Markdown a tool understands and how it treats line breaks and raw HTML.

How to use the converter

  1. Type or paste Markdown into the Markdown Input pane. File opens a local .md file such as a README, and URL loads one from a server that allows cross-origin requests. Loaded files are converted straight away.
  2. The HTML appears in HTML Output and the rendered page in Live Preview. Convert re-runs the conversion immediately.
  3. Copy the HTML, Download it as converted.html, or Clear the input, output and preview.

The output is a fragment: no <html>, <head> or stylesheet, ready to paste into a template or CMS. The preview uses its own simple styles, so your site’s CSS will make the final page look different.

Supported Markdown syntax

Each row below was converted on this page:

MarkdownHTML output
# Title or a line underlined with ===<h1>Title</h1> (no id attribute)
**bold**, _italic_, `code`<strong>, <em>, <code>
~~old~~ or ~old~<del>old</del>
- [x] Done<li><input checked="" disabled="" type="checkbox"> Done</li>
3. three or 1) one<ol start="3"> / <ol>
Table with |:---|---:|<table> with <thead>, <tbody> and align="left" / align="right" on cells
```js fenced block<pre><code class="language-js">, with < escaped
https://example.com, www.example.com, [email protected]Links; www. gets http://, emails get mailto:
[link][ref] with [ref]: https://…<a href="https://…">link</a>

Footnotes ([^1]), definition lists, ==highlight== and superscript are not part of CommonMark or GFM and are left as plain text. One trap: H~2~O is read as strikethrough and becomes H<del>2</del>O. Use H<sub>2</sub>O instead.

Line breaks and paragraphs

A single newline inside a paragraph is kept as a newline in the HTML, which browsers display as a space. A blank line starts a new <p>. For a forced line break (<br>) end the line with two spaces or a backslash. GitHub comments treat every newline as a break, so text written there can wrap differently here.

Raw HTML and safety

CommonMark allows HTML inside Markdown, and Marked passes it through unchanged — including <script> tags and attributes such as onerror. On this page that is harmless: the output is shown as text, and the preview is a sandboxed frame in which scripts are blocked. If you publish HTML generated from Markdown that other people wrote, run it through an HTML sanitiser such as DOMPurify on your own site first; the OWASP XSS prevention cheat sheet explains why.

Common problems and fixes

ProblemCauseFix
Lines run togetherSingle newlines do not create <br>.Add a blank line, two trailing spaces or a trailing backslash.
Table shows as plain textThe delimiter row (|---|---|) is missing or has the wrong number of cells.Add a delimiter row under the header with one cell per column.
Markdown inside an HTML block is not convertedAn HTML block continues until a blank line, so Markdown inside it stays literal.Leave a blank line after the opening tag and before the closing tag.
Asterisks appear in the outputEmphasis markers must touch the text: ** bold ** is not bold.Remove the inner spaces, or escape a literal asterisk as \*.
Code blocks are not colouredThe converter adds a language-* class but no highlighting markup.Load a highlighter such as Prism or highlight.js on your site.

Frequently asked questions

Does it produce a complete HTML page?

No, it produces the body content only. Wrap it in your own template with a <!DOCTYPE html>, <head> and stylesheet, or paste it into a CMS field that accepts HTML.

Do headings get id attributes for anchor links?

No. Marked’s default output has plain <h1> to <h6> tags. Add ids by hand, or generate them with a plugin in your own build if you need a table of contents.

Will the HTML match what GitHub shows for my README?

The structure will be close, because both follow GFM. GitHub also adds heading anchors, syntax highlighting, emoji shortcodes and its own sanitising, so the markup is not identical.

How do I convert HTML back into Markdown?

Use the HTML to Markdown converter. Round trips are close but not exact; for example, it writes list items as - item and horizontal rules as * * *.

Is my Markdown uploaded?

No. The page downloads the Marked library from the jsDelivr CDN, but the conversion and the preview run in your browser and your text is not sent anywhere.

Related tools