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

    Input
    # Project
    
    | Feature | Status |
    |---|---|
    | Parser | done |
    
    - [x] Tests
    - [ ] Docs
    Output
    <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

    Input
    ```python
    print('hello')
    ```
    Output
    <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

    1. Paste Markdown and see the HTML

      Enter or paste your Markdown into the input pane; the sanitized HTML output updates live.

    2. Configure the output

      Toggle GFM, syntax highlighting, and raw HTML passthrough. The output refreshes immediately with each change.

    3. Preview the result

      The output pane shows the rendered HTML so you can confirm it looks right before copying.

    4. 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

    References & standards