MDUtil

Word to Markdown Converter

Open a Word document and get clean Markdown with its headings, lists, tables, links and images. The file is converted in your browser and never uploaded.

Word document

Drop a file here or choose one

A .docx file up to 50 MB

Choose a file
Open a Word file to see its Markdown here.
0 characters0 lines

How to convert Word to Markdown

  1. Open the .docx

    Drop a Word file on the box or choose it. Files saved by Word, Google Docs, LibreOffice and WPS Office all work.

  2. Choose what happens to images

    Download them with the Markdown as a .zip, embed them in the Markdown, or leave them out.

  3. Copy or download

    Copy the Markdown or download it. The Preview tab shows the result with its images.

Word to Markdown, before and after

The sample report as Microsoft Word for Mac shows it, and the Markdown the converter makes of it with the default settings. Click Sample above to convert the same file.

The sample .docx in Microsoft Word
The Field Notes pilot report in Microsoft Word: a title, two headings, bold and italic text, a link, a bulleted list, a table and a numbered list.
Markdown
# Field Notes Pilot Report

Twelve researchers used the **Field Notes** app for six weeks in three regions. This report sums up what worked, what did not, and what we change next. The full data set is on the [project page](https://example.com/pilot).

## Results

Notes were recorded offline *87 percent* of the time, and every note reached the server within a day.

- Average sync time fell from 40 seconds to 12 seconds
- No notes were lost during the pilot
- Photo uploads used most of the mobile data

| Region | Researchers | Notes |
| ------ | ----------- | ----- |
| Coast  | 4           | 1,210 |
| Hills  | 5           | 1,654 |
| Valley | 3           | 890   |

## Next steps

1. Compress photos before upload
2. Add a map of each day's notes
3. Start the second pilot in May

What it handles

Word styles become Markdown
Title, Subtitle and Heading 1 to 6 become Markdown headings, and the Quote and Code styles become quotes and code.
Lists and tables
Bulleted and numbered lists keep up to five levels of nesting, and tables become pipe tables with a header row.
Images kept
Pictures are saved in an images folder next to the Markdown, or embedded in it as data URLs.
Links, footnotes and emphasis
Links, footnotes, bold, italics and single strikethrough come through, and empty paragraphs are dropped.
Any editor's .docx
A .docx saved by Word, Google Docs, LibreOffice, Pages or WPS Office opens. Quotes and code are found by Word's style names, so another editor's quote and code styles can come out as plain text.
Stays on your device
The document is read in your browser, so confidential files never leave your computer.

What each part of a Word document becomes in Markdown

Word formatting is read from the styles in the file. The table shows the Markdown you get and how each part is recognized.

In WordMarkdownHow it is read
Headings
# Report title
## Results
From the paragraph style: Title becomes #, Subtitle ##, and Heading 1 to Heading 6 become # to ######. Text that is only large or bold stays a paragraph
Bold and italic
**bold** *italic*
Kept
Strikethrough
~~old price~~
Single strikethrough is kept; double strikethrough becomes plain text
Underline, color, highlight
underlined text
The text is kept without the formatting
Superscript and subscript
H2O
The text is kept without the raised or lowered position
Links
[project page](https://example.com/pilot)
Web links are kept; links to bookmarks inside the document lose their target
Lists
- Item
  - Nested item
1. Step
Bulleted and numbered lists, nested up to five levels; lettered and Roman numbering is written as 1., 2.
Check boxes
- [x] Done
- [ ] To do
Check box controls at the start of a list item
Tables
| Region | Notes |
| ------ | ----- |
| Coast  | 1,210 |
Pipe tables. The header is the row marked to repeat, or else the first row; merged cells keep their text in the first cell, and cell alignment is not kept
Images
![Map](images/image-1.png)
Saved as files in a .zip, embedded in the Markdown, or left out, as you choose
Footnotes
Text[^1]

[^1]: Note.
Footnotes and endnotes both become Markdown footnotes, with the endnotes numbered after the footnotes
Quotes
> Quoted text
From the Quote and Intense Quote styles
Code
```
npm run build
```
From the Code, HTML Code and HTML Preformatted styles; text that is only set in a monospaced font stays plain
Equations
—
Removed; the words around them stay
Comments and tracked changes
—
Comments are removed; tracked changes come out as if all of them were accepted
Headers, footers, page breaks
—
Removed

Convert Word to Markdown from the command line

Pandoc

--extract-media saves the pictures in a media folder and links them from the Markdown.

pandoc report.docx -t gfm --extract-media=. -o report.md

JavaScript

mammoth reads the .docx as HTML, and Turndown writes that HTML as Markdown.

import mammoth from "mammoth";
import TurndownService from "turndown";

const { value: html } = await mammoth.convertToHtml({ path: "report.docx" });
const markdown = new TurndownService({ headingStyle: "atx" }).turndown(html);

MarkItDown

Microsoft's MarkItDown converts Word, PDF and PowerPoint files for language models.

pip install 'markitdown[docx]'
markitdown report.docx -o report.md

Questions and answers

How do I convert a Word document to Markdown?

Open the .docx file above and copy or download the Markdown on the right. Choose Separate files to get the pictures too, as a .zip with the Markdown and an images folder.

What happens to the images?

With Separate files, each picture is saved as images/image-1.png and so on, and the .zip holds the Markdown and the folder. Inside the Markdown embeds them as data URLs in one file, and Leave out drops them.

Can I convert a .doc file?

Not directly. .doc is Word's older binary format; open it in Word, LibreOffice or WPS Office, save it as .docx and open that here.

Why is some formatting missing?

Markdown has no syntax for colors, fonts, underline or page layout, so those are dropped, and comments are left out. Headings, lists, tables, links and emphasis are kept.

How do I convert a Google Doc?

Download it with File → Download → Microsoft Word (.docx) and open it here, or copy the text into the Rich Text to Markdown converter.

Is my document uploaded anywhere?

No. The conversion runs in your browser, so the document never leaves your device.