Skip to content
toolwise

Markdown to HTML

Convert Markdown to clean HTML with a live preview.

The HTML is sanitized: scripts, event handlers and other unsafe code are removed, so it is safe to paste into a website.

When to use it

Use this tool to turn Markdown into HTML you can paste into a website, blog, email template or content management system. It is also a handy live preview for README files, notes and documentation, so you can check your formatting before publishing.

How to use it

  1. Write or paste Markdown into Your text, or click Example to load a sample.
  2. Choose Show preview to see the formatted result, or Show HTML code to see the HTML.
  3. Tick Line breaks become <br> if each line should stay on its own line.
  4. Click Copy HTML or Download .html.

The note under the result shows how many headings there are and the size of the HTML.

Worked example

The example is a set of trip notes. It has a heading, a sentence with bold, italic and a link, a packing list with a ticked task, a table of days and cities, a code block and a script tag.

In the HTML code, the heading becomes <h1>Trip notes</h1>, the list becomes <ul> with <li> items, the ticked task becomes a disabled checkbox, and the table becomes a proper <table> with a header row. The code block is wrapped in <pre><code class="language-js">.

The script tag at the end is removed completely, because it could run harmful code on a website.

Markdown quick reference

  • # Heading for a heading, ## for a smaller one.
  • **bold** and *italic*.
  • [text](https://example.com) for a link.
  • - item for a bullet list, 1. item for a numbered list.
  • - [x] done for a ticked task.
  • Three backticks before and after lines of code.

Why write in Markdown?

Markdown is quicker to type than HTML and easy to read even before it is converted. Many writers draft in Markdown, keep it as the master copy, and convert it to HTML only when they publish. If the page needs changing later, they edit the Markdown and convert again.

Tips

  • Leave a blank line between blocks. Paragraphs, lists and headings need an empty line between them.
  • Use the preview to catch mistakes. A missing space after # or a stray asterisk shows up straight away.
  • Paste the HTML into code view. In a website editor, switch to HTML or code view before pasting.

Common mistakes

  • Forgetting the space after #. #Heading stays as text. Write # Heading.
  • Indenting lines by accident. Four spaces at the start of a line can turn text into a code block.
  • Expecting raw HTML to pass through. Unsafe tags like script are removed for safety.

Frequently asked questions

Which Markdown features are supported?

GitHub-flavored Markdown, including headings, bold and italic, links, images, lists, task lists, tables, block quotes, code blocks and horizontal rules.

Is the HTML safe to use on a website?

Yes. The output is sanitized, so scripts, event handlers and other unsafe code are removed. That makes it safe to paste Markdown from other people into your site.

What does Line breaks become br do?

In standard Markdown, a single line break inside a paragraph is ignored and the lines join. Tick this option to keep each line break, which suits poems, addresses and chat-style text.

Does the HTML include styles?

No. You get clean HTML tags without CSS, so it takes on the look of the website or app where you paste it.

Is my text uploaded?

No. The conversion happens in your browser.