Markdown to HTML

Convert Markdown to clean HTML, with tables, task lists and code blocks, as a fragment or a full page. Converts Markdown to HTML. Standard Markdown (CommonMark) with tables, ~~strikethrough~~, task lists and fenced code blocks.

Input

The Markdown to convert.
Wrap the result in a complete web page with a small readable style sheet, ready to save as an .html file.
Title of the page when "document" is on. Defaults to the first heading.
Give every heading an id made from its text, so links such as #my-heading work.
Turn every single line break into a visible line break, as chat apps do.
Keep harmless HTML tags written in the Markdown, such as <sub>, <br> and <details>. Scripts, styles, frames and event handlers are always removed. When off, HTML is shown as text.

Result

Fill in the input and press Run.

Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.

Use it from code or an agent

curl -s https://setget.net/v1/tools/markdown-to-html \
  -H 'Content-Type: application/json' \
  -d '{"input":{"text":"# Hello\n\nThis is **bold** and this is a [link](https://example.com)."}}'
import json, urllib.request

body = {'input': {'text': '# Hello\n\nThis is **bold** and this is a [link](https://example.com).'}}
request = urllib.request.Request("https://setget.net/v1/tools/markdown-to-html", json.dumps(body).encode(),
                                 {"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/markdown-to-html", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({"input":{"text":"# Hello\n\nThis is **bold** and this is a [link](https://example.com)."}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
  "slug": "markdown-to-html",
  "input": {
    "text": "# Hello\n\nThis is **bold** and this is a [link](https://example.com)."
  }
}
{
  "input": {
    "text": "# Hello\n\nThis is **bold** and this is a [link](https://example.com)."
  }
}

Endpoint: POST /v1/tools/markdown-to-html. Over MCP: run_tool with slug: "markdown-to-html". Machine-readable: input schema, Markdown. Connect an agent.

Inputs

NameTypeRequiredWhat it does
text string yes The Markdown to convert.
document boolean no Wrap the result in a complete web page with a small readable style sheet, ready to save as an .html file. Default: false.
title string no Title of the page when "document" is on. Defaults to the first heading. Default: "".
heading_ids boolean no Give every heading an id made from its text, so links such as #my-heading work. Default: false.
line_breaks boolean no Turn every single line break into a visible line break, as chat apps do. Default: false.
allow_html boolean no Keep harmless HTML tags written in the Markdown, such as <sub>, <br> and <details>. Scripts, styles, frames and event handlers are always removed. When off, HTML is shown as text. Default: false.

Examples

A heading and a paragraph

Input
{
  "text": "# Hello\n\nThis is **bold** and this is a [link](https://example.com)."
}
Result
{
  "html": "<h1>Hello</h1>\n<p>This is <strong>bold</strong> and this is a <a href=\"https://example.com\">link</a>.</p>\n",
  "characters": 106,
  "headings": 1
}

A task list, a table and heading ids

Input
{
  "text": "## To do\n\n- [x] Write\n- [ ] Review\n\n| Item | Price |\n|------|------:|\n| Tea | 3.50 |",
  "heading_ids": true
}
Result
{
  "html": "<h2 id=\"to-do\">To do</h2>\n<ul>\n<li class=\"task\"><input type=\"checkbox\" disabled checked /> Write</li>\n<li class=\"task\"><input type=\"checkbox\" disabled /> Review</li>\n</ul>\n<table>\n<thead>\n<tr>\n<th>Item</th>\n<th style=\"text-align:right\">Price</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Tea</td>\n<td style=\"text-align:right\">3.50</td>\n</tr>\n</tbody>\n</table>\n",
  "characters": 351,
  "headings": 1
}

HTML in the text is shown, not run

Input
{
  "text": "Hello <b>there</b> <script>alert(1)</script>"
}
Result
{
  "html": "<p>Hello &lt;b&gt;there&lt;/b&gt; &lt;script&gt;alert(1)&lt;/script&gt;</p>\n",
  "characters": 76,
  "headings": 0
}

Questions

Which Markdown is supported?
Standard Markdown (CommonMark) with tables, ~~strikethrough~~, task lists and fenced code blocks. Footnotes, definition lists and maths are not supported.
Is the HTML safe to put on my site?
Yes. HTML written in the Markdown is shown as text, and links that would run script are not made into links. With "allow_html" on, only a fixed list of harmless tags and attributes is kept; scripts, styles, frames, forms and event handlers are removed.
What does "document" add?
A complete page: doctype, character set, title and a small style sheet. Without it you get only the converted content, to place inside your own page.
Are code blocks coloured?
No. A code block marked with a language gets a class such as language-python, which colouring scripts such as highlight.js and Prism pick up. markdown-to-pdf does colour code.
Does it load the pictures?
No. Pictures become <img> tags that point at the address you wrote. Nothing is fetched.

Conversions this tool does