HTML to Markdown, in short
Paste HTML on the left, or upload an .html file up to 2 MB. Click Convert to Markdown, then copy the text on the right. Raw is what you paste into an editor. Preview only helps you read it. Scripts, styles, and CSS layout are left out.
An HTML to Markdown converter turns tags into Markdown characters: # for headings, ** for bold, - for lists, and pipes for tables. Use the tool above and press Convert to Markdown. The work happens in your browser. Small Tools Buddy does not upload or store the markup.
You need this when a CMS, an email, or an old page handed you HTML and the next place wants Markdown. A README, a docs site, and plenty of blogs want that plain-text form. The box above does that one job. It does not redesign the page, and it does not open a PDF.
How to convert HTML to Markdown
Three steps. Stay on this page. Nothing is sent to a Small Tools Buddy server.
Paste or upload the HTML
Put the markup in the HTML box, or upload an .html, .htm, or .txt file up to 2 MB. The file is read on this device.
Click Convert to Markdown
The right side fills in. Raw shows the Markdown characters. Preview reads that result as headings, lists, and tables. If you edit the HTML, convert again before you copy. Ctrl+Enter, or Command+Enter on a Mac, runs the same conversion.
Copy the Markdown
Use Copy and paste the text into a README, a docs site, or a CMS that accepts Markdown. This page does not save a copy for you.
Tags this converter keeps
Paste a fragment, not a whole website, when you can. These tags become Markdown. A span or div that only wraps words is kept as those words. Underline is not a Markdown mark here, so the words stay and the underline does not.
| HTML | Markdown you get |
|---|---|
| h1 to h6 | # through ###### |
| p, and text in a div | A paragraph |
| strong, b | **bold** |
| em, i | *italic* |
| del, s | ~~strike~~ |
| a | [label](url) |
| img |  |
| ul, ol, including nested lists | - item, or 1. item |
| table | A pipe table. The first row is the header |
| blockquote | A line starting with > |
| pre and code | A fenced code block. language-js becomes ```js |
| dl, dt, dd | The term in bold, then the definition |
| hr | --- |
| br | A line break inside the paragraph |
Pastes longer than 400,000 characters are refused. Split a long page into the section you actually need.
Conversions you can check
These four snippets are the same rules the button uses. If your result disagrees, the HTML is probably different from the sample, not a second hidden mode.
Emphasis and a link
<p>This is <strong>bold</strong> and <em>italic</em> text with a <a href="https://smalltoolsbuddy.com/text-analyzer">word counter</a>.</p>This is **bold** and *italic* text with a [word counter](https://smalltoolsbuddy.com/text-analyzer).A nested list
<ul>
<li>Paste HTML</li>
<li>Convert
<ul>
<li>Raw</li>
<li>Preview</li>
</ul>
</li>
</ul>- Paste HTML
- Convert
- Raw
- PreviewA table
The first row becomes the header, including when the HTML used th in a thead. GitHub’s pipe tables work the same way: one header row, then a separator, then the body.
<table>
<tr><th>Format</th><th>Where it shows up</th></tr>
<tr><td>Heading</td><td>README title</td></tr>
<tr><td>List</td><td>Release notes</td></tr>
</table>| Format | Where it shows up |
| --- | --- |
| Heading | README title |
| List | Release notes |A code block
A language-js class on the code element becomes the fence label. The code text is copied as it appears. It is not executed.
<pre><code class="language-js">const words = text.split(" ");</code></pre>```js
const words = text.split(" ");
```What the converter leaves out
The tool reads the markup you paste. It does not open the page in a layout engine, so CSS never becomes Markdown. Text inside a hidden element is still converted if that text is in the HTML.
- script, style, and noscript contents are dropped
- svg, canvas, and iframe contents are dropped
- A javascript: link becomes the link text only, without the script URL
- Colors, columns, fonts, and pixel spacing are not copied
- Merged table cells stay a single cell
- Navigation and footer text are included if you paste the whole page
- A code block inside a list item is skipped. Move the pre outside the list
A quote comes through as a line that starts with >. An hr becomes ---. A definition list becomes the term in bold, then the definition as the next paragraph. Those are structure marks. They will not recreate a styled callout box.
This page, a library, or Pandoc
Use this page for a one-off paste. You have HTML in a box, you want Markdown in another box, and you do not want to install anything. That is the whole fit.
Use Turndown when an application should convert HTML every time, in your own code. It is a JavaScript library, not a box on a website. You own the integration, the updates, and the edge cases.
Use Pandoc when the HTML is a file on your computer and you want a local document converter. Pandoc also moves between formats that this page never touches. You install it and run it there. This page does not call Pandoc.
If another website asks you to upload a client page or an email template, read that site’s policy before you send it. Here, the HTML stays in the browser tab.
Read the Markdown before you publish it
Raw is the text to trust. Preview is a reading aid for that text. A heading that looks right in Preview can still be the wrong level for the CMS you paste into. Check the # marks. If you switch to Preview and the HTML had images, your browser requests those image addresses from their hosts. Raw does not make that request.
Characters that Markdown would treat as formatting are escaped in ordinary text. A literal asterisk in a sentence should appear with a backslash in Raw. Code inside pre is not escaped that way, so a code sample keeps its stars and brackets.
Ordered lists keep a start value, so a list that begins at 3 stays 3. and 4.. Nested lists are indented by two spaces. Text that was a heading inside a list item stays on the list item. It does not open a new heading.
After you copy, run a word count only if you need one. Paste the Markdown into the word and character counter. Do not expect this converter to count words for you.
Related document tools
HTML you can paste belongs on this page. A file that is not HTML belongs on a different tool.
- Word and character counter for text you type or paste, including Markdown you just copied.
- PDF to Markdown converter for a text PDF. It does not read HTML, and it does not count words.
- PDF word counter for a word count of a PDF. It does not write a .md file.
- Word document word counter for a .docx file. It counts extracted text. It does not export Markdown.
What to do next
Convert the fragment, read Raw, and copy it. If the destination is a README or a Markdown CMS, you are done after a quick look at headings and links. If the destination needs the original layout, Markdown is the wrong target and this page will not invent that layout back.
HTML to Markdown questions
How do I convert HTML to Markdown?
Paste the HTML into the left box, or upload an .html, .htm, or .txt file up to 2 MB. Click Convert to Markdown, check Raw or Preview, then copy the result. The conversion runs in your browser.
Is my HTML uploaded?
No. Small Tools Buddy does not receive the HTML, the file, or the Markdown. Closing the tab clears it. A browser extension on your computer can still see the page, so do not paste passwords or private keys here.
Which HTML tags become Markdown?
Headings, paragraphs, bold, italic, strike, links, images, lists, nested lists, tables, quotes, fenced code, definition lists, and horizontal rules. Script, style, SVG, and iframe contents are dropped. A code block placed inside a list item is skipped.
How are HTML tables converted to Markdown?
Each row becomes a Markdown table row. The first row is the header, which is how pipe tables work on GitHub. A cell with colspan or rowspan is written once, so merged cells do not stay merged.
Why does the Markdown not look like the web page?
Markdown stores structure, not CSS. Columns, colors, fonts, and spacing from the original page are not in the result. Paste the fragment you need. A full saved page also converts the navigation and footer text.
What is the difference between Raw and Preview?
Raw is the Markdown text you copy. Preview is a reading view of that Markdown, not a picture of the original HTML page. If the Markdown contains an image URL, Preview asks your browser to load that image from its host. Raw does not.
Can I convert a PDF or a Word file here?
No. This page reads HTML text. For a PDF you want as Markdown, use the PDF to Markdown converter. For a word count on a PDF, use the PDF word counter. For a .docx file, use the Word document word counter. For plain text you can already paste, use the word and character counter.
Is the HTML to Markdown converter free?
Yes. It is free and it does not ask for an account.