How to save a web page or Google Doc as Markdown

Turn a web page or Google Doc into clean Markdown: copy and paste with formatting, use Reader view to drop the clutter, or convert HTML with Pandoc.

Why Markdown instead of saving the page

A saved web page is a folder of HTML, scripts and images that only a browser reads well. Markdown keeps the part you care about, the text and its structure, in a small file you can read anywhere, edit, search, keep in Git or an Obsidian vault, and paste into an AI assistant without the noise of HTML.

There are three ways to do it, depending on how much of the page you want and how many pages you have.

Copy and paste with formatting

This works for any page you can see in a browser, including pages behind a login, because you copy what is already on your screen.

  1. Select the part of the page you want and copy it (⌘C on a Mac).
  2. Paste it into the HTML to Markdown converter.
  3. Choose Copy Markdown or Download .md.

When you copy from a web page, the clipboard carries two versions: plain text and the formatted HTML. A plain-text editor only sees the first, which is why pasting into a .md file directly loses headings and links. The converter reads the HTML version.

Two options change the output. List marker chooses - or * for bullets. Keep images keeps each image as a Markdown image pointing at its original web address; turn it off to replace images with an [Image: …] note, which keeps the text tidy and avoids depending on remote files.

Drop the clutter with Reader view

Copying a whole page also copies menus, cookie banners, sidebars and footers. Strip them before you copy:

  • Safari: View → Show Reader, or the Reader button in the address bar.
  • Firefox: the Reader View icon in the address bar.
  • Chrome: right-click the page → Open in reading mode, which opens the article in a side panel.

Select the article in Reader view, copy it, and paste it into the converter. You get the title, headings, paragraphs, lists and links, without the furniture.

Convert a Google Doc

Google Docs has two routes:

  • Download as Markdown. Recent versions of Docs offer File → Download → Markdown (.md). Use it for a whole document.
  • Copy and paste. Select the part you want, copy it and paste it into the HTML to Markdown converter. Google Docs wraps copied text in hidden formatting markup; the converter removes it, so bold, italics, headings, lists, tables and links come through cleanly.

For Word files, use the Word to Markdown converter or see how to convert Word to Markdown.

Convert many pages with Pandoc

For saved HTML files or a batch of pages, Pandoc converts from the command line:

Terminal
pandoc -f html -t gfm --wrap=none page.html -o page.md

Pandoc can also read a web address directly:

Terminal
pandoc -f html -t gfm --wrap=none https://example.com/article -o article.md

It converts the whole page, menus and footers included, so you will usually trim the result. Pandoc writes anything it can't express in Markdown, such as complex tables, as HTML.

Clean up the Markdown

Whatever the method, check these before you keep or share the file:

  • Relative links. A link such as /pricing only works on the original site. Replace it with the full address.
  • Images. Image links point at the original site and break if it changes. Download the images you need and link them with relative paths.
  • Heading levels. Pages sometimes skip levels or use several top-level headings. Keep one # title and nest the rest.
  • Leftovers. Share buttons, "related articles" and newsletter boxes often survive a whole-page copy.
  • The source. Add the page title, address and the date you saved it at the top of the file, so you know where it came from.

Respect the page's copyright: a Markdown copy for your own notes or research is different from republishing someone else's article.

Read the result

Open the .md file in the free online Markdown viewer to check it renders as expected. For a reference of what each Markdown symbol does, keep the Markdown cheat sheet open.

Frequently asked questions

How do I convert a web page to Markdown?

Select the part of the page you want, copy it, and paste it into an HTML to Markdown converter such as the free one on aeromarkdown.app. The clipboard carries the page's formatting as HTML, which becomes Markdown headings, links, lists and tables.

How do I get rid of menus and ads when converting a page?

Open the page in your browser's Reader view first (Safari Reader, Firefox Reader View or Chrome's reading mode), then select and copy the article. Reader view keeps the article text and leaves out navigation, sidebars and ads.

Can Google Docs export Markdown?

Recent versions of Google Docs offer File, Download, Markdown (.md). You can also copy the content from the document and paste it into an HTML to Markdown converter, which keeps headings, lists, links and tables.

Why do links in the converted Markdown not work?

Some pages use relative links such as /pricing, which only work on the original site. Replace them with full addresses, including https:// and the domain, if the Markdown will be read elsewhere.

Why convert web pages to Markdown for ChatGPT or Claude?

Markdown keeps the structure, headings, lists and tables, in far fewer characters than HTML. Pasting Markdown instead of raw HTML gives a model the same content with less noise and uses fewer tokens.