Pandoc download and guide — convert Markdown and Word

Last content update 2026-11-06
QUICK ANSWER
Follow the official installation instructions for your OS and use Pandoc in a terminal. Check installation with pandoc --version in a new terminal rather than looking for a GUI window. For Markdown to Word, specify the input format, output format and a separate output filename, then open the DOCX to compare it. Basic DOCX conversion needs no PDF engine, while PDF output requires a separate engine.
Pandoc
Software
Official project John MacFarlane · Pandoc
Interface Terminal and command line
Platforms Windows, macOS, Linux and others
License Open-source GPL
Basic example Markdown → DOCX
PDF output Requires a separate PDF engine such as LaTeX
Official Pandoc installation guide ↗

Choose an official installation method

Pandoc is a command-line tool that converts document files between formats. Instead of opening an editor window, you run it in a terminal with input and output filenames. It can prepare a document for Word, but does not reproduce every detail of page layout.

Use the official installation guide in the infobox and choose the method for your OS.

EnvironmentBasic official installation choices
WindowsOfficial MSI installer; check ZIP and PATH conditions if using a separate folder
macOSOfficial installer package or a documented package manager
LinuxDistribution package or official release matching your CPU

The official Windows installer adds the executable location to PATH. Extracting a ZIP and making pandoc discoverable in a terminal are separate steps. Multiple installation methods can leave different versions installed, so first identify the method you are using.

Check the version and open the document’s folder

After installation, open a new PowerShell or Command Prompt and enter this command. The same version command works in a Mac or Linux terminal.

pandoc --version

Version output means the command was found. If it is not recognized, check installation and PATH, then open a new terminal.

For your first conversion, use the folder containing the input document as the working directory. Navigate to it in the terminal, or open that folder in an editor and use its terminal. VS Code can edit and preview documents but is not required to run Pandoc.

Pandoc uses UTF-8 for text input and output. Save Markdown as UTF-8, and do not assume PowerShell and Command Prompt have identical command or encoding settings. For Korean text display in an older Windows Command Prompt, also check the official getting-started guide’s UTF-8 conditions.

Make your first Word document from Markdown

Create a small original sample.md in an empty practice folder.

# Preparation document

## Checklist

- Check the filename
- Open the output document

| Item | Status |
| --- | --- |
| Materials | Ready |

Run this command from the input folder. If sample-check.docx already exists, choose a new name to avoid overwriting it.

pandoc -f markdown -t docx "sample.md" -o "sample-check.docx"
PartMeaning
-f markdownRead the input as Markdown
-t docxWrite Word DOCX output
"sample.md"Actual input filename
-o "sample-check.docx"Separate output filename

Quote filenames and paths containing spaces. The original .md and output .docx are different files. After running the command, open the DOCX in an actual editor and check the heading, list, table and text, including any Korean text you added. Creating an output file does not establish that all formatting is identical.

Check images, the working directory and input paths

A Markdown image reference such as images/sample.png needs the actual image file. Pandoc’s default resource search is based on the current working directory. Providing an absolute document path from another folder can therefore change where it looks for images.

Begin by converting from the document’s folder and checking images in the DOCX. If you must run from another folder, specify image search paths with the manual’s --resource-path. Separate multiple paths with semicolons on Windows and colons on Mac or Linux. When specifying this option, explicitly include the current directory if it also needs to be searched.

After changing an image path or filename, convert to a new output name and compare again. Archive referenced images together with the .md file.

Convert Word back to Markdown

To move a DOCX you created into Markdown, reverse the input and output formats. For a document containing images, also extract media into a separate new folder.

pandoc -f docx -t markdown "sample-check.docx" -o "restored.md" --extract-media="restored-assets"

Choose new names if restored.md or restored-assets already exists. A document without images may have no media to extract. For images, check both the generated Markdown references and files in the extracted folder. Moving only the folder or only the Markdown can break those references.

DOCX margins, page layouts and complex tables do not map exactly to Markdown. Preserve the original DOCX and compare headings, body, tables and images before using a copy. Before reading it in Obsidian, also check the standard Markdown file and attachment paths.

Distinguish PDF engines and conversion direction

Producing PDF and reading PDF to create another format are different capabilities.

TaskConditions
Markdown → DOCXNo PDF engine required for basic conversion
Markdown → PDFDefault method requires a LaTeX engine; check --pdf-engine for alternatives
PDF → Word or MarkdownPDF is absent from the current official input-format list
OCR on scanned images or PDFsOutside these document-conversion examples

PDF output can require additional setup for the selected engine, fonts and content. You do not need to install a LaTeX environment just to convert to Word. For ordinary PDF export through a GUI, first check Typora’s native export conditions.

When a command or output fails

SymptomCheck in order
pandoc command not foundInstallation → new terminal → PATH and duplicate installations
Input file not foundWorking directory → exact name and extension → quotes around paths with spaces
Images missingActual files → relative paths from the working directory → resource-path
PDF engine not foundDOCX versus PDF goal → installation and requirements of the selected PDF engine
Word layout differs from the sourceDocument structure and format differences → complex tables, margins and output pages

Identify whether the error names an input file, output format or engine. Once the result is checked, keep the original and any required image files together.

Official sources

Frequently asked questions

Why is there no app window after installing Pandoc?
Pandoc is a command-line tool with no built-in GUI. Open a new PowerShell, Command Prompt or terminal and run pandoc --version. Check for version output instead of an application window.
Do I need an editor extension to convert Markdown to Word?
You can run Pandoc directly in a terminal without a VS Code extension. Specify the input .md and output .docx, and check the working directory and image paths.
What else is needed to create PDFs?
Official guidance requires a LaTeX engine for default PDF output. Check --pdf-engine requirements for other engines. Converting Markdown to DOCX does not require a PDF engine.
Can Pandoc convert PDF to Word or perform OCR?
The current official input-format list does not include PDF. PDF output support differs from reading PDF as input. Do not assume this tool converts PDF to Word or performs OCR on scanned PDFs.
Why are images missing after converting Word to Markdown?
Check --extract-media to extract DOCX images into a new folder. Keep the generated Markdown image references together with the extracted files and compare a copied result.
Will the exact Word page layout be preserved?
Pandoc converts document structure and does not guarantee perfect conversion between every format. Margins, page layout and complex tables may change, so open the actual output to check it.