There are two families of solutions for combining Markdown files: free online tools
like MergeMarkdown, and command-line approaches (cat, pandoc, or a short
Python script). Both produce a merged .md file, but they suit different people
and different jobs. This page compares them honestly so you can pick in ten seconds.
Quick comparison
| Dimension | Online tool (MergeMarkdown) | cat *.md |
pandoc |
Python script |
|---|---|---|---|---|
| Learning curve | None — open and use | Basic shell | Medium — flags & formats | Needs Python basics |
| File ordering | Drag-and-drop sorting | Alphabetical (glob) only | Manual file order | Whatever you code |
| Live preview | Yes, rendered HTML | No | No (convert to check) | Only if you build it |
| Separators | Built-in --- / blank line |
Manual (echo) |
Manual | Whatever you code |
| Format conversion | Markdown only | No | Yes (md→pdf/docx/html) | With libraries |
| Privacy | 100% local in browser | Fully local | Fully local | Fully local |
| Best for | Quick merges, sorting, preview | Fast concat on a server | Publishing pipelines | Automation & custom rules |
The command-line options up close
The fastest shell method is concatenation: cat intro.md install.md api.md > combined.md.
It is instant and scriptable, but the order is whatever you type (or alphabetical with
cat *.md), there is no separator unless you add one yourself, and there is no preview —
you open the result in an editor to check it. pandoc is the power tool:
pandoc ch1.md ch2.md -o book.docx merges and converts to Word, PDF, or HTML in one
step, which makes it ideal for publishing pipelines and CI jobs. A Python script
(pathlib.Path.read_text in a loop, joined with a separator string) shines when you need
custom rules — skipping drafts, rewriting image paths, or injecting front-matter —
and it can run unattended on a schedule.
When to choose the online tool
Choose MergeMarkdown when the job is interactive and visual: you have a handful of files, the order matters, and you want to see the rendered result before downloading. Typical cases are assembling a README from parts, combining meeting notes, merging chapters once before sending to an editor, or working on a computer where you cannot install software. Sorting by drag and drop plus instant preview saves more time than typing shell commands for one-off merges, and browser-local processing means there is no privacy trade-off.
When to choose the command line
Choose cat, pandoc, or Python when the merge is repeatable or huge: nightly docs
builds, CI pipelines that assemble changelogs, converting Markdown to PDF/Word, or
repositories with hundreds of files. If the same merge runs weekly, a one-line shell
command or a Makefile target beats opening a browser every time. Developers who already
live in the terminal will also prefer aliases and scripts they can version-control.
Bottom line
One-off merge with sorting and preview → online tool. Repeatable, automated, or
format-converting pipeline → command line. Many teams use both: draft and reorder
visually in the browser, then automate the stable process with pandoc or Python
once the structure stops changing.