How to Convert Google Docs to Markdown
The quickest way to convert Google Docs to Markdown is Google's own File menu. Choose File, then Download, then Markdown (.md), and Google Docs saves a .md copy to your computer with no add-on needed.
Two other routes suit different jobs. You can copy part of a document as Markdown, or download it as a Word file and convert that. The last sections cover the reverse direction, from Markdown back into Google Docs.
Method 1: how to convert a Google Doc to Markdown with File > Download
The built-in export turns the whole document into one Markdown file.
- Open the document in Google Docs.
- Click File, then Download.
- Choose Markdown (.md).
- Open the downloaded file in a text editor or a Markdown viewer and compare it with the original.
In step 4, check that the heading levels match your outline and that tables came through as tables. Also check that every image you need is accounted for. Fix anything odd in the .md file before you publish it. Small fixes are quicker in the Markdown than in the Doc, because you can see every heading marker and table pipe.
Convert a Google Doc to a README.md
The same export makes a README. Download the .md file, rename it README.md, and add it to the root of the repository. GitHub recognises a README there and shows it to visitors.
Method 2: copy part of a document as Markdown
When you need one section instead of the whole file, copy it as Markdown. This option is off until you switch it on.
- In Google Docs, open Tools, then Preferences.
- Tick Enable Markdown.
- Select the text you want.
- Right-click it and choose Copy as Markdown.
- Paste it into your editor, issue tracker or README.
The same setting adds Paste from Markdown to the right-click menu, which is useful for the reverse direction covered below.
Method 3: download as .docx and convert it in your browser
The third route goes through Word's format. In Google Docs, choose File, then Download, then Microsoft Word (.docx). Then drop the .docx file onto the Word to Markdown converter page on MarkPrep. The file is converted in your browser tab and is not uploaded.
This route is worth the extra step in three cases:
- You need the images as files. MarkPrep pulls the pictures out of the document and stores them as numbered files (
image-1.png,image-2.jpgand so on) in animages/folder. The Markdown points to those files. A .zip button appears next to .md, and the zip holds the Markdown and the folder together. - The text is going into an AI model. The result panel shows an estimated token count for named Claude, GPT and Gemini models, and says whether the document fits the model's context window. It can also split the text into chunks and export them as JSONL for a retrieval (RAG) pipeline.
- You only have the .docx. A colleague who works in Google Docs may send you a Word download instead of sharing the doc. You can convert that file without opening Google Docs at all.
Here is what to check in the result. MarkPrep maps Word's Title and Heading 1 styles to #, Subtitle and Heading 2 to ##, and Heading 3 to ###. Text that was only made big and bold, with no heading style, comes out as an ordinary paragraph, not a heading. Tables become Markdown pipe tables, with the first row as the header. If the Word file uses formatting that MarkPrep can't turn into Markdown, a note under the result says so.
Only .docx works on this route. An old binary .doc file has to be saved again as .docx first.
Which way to convert a Google document to Markdown should you use?
| You want | Use | What you get |
|---|---|---|
| The whole document as Markdown | File > Download > Markdown (.md) | One .md file |
| One section for a README or a ticket | Copy as Markdown (after Enable Markdown) | Markdown on your clipboard |
| Images as separate files | Download .docx, then convert in MarkPrep | A .zip with the .md file and an images/ folder |
| Token counts or chunks for an AI model | Download .docx, then convert in MarkPrep | The .md file plus token estimates, chunk preview and JSONL |
Google's export, Copy as Markdown and the MarkPrep route all work in the browser, with nothing to install. If you want to convert a Google Doc to Markdown online and are worried about privacy, note where each step runs. Google's own export runs in your Google account, where the document already lives. MarkPrep converts the downloaded .docx in your browser tab.
How to import Markdown into Google Docs
To bring Markdown back into Google Docs, use Paste from Markdown:
- Turn on Enable Markdown under Tools, then Preferences, as in Method 2.
- Copy the Markdown text from your editor or
.mdfile. - In the Google Doc, right-click and choose Paste from Markdown.
Google Docs turns the Markdown into its own formatting as it pastes, so the result is an ordinary document that others can edit.
Markdown to Word through Google Docs
You can paste the Markdown into a Doc with Paste from Markdown, then download it as Microsoft Word (.docx). To skip Google Docs, MarkPrep's Word export builds a real .docx file in your browser. It uses Word's heading styles and real Word lists and tables, and links stay clickable. Pictures are not embedded. An image with alt text becomes a short note that holds that text.
PDF to Markdown for Google Docs
To get a PDF's text into a Google Doc with its headings intact, convert the PDF first. MarkPrep's PDF converter rebuilds headings and simple tables from a digital PDF, and reads scanned pages with English OCR. Copy the result, then use Paste from Markdown in the Doc.
Is Google Docs a Markdown converter?
Yes. Google Docs converts to and from Markdown. It exports a document as a .md file, copies a selection as Markdown, and pastes Markdown in as formatted text. For a plain document, that is all you need.
Use a separate converter when the built-in export doesn't give you what the next step needs. That means images as files, a token count before you paste into a model, or chunks for a retrieval index. For those, download the .docx and drop it onto the Word to Markdown converter page. If the document is long, MarkPrep's context window checker tests it against your model.
Try it on your own file
Convert a document and watch the token counter. It's free, needs no account and uploads nothing.