Markdown to HTML Converter

Markdown to HTML Converter API

Content

Convert Markdown to HTML instantly with full control over formatting options. Support for tables, task lists, strikethrough, emojis, and more.

Authentication

All API requests require a valid API key passed in the Authorization header as a Bearer token.

Rate Limit

120 requests per minute

Endpoints

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

POST
https://opentools.ca/api/v1/tools/markdown-to-html
Convert Markdown to HTML

Request Body

Content-Type: application/json

ParameterTypeRequiredDescription
markdown
string
Required
Markdown to convert, 1 to 200,000 characters.
options
object
OptionalConverter 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

400
Bad Request - Missing or too long markdown, or an unknown or invalid option
401
Unauthorized - Invalid or missing API key
403
Forbidden - API key is inactive or expired, or the request IP is not allowed for this key
429
Too Many Requests - Rate limit exceeded
500
Internal Server Error

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 }
  }'

Ready to get started?

Create an API key to start using the Markdown to HTML Converter API.

Rather use it in your browser? Open the Markdown to HTML Converter