Merge Text Files Without Broken Encoding (UTF-8 vs EUC-KR)

Contents
When you need to merge a novel manuscript split across several files, dev logs broken up by date, or scattered CSV files into one, opening each file and copying and pasting is tedious — and it's easy to end up with the pieces in the wrong order.
It's worse if the source files are saved in a legacy Korean encoding such as EUC-KR, because the characters stay broken even after you merge them. This post covers how to merge text files safely and the encoding issues to check before you start.
What goes wrong when you merge text files by hand
Once you have more than three or four files, just keeping them in order, adding a separator between them (a blank line or a divider), and noting the filename somewhere takes real effort. Dropping a file or pasting them in the wrong order happens all the time.
How text files get merged into one
A browser-based text merging tool reads each file with File.text(), turns it into a string, puts your chosen separator between the pieces, and joins them with join() on a JavaScript array. The file data stays in browser memory and is never sent to an external server.
The order files get merged in
If your files are named 1.txt, 2.txt, and 10.txt, the file picker in your OS or browser may list them alphabetically and hand them over as 1.txt → 10.txt → 2.txt. Most of these tools merge files in the order they were selected and don't fix the order for you, so it's safer to check the order in the uploaded file list by eye or to pad the names to the same length, like 01 and 02.
Merge without opening and pasting by hand. With Text Files Merger, you upload your files, pick a separator and header option, and the whole process finishes right in your browser.
Upload the text files you have, choose the merge order and the delimiter between files, then put them together into a single merged document you can download.

Why Korean text breaks: UTF-8 and EUC-KR
The main reason Korean text looks garbled when you merge text files is that the character encoding used to save the file differs from the one used to read it.
- UTF-8: The current web standard and the default encoding on Linux and macOS. It handles each Korean character as a variable-length 3 bytes.
- EUC-KR / CP949: A Korean encoding common in older Windows programs. It handles each Korean character as a fixed 2 bytes.
If you read a file saved in EUC-KR using UTF-8 rules, the byte boundaries don't line up and the characters come out garbled.
If the text is still broken after merging
The browser's File.text() reads files as UTF-8. If the source was saved in EUC-KR, this tool and most other browser-based text tools will still show that part as garbled after merging. The tool doesn't correct the encoding for you, so open the file in a text editor, use "Save As" to change the encoding to UTF-8, save it again, and then upload it — it will merge without garbling.
The actual merge options: separator, file header, whitespace cleanup
| Option | What it does |
|---|---|
| Separator format | One blank line (default), no separator, ---, or a custom string |
| Add file header | Puts a line with the filename above each file (on by default) |
| Trim whitespace on each line | Cleans up leading and trailing whitespace on every line |
| Remove blank lines | Deletes only lines with no content |
The merged result appears right away in the on-screen preview, and you can copy it or download it as a .txt file.
Common snags
| Symptom | Cause |
|---|---|
| Files end up out of order | The file picker hands them over in alphabetical order |
| Only some Korean text is garbled after merging | Only that file was saved in a different encoding, such as EUC-KR |
| You can't see where one file ends and the next begins | The separator is set to "none" or the file header is turned off |
Summary
- Merging text files is a simple matter of reading each file and joining them with a separator, but doing it by hand means matching up the order and separators every time.
- Garbled Korean text usually comes from a source file saved in EUC-KR. The fix isn't the merging tool — it's setting the encoding to UTF-8 before you upload.
- Using the file header and whitespace cleanup options together keeps file boundaries and formatting intact in the merged result.
Upload the text files you have, choose the merge order and the delimiter between files, then put them together into a single merged document you can download.
FAQ
Are the files I upload sent to a server?
No. They're read and merged on your own device using the browser's File API, so file contents are never sent to an external server.
If Korean text is already garbled in a merged file, can the tool fix it?
No. The merge process doesn't convert encodings, so you need to save the original file again as UTF-8, upload it again, and merge once more.
This article was adapted from our Korean original. Read the Korean original