HTML to Markdown
Convert HTML into Markdown.
POST
1 credit
/v1/convert/html-to-markdown
curl -X POST "https://convert.toolkitapi.io/v1/convert/html-to-markdown" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"html": "<h1>Hello</h1><p>World!</p>"}'
import httpx
resp = httpx.post(
"https://convert.toolkitapi.io/v1/convert/html-to-markdown",
json={"html": "<h1>Hello</h1><p>World!</p>"},
)
print(resp.json())
const resp = await fetch("https://convert.toolkitapi.io/v1/convert/html-to-markdown", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({"html": "<h1>Hello</h1><p>World!</p>"}),
});
const data = await resp.json();
console.log(data);
# See curl example
Response
200 OK
{
"markdown": "# Hello\n\nWorld!\n",
"metadata": {"word_count": 2}
}
Description
Convert HTML into Markdown.
How to Use
1
1. POST a JSON body with `html` (or `url`).
2
2. Read the `markdown` string and `metadata` from the response.
About This Tool
Converts HTML back into Markdown. Elements that have Markdown equivalents (headings, lists, links, images, blockquotes, code) are translated faithfully; HTML-only constructs (tables without `gfm`, inline styles) either pass through as raw HTML or are simplified.
Useful for round-tripping between WYSIWYG editors and Markdown-native storage.
Why Use This Tool
- WYSIWYG → Markdown — Store user-edited HTML as Markdown in version control
- Content migration — Move HTML archives to Markdown-based CMSes
- Email ingestion — Turn HTML emails into Markdown for plain-text processing
- Scraping pipelines — Clean up scraped HTML into Markdown for further analysis
Frequently Asked Questions
Are tables preserved?
Tables render as Markdown tables (GFM flavor). Complex tables with merged cells may require manual cleanup.
What about inline styles?
Inline CSS is stripped. The result is semantic Markdown without visual formatting.
Are images preserved?
Yes — `<img>` tags become `` in Markdown.
Start using HTML to Markdown now
Get your free API key and make your first request in under a minute.