Skip to main content
ponderloop

Markdown to HTML Converter

Paste Markdown and the HTML comes out as you type: clean source to copy, and a preview that cannot run anything. The example is 518 characters of Markdown; it becomes 1,012 characters of HTML with 1 heading, 2 links and 1 image, a table, a task list and a code block. It reads CommonMark 0.31.2 plus GitHub-style tables, strikethrough and task lists. Raw HTML in your Markdown is escaped, not passed through, and links or images that use javascript:, vbscript: or a non-image data: address are neutralized. Your text never leaves the browser.

Updated Runs in your browser: nothing you enter is uploadedHow this tool works

Stays in your browser

Replace the example: paste or type Markdown. The HTML and the preview update as you type.

Your text is converted on this device and never uploaded. It is not saved either: reload the page and it is gone. Raw HTML in your Markdown is escaped, never run.

Options

HTML

518 characters of Markdown became 1,012 characters of HTML: 1 heading, 2 links, 1 image.

Preview

Images are not loaded here, so nothing contacts another website. Links open in a new tab.

Weekend plan

A short note with emphasis, strong text, a changed mind and inline code. Raw HTML such as <b>this</b> is shown as text, never run.

[Image: A cup of tea]

  1. First
  2. Second

A quote with a reference link.

Item Qty
Tea 2
Jam 10
const total = 2 + 10;

Counts

Characters of Markdown
518
Characters of HTML
1,012
Headings
1
Links
2
Images
1
Unsafe URLs neutralized
0

Markdown syntax and the HTML it makes

Each row was converted by this tool when the page was built.
SyntaxYou typeHTMLNotes
Heading## Title<h2>Title</h2>One to six # signs, or an underline of = (level 1) or - (level 2) below a line of text.
Emphasis*slanted* or _slanted_<p><em>slanted</em> or <em>slanted</em></p>Becomes <em>.
Strong emphasis**bold** or __bold__<p><strong>bold</strong> or <strong>bold</strong></p>Becomes <strong>.
Strikethrough (GFM)~~gone~~<p><del>gone</del></p>Becomes <del>. One or two tildes on each side.
Inline code`a < b`<p><code>a &lt; b</code></p>The text is escaped, never read as Markdown or HTML.
Link[text](https://example.com "Title")<p><a href="https://example.com" title="Title">text</a></p>The title is optional.
Reference link[text][id] ⏎ ⏎ [id]: https://example.com<p><a href="https://example.com">text</a></p>The definition can be anywhere in the document and produces no output.
Autolink<https://example.com><p><a href="https://example.com">https://example.com</a></p>Also <name@example.com>. A bare address without the angle brackets stays text.
Image![Alt text](/pic.png)<p><img src="/pic.png" alt="Alt text" /></p>Becomes <img> with the alt text.
Hard line breakline one\ ⏎ line two<p>line one<br /> line two</p>A backslash or two spaces at the end of a line. A plain line break stays a line break in the source.
Bulleted list- one ⏎ - two ⏎ - nested<ul> <li>one</li> <li>two <ul> <li>nested</li> </ul> </li> </ul>Use -, + or *. Indent nested items to line up with the text of the item above.
Numbered list3. three ⏎ 4. four<ol start="3"> <li>three</li> <li>four</li> </ol>The first number sets the start; the others are ignored.
Task list (GFM)- [x] done ⏎ - [ ] to do<ul> <li><input type="checkbox" checked="" disabled="" /> done</li> <li><input type="checkbox" disabled="" /> to do</li> </ul>A disabled check box at the start of the item.
Block quote> quoted<blockquote> <p>quoted</p> </blockquote>Can contain any other block, including more quotes and lists.
Fenced code block```js ⏎ let a = 1; ⏎ ```<pre><code class="language-js">let a = 1; </code></pre>The first word after the fence becomes the class language-js. Tildes work too.
Indented code blockfour spaces<pre><code>four spaces </code></pre>Four spaces or a tab, after a blank line.
Thematic break---<hr />Three or more -, * or _ on a line by themselves.
Table (GFM)| a | b | ⏎ |:--|--:| ⏎ | 1 | 2 |<table> <thead> <tr> <th align="left">a</th> <th align="right">b</th> </tr> </thead> <tbody> <tr> <td align="left">1</td> <td align="right">2</td> </tr> </tbody> </table>Colons in the second row align the column.

What is escaped or neutralized

Raw HTML is never passed through, and unsafe addresses are emptied. The result is what the tool outputs.
You typeHTMLWhat happens
<script>alert(1)</script><p>&lt;script&gt;alert(1)&lt;/script&gt;</p>Raw HTML is escaped and shown as text.
<img src=x onerror=alert(1)><p>&lt;img src=x onerror=alert(1)&gt;</p>Also inside a sentence: every < is escaped.
[click](javascript:alert(1))<p><a href="">click</a></p>A javascript: address is replaced by an empty one.
[click](<JaVa⇥ScRiPt:alert(1)>)<p><a href="">click</a></p>Case, tabs and hidden characters do not hide the scheme.
[click](&#106;avascript:alert(1))<p><a href="">click</a></p>Character references are decoded before the scheme is checked.
![x](data:text/html,hello)<p><img src="" alt="x" /></p>data: addresses other than raster images are blocked.
![x](data:image/svg+xml,hello)<p><img src="" alt="x" /></p>SVG can carry script, so it is blocked too.
![x](data:image/png;base64,iVBORw0KGgo=)<p><img src="data:image/png;base64,iVBORw0KGgo=" alt="x" /></p>A small PNG, GIF, JPEG, WebP, AVIF or BMP data: image is kept.
[ok](https://example.com/a b)<p>[ok](https://example.com/a b)</p>Not a link, because a plain address cannot contain a space.
[ok](https://example.com/a%20b)<p><a href="https://example.com/a%20b">ok</a></p>Ordinary addresses are kept, with unsafe characters percent-encoded.

How to convert Markdown to HTML

  1. Paste your Markdown. Replace the example with your own text. The HTML and the preview update as you type.
  2. Choose the options. Leave the GitHub extras on for tables, strikethrough and task lists, or turn them off for plain CommonMark. Turn on line breaks if every line break in a paragraph should become a <br />.
  3. Check the preview. The preview shows how the HTML will look. Images are not loaded there, so nothing contacts another website; the HTML source keeps the real image addresses.
  4. Copy or download the HTML. Copy the source to the clipboard or download it as an .html file. It is a fragment (no html, head or body tags), ready to paste into a page or a CMS.

Frequently asked questions

Which Markdown does this converter understand?
The CommonMark core as specified in version 0.31.2: ATX and setext headings, paragraphs, emphasis and strong emphasis, inline code, fenced and indented code blocks, block quotes, nested ordered and bulleted lists, inline and reference links and images, autolinks, hard line breaks and thematic breaks. On top of that come three GitHub Flavored Markdown extensions (0.29-gfm): tables, strikethrough and task lists. Footnotes, definition lists, math, heading anchors and bare-address autolinking are not part of it.
What happens to HTML tags I type into the Markdown?
They are escaped and shown as text: <b>bold</b> becomes &lt;b&gt;bold&lt;/b&gt; in the output, and the preview shows the tags literally. Most converters pass raw HTML through, which is how a pasted comment or a shared document can run script on a page. This one never does, so the HTML it makes is safe to publish. If you need real HTML in the result, write it in the page that receives the converted fragment.
Is it safe to paste Markdown from someone else?
Yes. Raw HTML is escaped, and the address of every link and image is checked: javascript:, vbscript: and data: addresses (other than PNG, GIF, JPEG, WebP, AVIF and BMP images) are replaced with an empty address, even when the scheme is written with capital letters, tabs, hidden characters or character references. The page tells you how many were neutralized. The preview is also built from a parsed copy that keeps only allow-listed tags and attributes.
Why are images missing from the preview?
To keep your visit private: loading an image from a web address would tell that site you opened this page. The preview shows a placeholder with the alt text instead, and the HTML source keeps the image address. Small data: images, which are part of the text itself, are shown.
How do I get a line break inside a paragraph?
In CommonMark a single line break inside a paragraph is a soft break, shown as a space by browsers. End the line with two spaces or a backslash for a hard break (<br />), or turn on the line breaks option to treat every line break that way.
Does it work on very large or deeply nested documents?
Yes. The parser reads each character a bounded number of times, so a document of 500,000 characters converts in well under a second, and input built to be slow (thousands of backticks, asterisks, brackets or quote marks) takes no longer than ordinary text. Longer text is cut at 500,000 characters, and quotes and lists nested more than 64 levels deep are read as plain text.
Why does my table not show up?
A table needs a header row, a delimiter row with the same number of cells (for example |---|---|), and the GitHub extras option on. Put a blank line before the table if the lines above it are part of a paragraph, and check that every row has pipes between the cells. Use the Markdown Table Generator to build one from a spreadsheet.
Can I use the HTML in WordPress or another CMS?
Yes. The output is an HTML fragment of standard elements (p, h1 to h6, ul, ol, li, blockquote, pre, code, a, img, em, strong, del, table), so it can be pasted into the HTML or code editor of most systems. Some editors strip the align attribute on table cells or the disabled check boxes of task lists; style the result with CSS if that matters.
Is my text uploaded or stored?
No. The conversion runs in your browser, nothing is sent anywhere, and the text is not saved: reload the page and it is gone. If you allow analytics, the site records only that a button was used, never any of your text.

How it works

The converter is a parser written for this page, not a library. Block structure is found line by line as the CommonMark specification describes (version 0.31.2): the open quotes and list items are matched against each new line, then new blocks may start. Inline text is read with the specification’s delimiter-stack method for emphasis and a bracket stack for links, so nesting such as *a **b** c* and [![alt](img)](url) resolves exactly as the specification says. Reference definitions are collected before links are resolved; labels match without regard to case or spacing. Quotes and lists nested more than 64 levels are read as text, code spans find their closing backticks through a table of backtick runs, and link brackets are deactivated in constant time, which keeps every input linear in its length. The tests compare the output with several hundred examples from the specification, grouped by section, and with generated inputs designed to be slow. Raw HTML is not recognized: every < that does not start an autolink is text, and all text is escaped on output (& < > "). URLs are decoded (backslash escapes and character references), then stripped of whitespace, control and invisible characters before the scheme is compared; javascript:, vbscript:, livescript:, blob:, filesystem: and data: addresses are replaced by an empty address, except PNG, GIF, JPEG, WebP, AVIF and BMP data: images. What remains is percent-encoded the way CommonMark renderers do. The GFM tables follow the GitHub specification: the header row and the delimiter row must have the same number of cells, a pipe inside a cell is written \|, and the table ends at the first blank line or the start of another block. The preview is rendered from the same syntax tree, parsed into an inert document, and copied into the page keeping only allow-listed tags and attributes. Named character references beyond a short built-in list (&amp; &lt; &copy; and similar) use the HTML entity table, which the page loads only when your text needs it.

Sources

More: Formatters and data convertersAll developer toolsAll toolsHome & DIY calculators