# HTML to Markdown converter

> Open a local .html file and get clean Markdown back: headings, paragraphs, links, lists, tables, emphasis, and code are kept, while scripts, styles, and forms are stripped.

Source: https://markdownlens.ayushdev.com/html-to-markdown · Updated 2026-11-12 · Markdown Lens, free and open source: https://github.com/ayushhagarwal/markdown-lens

Scripts, styles, embedded frames, and forms are removed before conversion so the Markdown remains focused and safe to review.

Open the converter: https://markdownlens.ayushdev.com/html-to-markdown (drop a HTML file on the page; it is processed in your browser and not uploaded).

## Steps

1. Open a local .html or .htm file.
2. Unsafe and non-content elements are removed.
3. Review and export the cleaned Markdown.

## Example: HTML converted to Markdown

Input: `release-notes.html` (HTML body)

- `<h1>Release notes</h1>`
- `<p>Fixed the <strong>export</strong> bug. Read the <a href="https://example.com/docs">docs</a>.</p>`
- `<ul><li>Faster OCR</li><li>Smaller bundles</li></ul>`
- `<table> Version | Date · 2.4 | May 2 </table>`

Markdown output:

```markdown
# Release notes

Fixed the **export** bug. Read the [docs](https://example.com/docs).

-   Faster OCR
-   Smaller bundles

| Version | Date |
| --- | --- |
| 2.4 | May 2 |
```

## What the converter preserves

- Headings, paragraphs, lists, and blockquotes
- Links, emphasis, images, and code
- Tables that fit GitHub-flavored Markdown
- The HTML document title when available

## Limitations

- CSS presentation and interactive behavior are not converted.
- Complex layout containers are flattened to reading order.
- Remote images remain remote references unless downloaded separately.

## How to convert an HTML page to Markdown

1. Save the page as an .html file (in most browsers: File → Save Page As → Web Page, HTML Only).
2. Drop the file on this page or choose “Open or convert HTML”.
3. Review the Markdown. Navigation menus and footers come through as text, so delete what you do not need.
4. Copy the Markdown or download it as a .md file.

## How HTML elements map to Markdown

| HTML | Markdown |
| --- | --- |
| <h1> … <h6> | # … ###### |
| <strong>, <em> | **bold**, *italic* |
| <a href> | [text](url) |
| <ul>, <ol> | - item, 1. item |
| <pre><code> | Fenced code block |
| <table> | GitHub-flavored Markdown table |
| <script>, <style>, <form>, <iframe> | (removed) |

## Frequently asked questions

### Does Markdown Lens execute scripts?

No. Script, style, frame, object, and form elements are removed before Markdown conversion.

### Can it fetch a website URL?

This release converts local HTML files. It does not proxy or scrape remote pages.

### Is the HTML uploaded?

No. Conversion runs in your browser.

## Related

- [EPUB to Markdown converter](https://markdownlens.ayushdev.com/epub-to-markdown): Convert unprotected EPUB chapters into one Markdown document.
- [XML to Markdown converter](https://markdownlens.ayushdev.com/xml-to-markdown): Validate and pretty-print XML locally as fenced Markdown.
