Merge Markdown Files
Quick answer
To merge Markdown files online, add up to 5 .md files below, drag them into order and click Merge and Download. The tool joins them, in order, into one .md file in your browser. Each file's content, including any front matter, is kept exactly as written.
Click here or Drop files to upload
How to use it
- 1 Save each chapter or section as its own .md file, numbered in reading order (01-intro.md, 02-setup.md…).
- 2 Add the files and check the order in the list; drag any file that is out of place.
- 3 Click Merge and Download to get merged-file.md, then convert it with Pandoc or import it into Google Docs.
What to expect
- Files are joined with a line break between them; nothing inside a file is changed.
- YAML front matter at the top of later files is kept as text. Remove it if you convert the result.
- Relative image paths still point to the original locations, so keep the images next to the merged file.
Frequently asked questions
How do I turn the merged Markdown into a PDF?
Run pandoc merged-file.md -o merged.pdf (needs a LaTeX engine), or import the file into Google Docs with File > Open > Upload and choose File > Download > PDF.
Can I merge more than 5 Markdown files?
Not in one run here. Merge in batches, or concatenate on the command line, for example with pandoc or cat.
Will heading levels stay the same after merging?
Yes. Each file's # and ## headings are copied as written, so a file that starts with # becomes a new top-level section in the merged file.
How do I keep a table of contents after merging Markdown?
Convert the merged file with pandoc --toc, or import it into Google Docs and insert a table of contents there.
Related guides
- How to Open and Edit Markdown (.md) Files in Google Docs To open a Markdown file in Google Docs, upload the .md file to Google Drive and double-click it. It opens in Markdown Mode, with an .md tag next to the title, and stays an .md file. To only read it, right-click the file in Drive and choose Open with > Preview.
- How to Merge Markdown Files and Convert to PDF To merge Markdown files and convert them to PDF, run pandoc 01.md 02.md -o merged.pdf, or upload the .md files to Google Drive and merge them with Merge Docs Pro with Save merged Docs as PDF ticked. Google Docs can also open and export single Markdown files, and a free online merger joins .md files.
- How to Convert Google Docs to LaTeX (Overleaf-Ready) Google Docs has no LaTeX export, so convert in two steps. Choose File > Download > Microsoft Word (.docx) or Markdown (.md), then run Pandoc: pandoc mydoc.docx -s -o mydoc.tex --extract-media=. The .docx route keeps headings, lists, tables, images and equations. Finally, open the .tex file in Overleaf and tidy the formatting.
- How to Convert LaTeX to Google Docs (Files and Equations) Google Docs can't open .tex files, but you can get LaTeX into a Doc two ways. For a whole document, convert it with Pandoc (pandoc paper.tex -o paper.docx) and open the .docx in Google Docs. For individual formulas, use the built-in equation editor, or an add-on such as Auto-LaTeX Equations to render LaTeX code.