
Markdown to HTML Converter API
Convert Markdown to HTML instantly with full control over formatting options. Support for tables, task lists, strikethrough, emojis, and more.
All API requests require a valid API key passed in the Authorization header as a Bearer token.
120 requests per minute
1 endpoint available
Overview
Converts Markdown to HTML with the Showdown library, using the same defaults as the web tool. Send the Markdown and, optionally, a set of converter options.
Security note
The HTML is not sanitized. Raw HTML inside the Markdown, including script tags and event attributes, is passed through unchanged, which is how the web tool behaves too. If you show the result to other people, sanitize it first with a library such as DOMPurify or sanitize-html.
Options
All options are optional booleans unless noted. Defaults match the web tool: ghCodeBlocks,
encodeEmails and ellipsis are on, everything else is off.
- simplifiedAutoLink, excludeTrailingPunctuationFromUrls - turn bare URLs into links
- strikethrough, underline -
~~text~~and__text__ - tables, tasklists - GitHub-style tables and
- [ ]lists - ghCodeBlocks, omitExtraWLInCodeBlocks - fenced code blocks and their spacing
- simpleLineBreaks - a single newline becomes a br tag
- requireSpaceBeforeHeadingText, disableForced4SpacesIndentedSublists, splitAdjacentBlockquotes, backslashEscapesHTMLTags - stricter parsing rules
- ghMentions and ghMentionsLink (string, 200 characters max, default
https://github.com/{u}) - link @username mentions - encodeEmails, openLinksInNewWindow, emoji, ellipsis
- completeHTMLDocument - wrap the output in html, head and body tags
- metadata - treat a leading metadata block as metadata instead of content
Limits
- Markdown up to 200,000 characters.
- Unknown option names are rejected with a 400.
Endpoints
https://opentools.ca/api/v1/tools/markdown-to-htmlRequest Body
Content-Type: application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
| markdown | string | Required | Markdown to convert, 1 to 200,000 characters. |
| options | object | Optional | Converter options as an object of names to values, for example { "tables": true }. Omitted options keep the defaults described above. |
Response Example
{
"success": true,
"html": "<h1 id=\"hello\">Hello</h1>\n<p>This is <strong>bold</strong> and <del>struck</del>.</p>",
"length": 85
}Error Codes
Code Examples
curl -X POST https://opentools.ca/api/v1/tools/markdown-to-html -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{
"markdown": "# Hello
This is **bold** and ~~struck~~.",
"options": { "strikethrough": true }
}'Rather use it in your browser? Open the Markdown to HTML Converter