HTML to Markdown converter

Paste HTML or upload an .html file and get readable Markdown. Headings, lists, tables, links, images and code blocks (with their language) are converted; scripts, styles and page clutter are dropped.

  • Paste or upload
  • Main content only
  • Code languages kept
  • Tables

What the HTML converter keeps

  • Structure: h1-h6, paragraphs, lists, blockquotes and tables.
  • Code: <pre> blocks become fenced code with the language from class="language-...".
  • Links and images: as Markdown links and images.
  • Main content: navigation, cookie banners, sidebars and footers are removed when converting a page.
  • Clean output: scripts, styles, forms and tracking markup are dropped.

Example output

A blog post page with a nav bar, cookie banner, article and footer. The article alone comes out as:

# How Rate Limits Work

Rate limits protect APIs from overload. They are usually expressed as **requests per second** or per month. Most providers return HTTP `429 Too Many Requests` when the limit is exceeded, along with a `Retry-After` header.

## Token bucket

The token bucket algorithm refills tokens at a fixed rate.

```csharp
var limiter = new TokenBucketRateLimiter(options);
```

## Best practices

- Use exponential backoff
- Cache responses

How to convert HTML to Markdown

  1. Paste the HTML into the box above (the format is preset to HTML), or upload an .html file.
  2. Click Convert to Markdown.
  3. Copy the result. For a live web page, paste its address in the URL to Markdown tool instead.

HTML to Markdown API

Upload HTML as a file, or send any URL with GET /v1/convert/raw?url=. Set mainContentOnly=false to keep the whole page.

curl -X POST "https://anytomarkdown-pdf-to-markdown-and-document-parser-api.p.rapidapi.com/v1/convert/raw?mainContentOnly=true" \
  -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
  -H "X-RapidAPI-Host: anytomarkdown-pdf-to-markdown-and-document-parser-api.p.rapidapi.com" \
  -F "file=@page.html" 

Get a free API key API overview

Frequently asked questions

How do I convert HTML to Markdown?

Paste the HTML into the converter above and click Convert. Headings, lists, links, tables and code blocks are converted.

Does it keep the whole page or only the article?

Pasted HTML is reduced to its main content: menus, banners and footers are removed. With the API, mainContentOnly=false keeps everything.

Are code blocks preserved?

Yes, as fenced code blocks, with the language taken from class names such as language-python.

Can I convert a live URL?

Yes, use the URL to Markdown tool or the From URL tab.