To save a web page as Markdown, save it in Chrome or Edge with Ctrl+S as Webpage, Complete, then add the HTML file to MD Factory. The app converts the page on your PC and saves a Markdown file with the page's images next to it.
This guide is for pages you keep for yourself: articles, documentation, recipes, reference pages. If you need to convert HTML in a script or a build, skip to the last section.
Save the page in Chrome or Edge
In Chrome, press Ctrl+S, or open the More menu, choose Cast, save, and share, then Save page as. The steps are in Chrome Help.
In Edge, press Ctrl+S. The shortcut is listed in Edge keyboard shortcuts.
In the Save as type list, choose Webpage, Complete. Both browsers offer three formats, and MD Factory treats them differently:
| Save as type | What the browser saves | What you get in MD Factory |
|---|---|---|
| Webpage, Complete | An HTML file and a folder with the same name ending in _files, which holds the images | Text and images |
| Webpage, HTML Only | Only the HTML file; the images stay on the website | Text without images, marked Needs review |
| Webpage, Single File | One MHTML file | Nothing: MD Factory does not open MHTML files and lists them as skipped |
Convert the saved page
- Open MD Factory.
- Click Add files and choose the saved HTML file, or drag it onto the window.
- Conversion starts right away. When the row shows the result, double-click the result path to open the Markdown file.
Add the HTML file rather than the folder it sits in. If you add the folder, MD Factory also goes through the _files folder: its scripts, style sheets, and images are listed as skipped, and any HTML files inside it are converted as separate notes.
The Markdown file gets the name of the page and is saved next to it. The images it uses go into a folder beside it:
Saved pages/
Sourdough bread.html
Sourdough bread_files/
Sourdough bread.md
Sourdough bread_images/
The saved page and its _files folder stay as they were. If you move the Markdown file, move its _images folder with it: the Markdown links to the pictures in that folder.
What carries over to Markdown
| On the page | In the Markdown |
|---|---|
| Headings | Headings of the same level |
| Paragraphs, lists, and quotes | Kept, with bold and italic text |
| Code blocks and inline code | Kept as code |
| Tables | Markdown tables |
| Images saved with the page | Copied into the images folder as PNG files |
| Links | Kept, as described below |
| Scripts, styles, and embedded frames, such as video players from other sites | Removed |
| Site menus, headers, footers, sidebars, and cookie notices | Kept as ordinary text and links |
| The title in the browser tab | Left out |
If a table has header cells, its first row becomes the header of the Markdown table. Otherwise the app adds numbered column headings. Merged cells are spread over the grid: the value stays in the first cell, and the cells it covered are left empty.
Which images are kept
MD Factory never downloads anything from the internet. An image reaches the Markdown only if its file is on your PC:
- images in the _files folder that Webpage, Complete creates;
- images in other folders around the page, including folders above it;
- images embedded in the HTML code itself.
An image that exists only on the website is left out, and the file is marked Needs review. SVG images are not supported and are left out too.
How links are handled
- Full web addresses, email links, and phone links stay exactly as they are.
- Relative links, such as a link to another page of the same site, become full web addresses if the saved page records its original address. Otherwise they stay as written and work only if the linked file is in the same place relative to the Markdown file.
- Links to a section of the same page keep working, because the sections keep their anchors in the Markdown.
- Links that run a script when clicked, the ones starting with javascript:, become plain text.
Clean up the note
MD Factory converts the whole body of the page. It does not guess which part is the article, so expect the site menu at the top and the footer, related links, and cookie notice at the bottom. Delete what you do not need.
The title from the browser tab is not included. If the article's own heading is missing, add one at the top.
Add the page's address and the date you saved it as the first line of the note. That lets you find the original later and credit it when you quote it.
If you keep notes in Obsidian, our guide to importing documents into Obsidian covers converting files into a vault and keeping their images linked.
If the page gets Needs review
Needs review means the Markdown file was saved, but something on the page did not come through. When the queue has finished, click the status in the file's row to see the message.
| Message | Usual cause |
|---|---|
| An external image or resource was skipped. | An image is only on the website, for example after saving as Webpage, HTML Only. |
| An image could not be exported. | The page points to an image file that is missing from the folder. |
| An image format is not supported. | The image is in a format the app cannot convert, such as SVG. |
| Some document content could not be represented in Markdown. | The page had an embedded frame, such as a video player from another site, and it was removed. |
| A local link target could not be preserved. | A link to another page of the site could not be matched to a web address or a saved file. Its text is kept without the link. |
| The text encoding was inferred. Check special characters. | The page is not saved in UTF-8, so the app had to work out its encoding. Check accented letters and symbols. |
Converting HTML in code
If you need HTML to Markdown in a script, a build step, or a scraper, MD Factory is the wrong tool: it works through its window, with no command line or programming interface. Use a library instead. Turndown converts HTML to Markdown in JavaScript, in Node.js or in the browser, under the MIT license. html2text does the same in Python, under GPL-3.0. Pandoc is a command-line converter between many document formats, including HTML and Markdown. With any of them, you set the conversion rules and handle images and links yourself.
pandoc -f html -t gfm page.html -o page.md