webtrajans
en

Markdown to HTML

Write or paste Markdown and get clean HTML with a live preview — including GitHub-style tables, task lists and fenced code — or convert HTML back to Markdown.

The preview is sanitized with DOMPurify: scripts and event attributes (onerror etc.) never run.

This tool runs entirely in your browser; your data is never sent to a server.

How to use

  1. 1Choose Markdown → HTML or HTML → Markdown.
  2. 2Paste or type your text in the input box.
  3. 3Switch between the rendered preview and the HTML code.
  4. 4Copy the result or download it as document.html or document.md.

GitHub Flavored Markdown support

Conversion uses marked, a widely used open-source Markdown parser, with GitHub Flavored Markdown (GFM) enabled. Besides headings, emphasis, links, images, lists, blockquotes and code, that adds pipe tables, task lists (- [x] done, - [ ] open), ~~strikethrough~~, fenced code blocks with a language tag (```js) and automatic links for bare URLs. The output is plain semantic HTML without CSS classes, so it drops straight into a CMS, an email template or a static site.

Safe preview with DOMPurify

Markdown allows raw HTML, so a pasted document could contain a <script> tag or an onerror attribute. Before anything is shown or copied, the HTML is cleaned with DOMPurify, which removes scripts, event-handler attributes and javascript: links. That keeps the preview safe even for untrusted Markdown from issues, READMEs or user comments — but if you render user-written Markdown in your own app, sanitize it on your side as well.

HTML to Markdown

The reverse direction converts common HTML into Markdown: headings, paragraphs, bold, italic, strikethrough, inline code, links, images, line breaks, nested ordered and unordered lists, task-list checkboxes, blockquotes, horizontal rules, tables and <pre> code blocks with their language class. Scripts and styles are dropped, and wrappers such as div or section are unwrapped. Layout details with no Markdown equivalent — inline styles, merged table cells, colors — are simplified.

Frequently asked questions

How do I convert a Markdown file to HTML?

Open the .md file in any text editor, paste its contents here and copy the HTML, or download it as document.html.

Does it support GitHub tables and checkboxes?

Yes. GFM tables, task lists, strikethrough and fenced code blocks are all supported.

Is syntax highlighting included?

No. Code blocks are output as <pre><code class="language-js">, so you can add a highlighting library on your own site.

Is my text sent to a server?

No. The Markdown and sanitizer libraries are loaded into your browser, and all conversion happens locally.

Not happy with the results?

Talk to Webin Agency about fast, SEO-friendly websites, e-commerce and Google Ads management.

Get free advice

Related tools