Markdown to HTML Converter
Convert Markdown to clean, semantic HTML with GFM, highlighting, and optional sanitization
Input & Settings
Strips scripts & dangerous tags
Sanitize recommended if on
HTML Output
Converted HTML will appear here
Analysis & Stats
Conversion statistics will appear here
• GFM: Enabled
• Sanitize: On (XSS-safe)
• Highlighting: On
• Raw HTML: Escaped
About this tool
This tool converts Markdown text into clean, semantic HTML. It supports GitHub-Flavored Markdown (tables, task lists, strikethrough, autolinks), optional syntax highlighting for fenced code blocks, optional raw-HTML pass-through, and an XSS-safe sanitization mode. Use it to generate HTML for blog posts, documentation, email templates, or static-site generators. All parsing happens locally in your browser — nothing is uploaded.
Examples & Use Cases
Basic Markdown to HTML
<!-- Markdown Input -->
# Hello World
This is a **bold** and *italic* paragraph.
- Item 1
- Item 2
<!-- HTML Output -->
<h1>Hello World</h1>
<p>This is a <strong>bold</strong> and <em>italic</em> paragraph.</p>
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>Headings, emphasis, and lists convert to their semantic HTML equivalents.
GitHub-Flavored Markdown (tables, task lists)
<!-- Markdown Input -->
| Name | Age |
| ---- | --- |
| John | 30 |
- [x] Done
- [ ] Todo
<!-- HTML Output -->
<table>
<thead><tr><th>Name</th><th>Age</th></tr></thead>
<tbody><tr><td>John</td><td>30</td></tr></tbody>
</table>
<ul>
<li><input disabled type="checkbox" checked>Done</li>
<li><input disabled type="checkbox">Todo</li>
</ul>Enable GFM to render tables and task-list checkboxes. The GFM plugin is on by default.
Code Block with Syntax Highlighting
<!-- Markdown Input -->
```js
const sum = (a, b) => a + b;
```
<!-- HTML Output (highlighted) -->
<pre><code class="hljs language-js">...</code></pre>Fenced code blocks get syntax-highlight classes when highlighting is enabled — pair with a highlight.js CSS theme.
Examples
Convert GFM with a table and task list
# Project
| Feature | Status |
|---|---|
| Parser | done |
- [x] Tests
- [ ] Docs<h1>Project</h1>
<table>
<thead><tr><th>Feature</th><th>Status</th></tr></thead>
<tbody>
<tr><td>Parser</td><td>done</td></tr>
</tbody>
</table>
<ul>
<li><input type="checkbox" disabled="" checked=""> Tests</li>
<li><input type="checkbox" disabled=""> Docs</li>
</ul>With GFM enabled, the Markdown table becomes an HTML table and the task list items render as checkboxes — checked or unchecked based on the [x] or [ ] marker.
Syntax-highlighted fenced code block
```python
print('hello')
```<pre><code class="language-python">print('hello')
</code></pre>With syntax highlighting enabled, the code block is highlighted server-side via a Shiki-compatible highlighter that runs in the browser, producing spans with colour classes for each token type.
About this tool
Markdown to HTML Converter renders your Markdown as clean, sanitized HTML entirely in the browser. It uses react-markdown to parse the Markdown into a React element tree, renders it with renderToStaticMarkup, and then sanitizes the output with rehype-sanitize to strip XSS risk before delivering it to you.
Three conversion options let you tailor the output: GFM (GitHub Flavored Markdown — tables, strikethrough, task lists, autolinks), syntax highlighting for fenced code blocks, and raw HTML passthrough. When passthrough is off, any inline HTML in the Markdown source is escaped so it appears as literal text.
Everything runs locally — parsing, rendering and sanitization all happen in your browser. No Markdown is sent to any server.
How to use
Paste Markdown and see the HTML
Enter or paste your Markdown into the input pane; the sanitized HTML output updates live.
Configure the output
Toggle GFM, syntax highlighting, and raw HTML passthrough. The output refreshes immediately with each change.
Preview the result
The output pane shows the rendered HTML so you can confirm it looks right before copying.
Copy the HTML
Click Copy HTML to put the sanitized HTML on your clipboard.
Use cases
Rendering blog posts from Markdown files
Convert Markdown content stored in your CMS or static-site generator into sanitized HTML ready to inject into the page without a full rendering pipeline.
Email HTML from Markdown
Many email clients strip <style> blocks, so inline HTML generated from Markdown is more reliable than rich-text editors for cross-client email.
Previewing docs before publishing
Paste a docs fragment and see the exact HTML output, including any XSS that rehype-sanitize will strip.
Common mistakes
Mistake:Leaving raw HTML passthrough on when the Markdown source is untrusted.
Fix:Even with sanitization, passthrough lets raw HTML through the initial parse. Enable it only when you control the source and want to preserve custom HTML elements; otherwise leave it off and escape.
Mistake:Expecting CSS classes from the source Markdown to survive sanitization.
Fix:rehype-sanitize removes all class attributes and inline styles by default, keeping only safe semantic HTML. If you need specific styling, apply it externally.
Frequently asked questions
Related guides
References & standards
Related tools
Driver's License Generator
Generate driver's license numbers in the correct format for 21 countries and all 50 US states, plus a format and Luhn validator — test data only, runs in your browser.
Address Generator
Generate realistic addresses in the correct format for 21 countries — single-line, multi-line, JSON or HTML — plus a postcode validator. Test data only, runs in your browser.
Phone Number Generator
Generate phone numbers in the correct format per country — mobile, landline and toll-free — in international, national, raw or tel: format, plus a validator. Test data only.
XML to JSON Converter
Convert XML data to JSON format with attribute handling, configurable parsing options, and live statistics
Docker Run to Compose Converter
Convert a docker run command into a docker-compose.yml service definition with full flag support
GitHub Actions YAML Generator
Generate GitHub Actions workflow YAML with triggers, jobs, and steps through a visual form