Text File Merger
Plain text, CSV, Markdown, logs, anything that is text. Sorted by filename.
The merger joins several text files into one and hands the result back as a download. Files are read in your browser and never uploaded. The two options that matter in practice are sorting by filename, so the order is predictable, and dropping repeated header rows when the files are CSV exports.
How it works
Files are read with the browser file API and concatenated in filename order, compared with natural number ordering so part2 comes before part10. Operating systems hand files to a web page in whatever order they happen to list them, which is why sorting explicitly matters.
- Four separators between files: nothing, a blank line, a heading with the filename, or a horizontal rule.
- Ending every file with a newline prevents the last line of one file running into the first line of the next, the most common way a merge silently corrupts a row.
- Dropping repeated headers compares the first line of each file with the first line of the first file, and removes it when they match. That is what turns twelve monthly CSV exports into one valid file.
- Windows line endings are normalised to plain newlines, so files from mixed sources merge consistently.
Files above 5 MB are refused. A browser tab can hold them, but the preview and the merge become unresponsive, and a command-line concatenation is the honest answer at that size.
Examples
Twelve monthly CSV exports
Files
sales-01.csv through sales-12.csv
Drop headers
On
Result
One file, 11 headers dropped
The first file keeps its header row and the other eleven lose theirs, which is exactly what a valid combined CSV needs.
Filename ordering
Files
part2.txt, part10.txt, part1.txt
Result
Merged as part1, part2, part10
Natural number ordering. A plain alphabetical sort would put part10 before part2, which is the wrong order for numbered parts.
A file with no trailing newline
Files
Two logs, the first not ending in a newline
Result
A newline added, so the last line stays on its own line
Without it, the last line of the first file and the first line of the second become one corrupted line.
Frequently asked questions
Are my files uploaded anywhere?
No. They are read locally with the browser file API and joined in the page. Nothing is sent over the network, which matters because the files people most often need to merge are exports containing customer or financial data.
In what order are the files merged?
By filename, using natural number ordering, so part2 sorts before part10. The list shown above the options is the actual merge order. Check it before downloading if order matters.
How does dropping repeated headers work with CSV?
The first line of each file after the first is compared with the first line of the first file. Where they match exactly, that line is removed. Files with different column orders will not match and their headers stay, which is the safe behaviour.
What is the file size limit?
Five megabytes per file. Beyond that a browser tab becomes unresponsive when rendering and merging. For larger files use cat on macOS or Linux, or Get-Content on Windows PowerShell.
Can I merge files of different types?
Any text format works.txt.csv.md.log.json. Whether the result is meaningful is a different question: merging two JSON files by concatenation produces something that is not valid JSON. It joins text; it does not understand formats.