HTML to Markdown Converter

HTML to Markdown Converter API

Content

Free HTML to Markdown converter with full formatting control. Transform web content for blogs, documentation, and more.

Authentication

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

Rate Limit

100 requests per minute

Endpoints

1 endpoint available

Overview

The HTML to Markdown Converter API transforms HTML content into clean Markdown with extensive formatting options using the Turndown library.

Features

  • Convert HTML to clean, readable Markdown
  • Configurable heading styles (ATX or Setext)
  • Customizable list markers, code block styles, and delimiters
  • Control link formatting (inline or referenced)

Use Cases

  • Migrate web content to Markdown-based CMS platforms
  • Convert HTML documentation for GitHub repositories
  • Extract content from web pages in portable format
  • Integrate HTML-to-Markdown conversion in content pipelines

Endpoints

POST
/v1/tools/html-to-markdown
Convert HTML content to Markdown

Request Body

Content-Type: application/json

ParameterTypeRequiredDescription
html
string
Required
The HTML content to convert
options
object
OptionalConversion options
options.headingStyle
string
OptionalHeading format: "setext" (default, underline style) or "atx" (# style)
options.hr
string
OptionalHorizontal rule string (default: "* * *")
options.bulletListMarker
string
OptionalList marker: "*" (default), "-", or "+"
options.codeBlockStyle
string
OptionalCode block style: "indented" (default) or "fenced"
options.fence
string
OptionalFence style: "```" (default) or "~~~"
options.emDelimiter
string
OptionalEmphasis delimiter: "_" (default) or "*"
options.strongDelimiter
string
OptionalStrong delimiter: "**" (default) or "__"
options.linkStyle
string
OptionalLink style: "inlined" (default) or "referenced"
options.linkReferenceStyle
string
OptionalReference style: "full" (default), "collapsed", or "shortcut"

Response Example

{
  "success": true,
  "data": {
    "markdown": "# Hello World\n\nThis is **bold** and _italic_ text.\n\n* List item 1\n* List item 2\n\n[Link](https://example.com)",
    "inputLength": 156,
    "outputLength": 98
  }
}

Error Codes

400
Bad Request - Missing HTML content
401
Unauthorized - Invalid or missing API key
429
Too Many Requests - Rate limit exceeded
500
Internal Server Error

Code Examples

curl -X POST https://api.opentools.ca/v1/tools/html-to-markdown \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "html": "<h1>Hello World</h1><p>This is <strong>bold</strong> and <em>italic</em> text.</p><ul><li>List item 1</li><li>List item 2</li></ul>",
    "options": {
      "headingStyle": "atx",
      "bulletListMarker": "-",
      "codeBlockStyle": "fenced"
    }
  }'

Ready to get started?

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