Skip to content
POST AI agent ready /v1/markdown/to-html

Markdown to HTML API - Free Converter

Parses Markdown (including GitHub Flavored Markdown) and returns HTML. Output is sanitized by default to strip script tags and event handlers, making it safe to render in a browser.

Parameters

stringrequired

The Markdown content to convert.

boolean

Sanitize the output HTML to remove script tags and unsafe attributes.

Code examples

curl -X POST https://api.botoi.com/v1/markdown/to-html \
  -H "Content-Type: application/json" \
  -d '{"markdown":"# Hello\n\nThis is **bold** text.","sanitize":true}'

When to use this API

Render user-submitted Markdown in a CMS

Convert blog posts or documentation written in Markdown to HTML for display on your website, with sanitization enabled to prevent XSS.

Generate email HTML from Markdown templates

Write transactional email content in Markdown and convert it to HTML before sending through your email provider.

Preview README files in a Git dashboard

Fetch README.md from a repository and convert it to HTML for rendering in a custom project dashboard.

Frequently asked questions

Which Markdown flavor is supported?
The API supports GitHub Flavored Markdown (GFM), including tables, task lists, strikethrough, and fenced code blocks.
What does the sanitize option remove?
It strips script tags, event handler attributes (onclick, onerror), and iframe elements. Safe tags like headings, paragraphs, links, and images are preserved.
Can I disable sanitization for trusted content?
Yes. Set sanitize to false if you control the input and need raw HTML output, such as embedded iframes or custom widgets.
Does the API add syntax highlighting to code blocks?
The API wraps fenced code blocks in <pre><code> tags with a language class. You handle syntax highlighting on the client with a library like Prism or Highlight.js.

Get your API key

Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.