HTML to Markdown Converter
Paste HTML from a web page, an email or a CMS and get clean Markdown with headings, lists, tables, code and links. Nothing is uploaded.
HTML
827 characters20 lines
# Getting started with field notes
Field notes keeps your observations **offline** until you are back online. Read the [sync guide](/docs/sync) for details.

## Install
```bash
npm install field-notes
```
## Options
| Option | Default |
| --------- | ------: |
| `sync` | true |
| `quality` | 0.8 |
- Works *without* a connection
- ~~Manual export~~ is no longer needed
> Tip: sync before a long trip.457 characters23 lines
How to convert HTML to Markdown
Paste HTML
Paste HTML source or open an
.htmlfile. To convert what you see on a page, copy it into the Rich Text to Markdown converter.Add the page address
Enter the address the HTML came from, so relative links and images such as
/img/a.pngbecome full URLs.Copy the Markdown
Copy the result or download a
.mdfile; the Preview tab shows it rendered.
What it handles
- GitHub Flavored Markdown
- Tables, task lists, strikethrough and fenced code blocks come out the way GitHub writes them.
- Code keeps its language
<pre><code class="language-js">becomes a fenced block markedjs, and highlighting spans are dropped.- Tables found and kept
- HTML tables become pipe tables;
<th>cells, or else the first row, become the header row. - Links and images
- Links and images keep their text and titles, and relative addresses are completed from the page address.
- Layout clutter removed
- Scripts, styles, comments and wrappers such as
<div>and<span>go, and the text inside them stays. - Math and footnotes
- KaTeX formulas and MathML that carries its TeX turn back into
$…$, and the footnote sections GitHub and Pandoc write become Markdown footnotes.
HTML elements and the Markdown they become
The right-hand column is the converter's own output for each example, with images kept as the page does by default.
| Element | HTML | Markdown |
|---|---|---|
| Headings | | |
| Bold and italic | | |
| Strikethrough | | |
| Links | | |
| Lists | | |
| Task lists | | |
| Tables | | |
| Code | | |
| Line breaks | | |
| Quotes | | |
| Images | | |
Convert HTML to Markdown in code
JavaScript
Turndown converts in the browser or in Node. Add the turndown-plugin-gfm plugin for tables and strikethrough.
import TurndownService from "turndown";
const turndown = new TurndownService({ headingStyle: "atx", codeBlockStyle: "fenced" });
const markdown = turndown.turndown("<h1>Hello</h1><p>World</p>");
Python
from markdownify import markdownify
markdown = markdownify(html, heading_style="ATX")
Pandoc
pandoc page.html -f html -t gfm -o page.md
Questions and answers
How do I convert HTML to Markdown?
Paste the HTML above and copy the Markdown on the right, or download it as a
.md file. The conversion runs in your browser.How do I turn a web page into Markdown?
Select the part of the page you want, copy it and paste it into the Rich Text to Markdown converter. To work from the source instead, copy the HTML from the browser's developer tools and paste it here together with the page address.
Why do links and images point nowhere?
The HTML uses relative addresses such as
/docs/sync, which only work on their own site. Enter the page address in Page address and they become complete URLs.What happens to HTML that Markdown cannot express?
Elements with no Markdown syntax, such as
<div>, <span> or colored text, are dropped and their text is kept. Use the Markdown result as a clean base and add formatting back where you need it.Can I convert only an HTML table?
Yes. Paste the
<table> here, or use the HTML Table to Markdown converter, which also handles tables copied from spreadsheets.Is my HTML uploaded anywhere?
No. The conversion runs in your browser, so the HTML never leaves your device.
Related tools
- Rich Text to MarkdownPaste from Google Docs, Word or a web page and get Markdown.
- Markdown to HTMLClean, safe HTML for a site or blog, or a complete styled page.
- Word to MarkdownTurn a .docx file into Markdown with its tables and images.
- PDF to MarkdownRebuild headings, lists, tables and links from a PDF's text.
- Markdown to WordDownload an editable .docx with Word headings, tables and equations.
- Markdown to PDFSave a PDF with selectable text, formulas, highlighted code and page numbers.