# Markdown Merger

Merge multiple markdown files with smart header level adjustment and table of contents generation

> Canonical page: https://elysiatools.com/en/tools/markdown-merger

- **Category:** Data Processing

- **Keywords:** markdown, merge, combine, md, documentation, files

## Overview

The Markdown Merger is a professional utility designed to combine multiple markdown files into a single, cohesive document while maintaining structural integrity through intelligent header adjustment and automated table of contents generation.

## Inputs

- **Markdown Files** (file): Select markdown files to merge...
- **Merge Strategy** (select)
- **Header Handling** (select)
- **Generate Table of Contents** (select)
- **Preserve Internal Links** (select)
- **Add File Headers** (select)

## When to use

- Consolidating fragmented project documentation into a single master guide.
- Merging individual chapter files into a unified technical manual or ebook.
- Standardizing header hierarchies across multiple markdown files before publishing.

## How it works

- Upload your markdown files and select your preferred merge strategy.
- Choose a header handling option to automatically adjust or flatten nesting levels.
- Enable the table of contents generation to create a navigable document structure.
- Process the files to receive a single, unified markdown document ready for export.

## Use cases

- Compiling technical API documentation from separate module files.
- Merging collaborative writing drafts into a single manuscript.
- Aggregating daily meeting notes into a monthly summary report.

## Frequently asked questions

### Can I merge files with different header levels?

Yes, the 'Smart' merge strategy automatically adjusts header levels to ensure the final document maintains a logical hierarchy.

### Does the tool support internal link preservation?

Yes, the tool includes an option to preserve internal links, adjusting them if necessary to ensure they remain functional in the merged file.

### How many files can I merge at once?

You can upload up to 10 files simultaneously for a single merge operation.

### Can I add a table of contents automatically?

Yes, simply toggle the 'Generate Table of Contents' option to 'Yes' to include a dynamic TOC at the top of your merged file.

### What happens to the original file names?

You can choose to 'Add File Headers' to include the original filename as a section header, helping you track the source of each segment.

## Related tools

- [TXT File Merger](https://elysiatools.com/en/tools/txt-merger): Merge multiple text files with various strategies (concatenate, interleave, etc.)
- [AI Markdown Article Translator](https://elysiatools.com/en/tools/ai-markdown-article-translator): Translate full Markdown articles with AI while preserving headings, tables, links, images, and code blocks for direct publication
- [JSON File Merger](https://elysiatools.com/en/tools/json-merger): Merge multiple JSON files with various merging strategies (deep merge, overwrite, combine arrays, etc.)
- [Markdown Report Bundler](https://elysiatools.com/en/tools/markdown-report-bundler): Bundle multiple Markdown files into a single PDF report
- [Markdown to PDF Converter - Markdown转PDF转换器](https://elysiatools.com/en/tools/markdown-to-pdf-converter): Convert Markdown files to PDF documents with proper formatting, syntax highlighting, and styling
- [PDF to Markdown Converter](https://elysiatools.com/en/tools/pdf-to-markdown): Convert PDF documents to Markdown format with text extraction and formatting preservation
- [YAML File Merger](https://elysiatools.com/en/tools/yaml-merger): Merge multiple YAML files with various strategies (deep merge, overwrite, combine arrays, etc.)
- [Encrypted PDF Converter](https://elysiatools.com/en/tools/encrypted-pdf-converter): Open password-protected PDFs with OpenDataLoader and export them as Markdown, JSON, or text once the correct password is provided

## Samples

- [Markdown Viewer Samples](https://elysiatools.com/en/samples/markdown-viewer-samples): Sample Markdown files for README preview, documentation rendering, and rich-text markup tests
- [Markdown Samples](https://elysiatools.com/en/samples/markdown-samples): Markdown format examples from simple to complex document structures
- [Markdown Slide Deck Samples](https://elysiatools.com/en/samples/md-slide-deck-to-pdf): Remark/Marp style Markdown slide decks for testing PDF export layouts
- [PDF Samples](https://elysiatools.com/en/samples/pdf-samples): Generated PDF samples from tools dated 2026-02-01 to 2026-02-10

## Related content

- [Documentation Authoring, Review, and Publishing](https://elysiatools.com/en/hubs/documentation-authoring-publishing): Extract source material from code, PDF, or HTML, then assemble, review, preview, and export a publishable documentation set.
- [Markdown Writing and Publishing Workflow](https://elysiatools.com/en/hubs/markdown-utility): Clean Markdown structure, review links, merge files, preview the result, translate articles, and export publishable HTML, PDF, slide, text, or JSON deliverables.
