Skip to main content
Tools Star Hub

Developer Tools

How to Convert Markdown to HTML (and What Gets Converted)

By Tools Star Hub Editorial Team · Published

Quick answer: open Markdown to HTML, paste up to 400,000 characters of Markdown, and press Convert. You get HTML source code for headings, paragraphs, lists, blockquotes, tables, code blocks, links, images, bold and italic text. Copy it with Copy HTML or download converted.html. Raw HTML in your Markdown is escaped rather than passed through, and only safe link types become real links.

Markdown is quick to write, but websites, emails and many CMS fields need HTML. Converting by hand is slow and easy to get wrong, especially for tables and code. A converter that produces predictable, safe HTML lets you write in Markdown and paste the result wherever HTML is expected.

Which Markdown syntax is supported?

The converter handles the core Markdown most people use day to day.

Markdown to HTML mapping
MarkdownHTML
Lines starting with # to ######h1 to h6
Blank-line separated textp, with single line breaks as br
Lines starting with -, * or +ul with li
1. itemol with li
> quoteblockquote
``` fencespre and code
`code`inline code
**bold** or __bold__strong
*italic* or _italic_em
[text](url)a href
![alt](src)img
---, *** or ___hr
Pipe tablestable, thead, tbody

A single newline inside a paragraph becomes a line break, which matches how many people expect notes to look, though it differs from some Markdown tools that join such lines.

How to Convert Markdown to HTML: Syntax & Safe Links — Tools Star Hub

What is not supported?

Nested lists are not supported, so indented sub-items are not turned into lists inside lists. Strikethrough with ~~ is not converted. Table column alignment colons are accepted in the divider row but ignored, so every column uses default alignment. Link and image titles in quotes are ignored. Footnotes, task lists and definition lists are not handled.

Knowing this up front saves surprises: if your document relies on nested lists, flatten them or add the extra HTML afterwards.

How are code blocks converted?

Text between triple-backtick fences becomes a pre element containing a code element. If you add a language after the opening fence, such as ```js, the code element gets class="language-js", which is the convention syntax highlighters like Prism and highlight.js look for. The code inside is escaped, so characters like < and & display correctly instead of being read as HTML.

How do I write a table that converts?

Write a header row with cells separated by pipes, then a divider row made of dashes, then the data rows. The divider row is required; without it the lines are treated as an ordinary paragraph. The first row becomes the table header and the rest go into the body.

For safety, only some link targets are allowed: web addresses starting with http:// or https://, mailto: links, site paths starting with /, and page anchors starting with #. Anything else is shown as plain text instead of a link.

That means javascript:, data: and vbscript: links, which can be used to run code, are never turned into links. Protocol-relative addresses starting with // and relative paths like page.html are also shown as text, so write them as full URLs or site paths if you want them clickable.

What happens to HTML inside my Markdown?

Raw HTML is escaped, not passed through. If your Markdown contains a div or a script tag, the output shows it as visible text. This keeps the result safe to paste into a page even if the Markdown came from someone else, but it means you cannot mix custom HTML into the source. Add those pieces after converting.

Is the result shown as a preview?

No. The output is HTML source text in a box, not a rendered page. The tool never runs the HTML on the page. Paste it into your site, email builder or CMS HTML view to see how it looks. If you need it smaller for production, run it through the HTML Minifier.

When is this useful?

Common uses include turning a README section into a web page, preparing a blog post written in a Markdown editor for a CMS that only accepts HTML, building simple HTML emails, and converting documentation snippets for a help centre. The Example button loads a sample covering most features, which is a quick way to check how a construct converts.

Is my Markdown sent anywhere?

No. Conversion happens in your browser, so drafts and internal documentation are not uploaded.

How does the converter decide where paragraphs start?

A blank line ends one block and starts the next. Lines that begin with a heading marker, a list marker, a quote marker, a fence or a horizontal rule start their own block. Everything else is gathered into a paragraph, with each line break inside it turned into a br element.

If two paragraphs merge into one, check that there is a truly empty line between them. A line containing only spaces counts as empty, but a line with a stray character does not.

How do I combine bold, italic and code?

Wrap text in two asterisks or two underscores for bold, and one asterisk or one underscore for italic. Inline code uses single backticks, and anything inside backticks is shown literally, so asterisks inside code are not turned into emphasis. That makes backticks the easiest way to show symbols like * or _ in a sentence.

Links and images can sit inside paragraphs, list items, quotes and table cells. Images are written with an exclamation mark before the brackets, and the text in the square brackets becomes the alt text, which screen readers announce, so describe the image rather than leaving it empty.

How do I paste the result into a CMS?

Most content management systems have a separate HTML or code view. Switch to that view before pasting, otherwise the editor may show the tags as text. In WordPress, use a Custom HTML block or the code editor. In email builders, look for an HTML block or source mode.

Because the output contains only content elements without wrapping html, head or body tags, it slots into an existing page or template. Your site's stylesheet controls how the headings, tables and code look.

Can I convert the HTML back to Markdown later?

Yes. HTML to Markdown turns the common elements back into Markdown syntax. A round trip will not always be identical, because both tools normalise things: for example, every ordered list item comes back as 1., and the line-break style may change. Keep your original Markdown as the source you edit.

How do I show Markdown symbols literally?

Put them inside backticks as inline code, or inside a fenced code block for several lines. Text in code is escaped and never treated as formatting, so a line such as # not a heading inside a fence stays exactly as typed in the HTML output.

How to convert Markdown to HTML

  1. Paste Markdown. Add up to 400,000 characters, or press Example to load a sample.
  2. Convert. Press Convert to generate the HTML source.
  3. Check the output. Look for any links shown as text or features that are not supported.
  4. Copy or download. Use Copy HTML or download converted.html. Clear empties both boxes.

Example

A heading and list

“## Steps” followed by three “- ” lines becomes an h2 and a ul with three li elements.

A code fence with a language

A block opened with ```python becomes <pre><code class="language-python">, with any < characters escaped.

A blocked link

[Click](javascript:alert(1)) is shown as plain text, while [Docs](https://example.com/docs) becomes a normal link.

Tips and limitations

Flat lists only

Indented sub-items are not nested.

No raw HTML

Embedded HTML is escaped and shown as text.

Safe links

Only http(s), mailto, / and # targets become links.

Source output

You get HTML code, not a live preview.

FAQ

Does the converter support nested lists?
No. Indented sub-items are not turned into nested lists. Flatten them or add the nesting by hand afterwards.
Why is my link shown as plain text?
Only links starting with http://, https://, mailto:, / or # are allowed. Relative paths, // addresses and javascript: or data: links stay as text.
Can I include HTML tags in my Markdown?
They are escaped, so they appear as visible text rather than working as HTML.
Does it add a language class to code blocks?
Yes. ```js becomes class="language-js" on the code element.
Why didn't my table convert?
A pipe table needs a divider row of dashes under the header. Without it the lines are treated as a paragraph.
Are table alignment colons used?
No. They are accepted in the divider row but ignored.
Is strikethrough supported?
No. Text wrapped in ~~ is left as typed.
Does a single line break become a br?
Yes. Within a paragraph each newline becomes <br />.
Does the output include html and body tags?
No. You get the converted content only, ready to paste into an existing page.
Can I see what the HTML looks like?
The tool shows source code, not a preview. Paste it into a page or CMS to view it.
Do footnotes convert in this Markdown flavor?
Support varies; if footnotes stay plain text, use a flavor that documents footnote syntax.
How are images turned into HTML?
Standard ![alt](url) becomes an img tag; ensure URLs are reachable where you publish.
Can I keep class names on paragraphs?
Basic conversion rarely adds custom classes; wrap output in your own CSS later.
Why did my autolink stay unclickable?
Some parsers need explicit [text](url) markdown; bare URLs may remain plain.
Does YAML front matter get converted?
Strip front matter before converting if you only want the article body as HTML.
How do I preview responsive tables?
Paste the HTML into a page with your stylesheet; raw tags alone do not include layout CSS.
Do GitHub-style task lists become input checkboxes?
Only if the Markdown engine implements them; otherwise they appear as plain list text.
Can I convert Markdown that embeds KaTeX?
Math usually needs a separate renderer; this step focuses on standard Markdown to HTML.
Should I sanitize HTML before displaying user input?
Yes—treat converted HTML as untrusted if authors can inject raw tags.
Does conversion change smart quotes?
Text is preserved as written; typographic quotes remain characters in the HTML output.

Convert your text with the free Markdown to HTML tool.

Going the other way? Use HTML to Markdown.

Shrink the output with the HTML Minifier.

Sources and further reading