Markdown to HTML Converter
Convert Markdown to clean HTML with GitHub tables, task lists, heading anchors, sanitising and a live preview.
This guide is not yet available in your language and is shown in English.
Tool guide
What this tool does
Markdown to HTML Converter turns CommonMark and GitHub Flavored Markdown into HTML as you type. Tables, task lists, strikethrough and bare links are supported, headings get GitHub-style id anchors, output is sanitised against scripts by default, and you can export a fragment or a complete, styled HTML document.
Markdown is the easiest way to write formatted text, but many destinations still need HTML: email templates, CMS fields that do not understand Markdown, static pages, help-centre articles and documentation exports. Copying from a rendered preview loses structure, and different renderers disagree on details such as tables, line breaks and heading IDs.
This converter uses marked, a fast parser that follows the CommonMark specification and GitHub Flavored Markdown extensions: pipe tables with column alignment, task list checkboxes, ~~strikethrough~~ and automatic links for bare URLs. Headings receive id attributes generated the way GitHub does, so links such as #installation keep working. Because Markdown allows raw HTML, the result is cleaned with DOMPurify by default, which removes script tags, event handler attributes and javascript: links. Conversion happens in your browser.
How to use Markdown to HTML Converter
- Type or paste Markdown into the input, open a .md file, or click Sample.
- Keep GitHub Flavored Markdown on for tables, task lists and strikethrough.
- Decide whether single line breaks should become <br> tags and whether headings get id anchors.
- Leave Sanitise HTML on unless you trust the source and need raw HTML such as embeds.
- Choose Output: an HTML fragment for pasting into a page, or a complete document with basic styles.
- Check the Preview, then copy the HTML or download document.html.
Tips for better results
- Turn on line breaks as <br> for text written in chat apps or forums, where a single Enter is meant as a new line.
- Heading anchors are de-duplicated with -1, -2 suffixes, matching GitHub, so a table of contents can link to repeated headings.
- Use the complete document option to produce a self-contained file you can open, print or attach directly.
- Language hints on fenced code blocks become class="language-x", which most syntax highlighters pick up automatically.
Common use cases
- Publishing README or changelog content on a website or in a CMS that only accepts HTML.
- Writing newsletter or email sections in Markdown and pasting the HTML into a template.
- Exporting notes as a standalone HTML page to share or print.
- Checking how GitHub-style Markdown will render before committing it.
Common mistakes to avoid
- Turning off sanitising for content written by other people, which can let a malicious script into your page.
- Forgetting the blank line before a list or table; without it, many lines are treated as part of the paragraph above.
- Indenting text by four spaces by accident, which turns it into a code block.
Frequently asked questions
Which Markdown flavour is supported?
CommonMark plus GitHub Flavored Markdown: tables, task lists, strikethrough and autolinked URLs. Footnotes and maths notation are not supported by this parser and are left as plain text.
Is raw HTML inside Markdown kept?
Yes, safe HTML such as <details> or <kbd> is kept. With sanitising on, scripts, inline event handlers, iframes and javascript: URLs are removed.
How are heading IDs created?
The heading text is lowercased, punctuation is removed and spaces become hyphens, so “What’s new?” becomes whats-new. Repeated headings get -1, -2 and so on.
Can I convert HTML back to Markdown?
Use the HTML to Markdown Converter, which turns headings, lists, links, code blocks and tables back into Markdown syntax.
Feedback & suggestions
Help us improve Markdown to HTML Converter. We read every message.