<link rel="stylesheet" type="text/css" href="/mirawhite.css">

Merge text files into one

Drop your text files, put them in order and choose what goes between them: preview the result, then download a single .txt file. Free, and nothing is uploaded.

Free, no sign-up, no limit Runs in your browser: your text and files are never sent or saved.

Merge text files

Drop your text files here (several at once if you like).

Files are merged in your browser: nothing is uploaded.

Options
Line endings

How to use it

  1. Drop several text files or choose them (.txt, .md, .csv, .log).
  2. Set the order with the arrows or sort by name, then choose the separator and the line endings.
  3. Check the preview and download the merged .txt file.

Example

Input

chapter-1.txt:
It was a quiet morning.
The café was still empty.

chapter-2.txt:
Then the phone rang.

Output

It was a quiet morning.
The café was still empty.

Then the phone rang.

Good to know

  • Each file is read as UTF-8 if valid, otherwise as Windows-1252 (old Notepad or Excel files); other encodings may show wrong accented letters.
  • Line endings are unified (LF or CRLF) and the blank lines at the end of each file are dropped, so the separator is always the same.
  • CSV files are joined as plain text: header lines are repeated. To combine columns, use the CSV merge tool.
  • Binary files (Word, PDF, images) are refused.

Frequently asked questions

How do I merge text files into one?

Drop the files here (several at once), set their order with the arrows or “Sort by name”, choose what goes between them, then download merged.txt. A blank line separates the files by default, and the preview shows the result first.

How do I merge text files with the command prompt?

On Windows, copy /b *.txt merged.txt glues the files in name order; on a Mac or Linux, cat *.txt > merged.txt does the same. But a file without a final line break runs straight into the next one, and mixed encodings or line endings stay mixed.

Can I put the file name between each file?

Yes: under “Between files”, choose “The file name as a heading”. You can also choose nothing, a blank line, a line of dashes, or your own line such as “### {name}”. Blank lines at the end of each file are removed, so the gap is always the same.

Why do accented letters look wrong after merging?

Each file is read as UTF-8 when valid, otherwise as Windows-1252, the encoding of old Notepad and Excel files on Windows. Files in another encoding may show wrong letters; open them in a text editor and save them as UTF-8 first.

Should I pick LF or CRLF line endings?

LF suits Mac, Linux and the web; CRLF is the Windows convention, needed by some older Windows programs. Recent Notepad reads both. Every line of the merged file uses the ending you choose, whatever the source files used.

Can I merge text files into a PDF or Excel?

Not directly: the result is a .txt file. Open it in a text editor or a browser and print to PDF to get a PDF. For CSV files whose columns must line up in Excel, use the CSV merge tool, which matches columns by title instead of repeating headers.

← Back to all tools