Convert Markdown to clean HTML using the CommonMark standard. Live preview and HTML source shown side by side — copy the output instantly.
CommonMark Markdown with GFM tables and strikethrough
Preview
This is bold and italic text.
A blockquote example.
console.log("Hello!");
Markdown, created by John Gruber and Aaron Swartz in 2004, is a lightweight plain-text markup language designed to be readable and easy to write. It has become the standard authoring syntax for GitHub documentation, developer wikis, static site generators (Next.js, Hugo, Jekyll), and content management systems.
While standard CommonMark defines fundamental document structures, modern web platforms rely on GitHub Flavored Markdown (GFM) to support tables, task lists, strikethrough, and autolinks.
| Markdown Syntax | Semantic HTML Output | Rendered Visual Result |
|---|---|---|
# Heading 1 | <h1>Heading 1</h1> | Primary document title |
**Bold text** | <strong>Bold text</strong> | Bold text |
*Italic text* | <em>Italic text</em> | Italic text |
[Link](https://example.com) | <a href="https://example.com">Link</a> | Hyperlink |
| ` | Col 1 | Col 2 |
- [x] Completed task | <input type="checkbox" checked disabled /> | Interactive task checkbox |
```javascript | <pre><code class="language-javascript"> | Syntax-highlighted code |
Because Markdown allows raw HTML injection by default, converting untrusted user-supplied Markdown directly to HTML creates severe Cross-Site Scripting (XSS) vulnerabilities. Always sanitize the parsed HTML using a sanitization library like DOMPurify or sanitize-html:
import DOMPurify from 'dompurify';
import { marked } from 'marked';
// Convert and safely sanitize
const rawMarkdown = "## Title\n<script>alert('xss')</script>";
const dirtyHtml = marked.parse(rawMarkdown);
const cleanHtml = DOMPurify.sanitize(dirtyHtml);
JavaScript (marked)
import { marked } from 'marked';
const markdownSource = `
# Project Overview
This project simplifies **data conversion** across platforms.
- Fast processing
- Client-side execution
`;
const htmlOutput = marked.parse(markdownSource, { gfm: true, breaks: true });
console.log(htmlOutput);
Python (markdown library)
import markdown
text = "# Hello World\n\nConvert *Markdown* to **HTML** easily."
html = markdown.markdown(text, extensions=['tables', 'fenced_code'])
print(html)
<p> paragraph tags (loose lists), adding vertical spacing. Removing blank lines produces compact, tight lists.<br>, end the line with two trailing spaces or configure hard breaks.This website and utility are provided for general informational, calculation, and educational purposes only. Always verify critical computation outputs prior to professional deployment or financial use. See our Terms of Service and Privacy Policy for full governance details.