HTML to Markdownbuilt for your workflow
Powerful API, CLI tools, and integrations designed for developers who need reliable HTML to Markdown conversion in their automation pipelines, CI/CD workflows, and applications.
Developer-First Features
RESTful API
Simple HTTP API with JSON responses. No SDK required - works with any language or framework.
curl -X POST \
https://api.htmltomarkdown.io/convert \
-H "Content-Type: application/json" \
-d '{"html": "<h1>Hello</h1>"}'Edge Network
Deployed on Cloudflare Workers. <100ms response times from 275+ cities worldwide.
API Key Management
Simple API key authentication. Generate keys instantly, no signup friction.
- Free tier: 1,000 requests/day
- Pro tier: Unlimited requests
- Rate limit headers included
Batch Processing
Convert up to 100 HTML documents in a single API call. Perfect for bulk migrations.
{
"batch": [
{"html": "<h1>Doc 1</h1>"},
{"html": "<h2>Doc 2</h2>"}
]
}URL Conversion
Point to any public URL and get Markdown back. Great for web scraping and content archival.
{
"url": "https://example.com/article"
}Customizable Options
Fine-tune output with heading styles, code block fences, list markers, and more.
- ATX/Setext headings
- Fenced/indented code blocks
- Table preservation
- Link reference styles
Integration Examples
Copy-paste examples to get started in seconds
JavaScript / Node.js
convert.js// Using fetch (Node 18+ or browser)
async function convertHtmlToMarkdown(html) {
const response = await fetch('https://api.htmltomarkdown.io/convert', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
body: JSON.stringify({ html })
});
const data = await response.json();
return data.markdown;
}
// Usage
const markdown = await convertHtmlToMarkdown('<h1>Hello World</h1>');
console.log(markdown); // # Hello WorldPython
convert.pyimport requests
def convert_html_to_markdown(html: str) -> str:
response = requests.post(
'https://api.htmltomarkdown.io/convert',
headers={
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY'
},
json={'html': html}
)
response.raise_for_status()
return response.json()['markdown']
# Usage
markdown = convert_html_to_markdown('<h1>Hello World</h1>')
print(markdown) # # Hello WorldGo
convert.gopackage main
import (
"bytes"
"encoding/json"
"net/http"
)
type ConvertRequest struct {
HTML string `json:"html"`
}
type ConvertResponse struct {
Markdown string `json:"markdown"`
}
func ConvertHTMLToMarkdown(html string) (string, error) {
reqBody, _ := json.Marshal(ConvertRequest{HTML: html})
req, _ := http.NewRequest("POST",
"https://api.htmltomarkdown.io/convert",
bytes.NewBuffer(reqBody))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
return "", err
}
defer resp.Body.Close()
var result ConvertResponse
json.NewDecoder(resp.Body).Decode(&result)
return result.Markdown, nil
}Bash / Shell Script
convert.sh#!/bin/bash
# Convert HTML file to Markdown
html_content=$(cat input.html)
curl -X POST https://api.htmltomarkdown.io/convert \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d "{\"html\": \"$html_content\"}" \
| jq -r '.markdown' > output.md
echo "Converted to output.md"
# Or convert a URL directly
curl -X POST https://api.htmltomarkdown.io/convert \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"url": "https://example.com"}' \
| jq -r '.markdown' > output.mdCommon Developer Use Cases
Documentation Site Generation
Migrate legacy HTML documentation to modern static site generators like Next.js, Hugo, or Jekyll.
Example:
Convert PHP.net docs to Markdown for Docusaurus site
Typical Workflow:
- 1Scrape HTML documentation pages
- 2Convert to Markdown via API
- 3Process frontmatter and metadata
- 4Generate static site
Web Scraping & Archival
Extract and archive web content in a portable, future-proof Markdown format.
Example:
Archive blog posts for personal knowledge base
Typical Workflow:
- 1Identify target URLs
- 2Batch convert via API
- 3Store in Git repository
- 4Full-text search with tools like ripgrep
Content Migration
Move content from legacy CMSs (WordPress, Drupal) to modern Git-based workflows.
Example:
Migrate 1000+ WordPress posts to Markdown
Typical Workflow:
- 1Export HTML from CMS
- 2Batch process with API
- 3Parse and structure content
- 4Import to new system
CI/CD Integration
Automate HTML to Markdown conversion in your deployment pipeline.
Example:
Convert API responses to documentation on every release
Typical Workflow:
- 1GitHub Actions trigger on push
- 2Generate HTML from API specs
- 3Convert to Markdown
- 4Deploy to docs site
Email to Markdown
Convert HTML emails to Markdown for archival or note-taking apps.
Example:
Save newsletters to Obsidian vault
Typical Workflow:
- 1Fetch email via IMAP
- 2Extract HTML body
- 3Convert to Markdown
- 4Save with metadata
Browser Automation
Use with Playwright/Puppeteer to extract rendered page content as Markdown.
Example:
Extract dynamic SPA content
Typical Workflow:
- 1Navigate to page with headless browser
- 2Wait for content to load
- 3Extract outerHTML
- 4Convert to clean Markdown
Start building today
Free tier includes 1,000 requests per day. No credit card required.