HTML to Markdown API

Convert HTML or any web page URL into clean GitHub-flavored Markdown, with tables, optional article extraction and absolute links.

GETPOSThttps://apibox.io.vn/v1/html-to-markdown
Content & HTML▶ Try it online

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.

Parameters

NameInTypeRequiredDefault
htmlbody|querystringnoHTML to convert (max 5 MB). Can also be sent as a raw text/html body. Required unless url is given.
urlbody|querystringnoPublic http/https URL of a page to fetch and convert (takes precedence over html).
base_urlbody|querystringnoBase URL used to make relative links and image sources absolute when sending html.
readabilitybody|querybooleannofalseExtract only the main article (Readability) and return an excerpt. Alias: article.
keep_linksbody|querybooleannotrueKeep links; when false only the link text is kept.
keep_imagesbody|querybooleannotrueKeep images; when false img, picture and figure elements are removed.
heading_stylebody|querystringnoatxHeading style: atx (# Title) or setext (underlined).
bulletbody|querystringno-Bullet list marker: -, * or +.
code_block_stylebody|querystringnofencedCode blocks: fenced (``) or indented`.
link_stylebody|querystringnoinlinedLinks: inlined [text](url) or referenced [text][1].

Example

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"}'

Response

{
  "title": "",
  "markdown": "# Getting started\n\nAPIBox turns **HTML** into clean [Markdown](https://example.com/docs).\n\n-   Fast\n-   Simple\n\n| Plan | Requests |\n| --- | --- |\n| Free | 1,000 |",
  "characters": 162,
  "words": 28
}

Use cases

  • Feed web pages to an LLM or RAG pipeline as compact Markdown
  • Migrate a blog or CMS content from HTML to Markdown files
  • Save articles in reader mode for notes apps such as Obsidian
  • Convert HTML emails or rich-text editor output to Markdown

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.

Related APIs

Start with 1,000 free requests every month. Get free API key →