Skip to content
CleanGlyph home

HTML to Markdown Converter Online

Turn HTML documents and fragments into clean Markdown for GitHub, README files and documentation. Headings, links, lists, code blocks and tables keep their structure; scripts and styles are removed. Everything runs locally in your browser.

Your text never leaves your browser.

0 charactersAnalyzed as you type

Markdown output

Paste HTML, open a local .html, .htm or .txt file, or load the sample to convert it to Markdown.

Markdown options

Heading style
List marker
Code fence
Tables

Scripts, styles, forms and embedded media are removed. Tables with merged or nested cells always become lists.

How to convert HTML to Markdown

Paste HTML, open a local .html, .htm or .txt file, or load the sample. The converter parses the markup without running it and writes Markdown a moment after you stop typing. Choose heading, list, code fence and table styles, then copy the Markdown or download it as cleanglyph-converted.md.

HTML input
<h2>Install</h2>
<p>Run the <a href="https://example.com/cli">CLI</a> and check the <strong>output</strong>.</p>
<ul>
  <li>Node 20 or later</li>
  <li><del>Python 2</del> not required</li>
</ul>
<table>
  <tr><th>Command</th><th>Purpose</th></tr>
  <tr><td>init</td><td>Create a project</td></tr>
</table>
Markdown output
## Install

Run the [CLI](https://example.com/cli) and check the **output**.

- Node 20 or later
- ~~Python 2~~ not required

| Command | Purpose |
| --- | --- |
| init | Create a project |

HTML versus Markdown: common syntax equivalents

Markdown is a lightweight syntax for the structural parts of HTML. Most everyday elements have a direct equivalent:

HTMLMarkdown
<h1>Title</h1># Title
<strong>bold</strong>**bold**
<em>italic</em>*italic*
<del>old</del>~~old~~
<a href="/docs">Docs</a>[Docs](/docs)
<img src="cat.png" alt="Cat">![Cat](cat.png)
<code>npm i</code>`npm i`
<blockquote>Quote</blockquote>> Quote
<hr>---

Headings H1–H6 use ATX style (# Heading) by default. Setext style underlines H1 with === and H2 with ---; deeper levels have no Setext form and stay ATX. Links keep their URL and title, relative URLs are preserved, and unsafe schemes such as javascript: are dropped. Ordered lists keep their start number, nested lists are indented under their parent item, and the bullet marker can be a hyphen or an asterisk.

HTML tables and GitHub Flavored Markdown

Standard Markdown has no tables, but GitHub Flavored Markdown supports pipe tables. Tables with a single header row and no merged cells are converted into pipe tables, with | characters inside cells escaped. Tables that use colspan, rowspan or nested tables cannot be expressed that way, so each row becomes a list item such as - Name: Ana; Role: Developer. Turning GFM tables off applies the same list format to every table. Headerless or uneven tables also become lists. Empty labelled cells are shown as (empty); merged-cell relationships and nested table layout are flattened.

Code blocks and syntax highlighting

<pre><code> blocks become fenced code blocks with backticks or tildes, and their whitespace is kept. A language class such as language-js becomes the fence label so Markdown renderers can highlight the code; labels containing unexpected characters are left out. When the code itself contains a run of backticks or tildes, a longer fence is used so the block cannot close early.

What conversion cannot preserve

Markdown describes structure, not presentation. CSS, colours, fonts, layout, scripts, forms, iframes, video and audio have no Markdown equivalent and are removed rather than approximated. If you only need the visible text without any Markdown syntax, use Remove HTML Tags. To decode or encode individual entities, use the HTML Entity Encoder & Decoder.

Privacy and browser-based processing

The HTML is parsed into an inert document fragment in your browser, so scripts never run and images or other resources are never requested. Nothing is uploaded, logged or stored. After converting, you can tidy the result with the Text Cleaner or measure it with the Word & Character Counter. To go the other way, use the Markdown to HTML Converter.

Frequently asked questions

How do I convert HTML to Markdown online?

Paste HTML into the input box, open a local .html, .htm or .txt file, or load the sample. The Markdown appears automatically a moment after you stop typing. Adjust the heading, list, code fence and table options, then copy the result or download it as a .md file.

Does the converter support GitHub Flavored Markdown?

Yes. Strikethrough becomes ~~text~~, checkbox list items become task list items such as - [x], fenced code blocks keep safe language labels, and simple tables become GFM pipe tables. You can turn tables off to get labelled lists instead.

Can it convert HTML tables?

Simple tables with a row of header cells and no merged or nested cells become GitHub Flavored Markdown pipe tables, with pipe characters escaped. Headerless, uneven, merged and nested tables become lists. Cell text is kept, but merged-cell relationships and nested layout are flattened. Empty labelled cells are shown as (empty).

Are images and links preserved?

Yes. Links become [text](url) and images become ![alt](src), keeping titles. Relative, http, https and mailto links are kept. javascript:, data: and other unsafe URLs are removed and only the visible text remains. Referenced images and pages are never downloaded.

What happens to scripts and CSS?

Script, style, template, iframe, object, form controls and similar non-content elements are removed together with their contents, along with HTML comments and event handler attributes. The HTML is parsed inertly and is never executed or rendered.

Can I convert an entire HTML file?

Yes. Open a UTF-8 .html, .htm or .txt file up to 1 MiB, or paste a full document including doctype, head and body. The head is ignored and the body content is converted. Input is limited to 500,000 UTF-16 code units and output to 2,000,000 UTF-16 code units; larger content is rejected rather than truncated.

Is my HTML uploaded or stored?

No. Parsing and conversion run entirely in your browser. The HTML is not sent to a server, not included in analytics or URLs and not saved in browser storage.

Why does the Markdown look different from the original webpage?

Markdown only describes document structure such as headings, paragraphs, emphasis, lists, links, code and tables. CSS layout, colours, fonts, interactive forms, scripts and embedded media have no Markdown equivalent, so they are removed instead of being approximated.