HTML to Markdown Converter
Convert HTML or any web page URL into clean GitHub-flavored Markdown, with tables, optional article extraction and absolute links.
Result
Press “Run” to see the result.
Send an HTML string (JSON or form field html, or a raw text/html body) or a public url, and get clean Markdown back together with the page title and word and character counts. Scripts, styles, iframes, SVG and canvas elements are dropped, and GitHub-flavored extensions such as tables, strikethrough and task lists are converted.
Set readability=true to keep only the main article of a page (Mozilla Readability, the engine behind Firefox Reader View): navigation, footers and sidebars are removed and an excerpt is returned. Relative links and image sources are made absolute using the fetched URL or base_url. Output style is configurable: heading_style (atx or setext), bullet (-, * or +), code_block_style (fenced or indented), link_style (inlined or referenced), and keep_links / keep_images to strip links or images.
Limits: HTML up to 5 MB (request body up to 6 MB); pages fetched from a URL are read up to 5 MB, with a 10 second timeout and at most 8 redirects. Only public http/https hosts are allowed.
Use this in your code
curl -X POST "https://apibox.io.vn/v1/html-to-markdown" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"html":"<h1>Getting started</h1><p>APIBox turns <strong>HTML</strong> into clean <a href=\"/docs\">Markdown</a>.</p><ul><li>Fast</li><li>Simple</li></ul><table><tr><th>Plan</th><th>Requests</th></tr><tr><td>Free</td><td>1,000</td></tr></table>","base_url":"https://example.com"}'const res = await fetch('https://apibox.io.vn/v1/html-to-markdown', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"html": "<h1>Getting started</h1><p>APIBox turns <strong>HTML</strong> into clean <a href=\"/docs\">Markdown</a>.</p><ul><li>Fast</li><li>Simple</li></ul><table><tr><th>Plan</th><th>Requests</th></tr><tr><td>Free</td><td>1,000</td></tr></table>",
"base_url": "https://example.com"
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"https://apibox.io.vn/v1/html-to-markdown",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"html": "<h1>Getting started</h1><p>APIBox turns <strong>HTML</strong> into clean <a href=\"/docs\">Markdown</a>.</p><ul><li>Fast</li><li>Simple</li></ul><table><tr><th>Plan</th><th>Requests</th></tr><tr><td>Free</td><td>1,000</td></tr></table>", "base_url": "https://example.com"},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/html-to-markdown');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"html":"<h1>Getting started</h1><p>APIBox turns <strong>HTML</strong> into clean <a href=\\"/docs\\">Markdown</a>.</p><ul><li>Fast</li><li>Simple</li></ul><table><tr><th>Plan</th><th>Requests</th></tr><tr><td>Free</td><td>1,000</td></tr></table>","base_url":"https://example.com"}',
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));API documentation → Get a free API key
FAQ
Can I convert a web page by URL instead of pasting HTML?
Yes. Send url instead of html; the API fetches the page (up to 5 MB) and converts it. Add readability=true to keep only the main article content.
Are HTML tables converted to Markdown tables?
Yes. Tables, strikethrough and task lists are converted using GitHub-flavored Markdown rules.
How do I remove links or images from the Markdown?
Set keep_links=false to keep only the link text, and keep_images=false to drop img, picture and figure elements.