Convert HTML to Markdown with the API
Send an HTML file to /v1/convert and get Markdown with headings, lists, links and tables. Or paste HTML into the free tool.
Last updated
POST /v1/convert converts an HTML file to Markdown in one call. Headings, lists, links and tables carry over, and <script> and <style> elements are removed.
curl
curl -F "file=@page.html;type=text/html" https://api.flatmark.dev/v1/convert
{"markdown": "[Home](/)\n\n# Release notes\n\n* Faster export\n\n| Version | Date |\n| --- | --- |\n| 1.2 | 2026-09-01 |", "meta": {"filename": "page.html"}}
Plain text (text/plain) is accepted too.
What is removed
Only <script> and <style> are removed. Navigation, headers and footers stay in the output, as the [Home](/) link above shows. To keep only the main content, send just that element, for example the page's <main> or <article>.
Next step
Paste HTML into the free tool, up to 100 KB and without an account. It runs the same conversion on the server and stores nothing.
FAQ
- How is this different from a local library such as html2text?
- For HTML alone, a local library works as well. The API helps when the same pipeline also takes PDF, Word, PowerPoint and Excel files.
- How much HTML can I send?
- The direct call takes files up to 8 MB. The free tool takes pasted HTML up to 100 KB.