# Markdown HTML

> Convert Markdown to HTML, or HTML back to Markdown, with a live preview.

Free Markdown and HTML converter. GitHub-flavored Markdown in, HTML out, or the other way with Turndown. A sanitize switch strips scripts from the text output. The preview is always sanitized. Nothing is uploaded.

- Page: https://benchline.fabwaseem.com/t/markdown-html
- Runs: in the browser. Input stays on the device.
- Price: free, no account
- Input: Markdown or HTML, a direction, and a sanitize switch.
- Output: HTML or Markdown, plus a sanitized preview when the target is HTML.
- Keywords: markdown to html, html to markdown, gfm converter
- Updated: 2026-10-18
- Built by: Waseem Anjum (https://fabwaseem.com)

## How to use it

1. **Paste the source.** Markdown or HTML. Pick the direction.
2. **Choose sanitize.** On strips scripts from the text. The preview is always cleaned.
3. **Copy the result.** Copy the converted text, or read the HTML preview.

## Use it from an AI agent

MCP tool name: `convert_markdown_html`
MCP endpoint: https://benchline.fabwaseem.com/mcp (Streamable HTTP, no key)
HTTP: POST https://benchline.fabwaseem.com/api/v1/tools/markdown-html with the input as the JSON body
This call does not fetch anything. It runs on the arguments you send.

Convert GitHub-flavored Markdown to HTML, or HTML to Markdown. to is html or markdown. sanitize strips scripts from the text output. The conversion does not fetch a URL.

### Input schema

```json
{
  "type": "object",
  "properties": {
    "text": {
      "default": "# Hello\n",
      "type": "string"
    },
    "to": {
      "default": "html",
      "type": "string",
      "enum": [
        "html",
        "markdown"
      ]
    },
    "sanitize": {
      "default": true,
      "type": "boolean"
    }
  },
  "required": [
    "text",
    "to",
    "sanitize"
  ],
  "additionalProperties": false
}
```

### Example tools/call

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "convert_markdown_html",
    "arguments": {
      "text": "# Hello\n",
      "to": "html",
      "sanitize": true
    }
  }
}
```

Setup for Claude, Cursor, and VS Code: https://benchline.fabwaseem.com/mcp/guide

## Questions

### Which Markdown is supported?

GitHub-flavored Markdown: tables, strikethrough, task lists, and fenced code.

### What does sanitize do?

It strips scripts, event handlers, and javascript: links from the converted text. The preview is sanitized even when the switch is off.

### Is the text uploaded?

No. Both directions run in this browser.

### Can I start from a web page?

Use HTML to Markdown from a URL for a public page. This tool converts the text you paste.

## Related tools

- [Page to Markdown](https://benchline.fabwaseem.com/t/html-to-markdown-url): Fetch a public page and turn the article into Markdown.
- [JSON YAML converter](https://benchline.fabwaseem.com/t/json-yaml-convert): Convert JSON, YAML, TOML, and XML in the browser, and keep the line number when a document fails.
- [Diff checker](https://benchline.fabwaseem.com/t/diff-checker): Compare two texts side by side or inline, and download a unified patch.
- [CSV JSON converter](https://benchline.fabwaseem.com/t/csv-json-convert): Convert CSV to JSON and JSON back to CSV, with a delimiter and a header row you choose.
