Text · Converter

Markdown to HTML converter.

Type or paste Markdown and watch the rendered page and the HTML source update as you go. CommonMark 0.31.2 with optional GitHub-style tables, task lists and strikethrough. Output is sanitised: raw HTML is escaped and unsafe links are refused. Runs in your browser; nothing is sent anywhere.

Advertisement

Input

Untick the first box for strict CommonMark. Both other options are off in CommonMark.

Result

Type Markdown to see the preview.

Advertisement

What this converts

The converter is markdown-it 15.0.2 (MIT licence, bundled with this site, no network call) in its commonmark preset, which implements the CommonMark 0.31.2 specification. With the GitHub option ticked it also enables pipe tables and ~~strikethrough~~ from GitHub Flavored Markdown, and a small rule that turns - [ ] and - [x] list items into disabled checkboxes. All specification pages and the library repository were read on 1 October 2026.

How the output is sanitised

Worked example

Press Load example. The input is a heading, a two-item task list, a two-column table with a centred second column, a line with ~~old~~ **new** and a link, and two deliberately unsafe pieces: a <script> tag and a javascript: link. The output is an <h1>, a <ul> of two checkbox items (one checked), a <table> whose second column carries style="text-align:center", a paragraph with <s>old</s> <strong>new</strong> and a working link, and the script tag and the bad link as escaped, harmless text. Untick the GitHub option and the same input shows the strict CommonMark result: the table and strikethrough become plain text and the checkboxes become literal [x].

Where converters differ

Markdown has one specification but many renderers. Differences you may see elsewhere: the original Markdown.pl and some CMS plugins treat a single newline differently (tick the line-break option to match GitHub comments); GitHub adds autolinks, footnotes, alerts and emoji shortcodes that are not part of this page; and renderers that allow raw HTML will output tags this page escapes. If your Markdown relies on raw HTML, this page is not the right tool: it would need a separate, trusted sanitiser that you control.

Sources: CommonMark 0.31.2 (spec.commonmark.org); GitHub Flavored Markdown spec (github.github.com/gfm); markdown-it (github.com/markdown-it/markdown-it), all as of 1 October 2026.

Markdown syntax and the HTML it produces

Markdown was created by John Gruber and released in 2004 with readability as its design goal: a document should be publishable as plain text without looking like it is full of tags. Because his original description left some cases unclear, the CommonMark project wrote a precise specification, and that is the standard this converter follows. The table below shows the most-used syntax and the exact HTML the converter returns for it in its default CommonMark mode.

Markdown to HTML, CommonMark mode
You typeYou get
# Title<h1>Title</h1>
**bold** and *em*<strong>bold</strong> and <em>em</em>
[link](https://example.com)<a href="https://example.com">link</a>
- a and - b on separate lines<ul><li>a</li><li>b</li></ul>
1. one and 2. two<ol><li>one</li><li>two</li></ol>
A fenced block opened with ```js<pre><code class="language-js"> followed by the code
<b>raw</b>Escaped text, shown literally: &lt;b&gt;raw&lt;/b&gt;

Line breaks and paragraphs

A paragraph is one or more lines separated from the next paragraph by a blank line. A single newline inside a paragraph is kept as a newline in the HTML source, but a browser shows it as a space, so two consecutive lines of text appear on one line. To force a visible break you can end a line with a backslash or two spaces, or tick the line-break option to render every newline as a break, which is how GitHub comments behave. In the original Markdown description, ending a line with two or more spaces creates a <br />; that rule is invisible in an editor, which is why many writers prefer the backslash.

Worked example: README snippet to HTML

Paste a short README: a title line, a sentence with one bold word, a bullet list of two features and a fenced code block. The preview shows the rendered page, and the HTML pane contains one <h1>, one <p> with a <strong> inside it, a <ul> with two <li> items and a <pre><code> block. Press Copy HTML to take the fragment, ready for a template, or download the file for a minimal standalone page. The conversion does not add classes, ids or styles beyond the language- class on fenced code, so your own CSS decides how it looks.

CommonMark vs GitHub Flavored Markdown

GitHub Flavored Markdown (GFM) is defined as a strict superset of CommonMark: everything CommonMark does, GFM does the same way, plus extensions. The GFM specification lists tables, task list items, strikethrough, extended autolinks and a rule that disallows some raw HTML tags. This converter offers the three that people notice most behind one checkbox: tables, ~~strikethrough~~ and task lists. If your Markdown will be shown on GitHub, GitLab or a documentation generator, tick it. If it will go through a strict CommonMark renderer, leave it off so you see what that renderer will show. Other platforms add their own extras, such as footnotes, emoji codes or admonition blocks. Those are not part of either specification and are not converted here.

Why raw HTML is escaped here

CommonMark allows raw HTML inside Markdown, and passes it through to the output. That is convenient for authors but means the output can carry anything the author typed, including scripts and event-handler attributes. This page turns the raw HTML option off, so tags are shown as visible text. OWASP's cross-site scripting guidance explains why the rule matters: untrusted data placed into an HTML page should be HTML-entity encoded, and links built from untrusted input should be limited to http and https and avoid the JavaScript protocol. This converter escapes tags and refuses unsafe link schemes to follow that principle, but a safe preview is not the same as a security review. If you publish converted HTML on a site with logins or user data, pass it through your own sanitiser and a content security policy as well.

Troubleshooting common problems

What this tool does not do

It does not fetch remote content, validate links, check images, build a table of contents, or convert HTML back into Markdown. It also does not render math or diagrams. It is a single-document converter for text you paste, with no account and no upload. For counting words in the result, use the word count checker; to encode special characters for HTML separately, use the HTML entity encoder.

Advertisement

Frequently asked questions

Why did my HTML tags show up as text?

On purpose. Raw HTML is escaped so a pasted document cannot run script in the preview or in the HTML you copy. Use Markdown syntax for formatting instead.

Is my text uploaded?

No. Conversion runs in your browser with a bundled library, and nothing is stored or sent.

Do tables work in plain CommonMark?

No. Tables, strikethrough and task lists are GitHub Flavored Markdown extensions, which is why they sit behind a checkbox.

Is the downloaded file a full web page?

It is a minimal HTML document wrapping the converted fragment, with a UTF-8 charset and no styles. Copy HTML gives just the fragment.

How do I preview Markdown as I type?

Type or paste into the input box and the preview and the HTML output update as you type. Use Load example to see a heading, a task list, a table, strikethrough and two deliberately unsafe pieces rendered side by side.

What is the difference between Markdown and CommonMark?

Markdown is the original syntax by John Gruber, whose description left some cases ambiguous. CommonMark is a precise specification of that syntax, with test cases, so different renderers produce the same HTML. This converter follows CommonMark version 0.31.2.

How do I add a line break in Markdown?

End the line with a backslash or two spaces, or tick the line-break option to treat every newline as a break. A single newline alone is kept in the HTML source but shown by the browser as a space.

Is the converted HTML safe to publish?

It is built to be safe to display: raw HTML is escaped and javascript: links are refused. It is not a security guarantee. If the HTML will appear on a site with accounts or user data, run it through your own sanitiser and content security policy as well.

Sanitised, not certified

The output is built to be safe to display, but this page does not guarantee the Markdown, its links or the destination system are safe. Nothing you type is stored or sent anywhere.