Split & Merge CSV and Text FilesBy Lines, Size, or Parts

Cut a big CSV, log, or text file into smaller files by line count, size, or equal parts, or join several files into one. Handles CSV headers, encodings, and line endings.

Your input is never sent anywhere.

Details

Files are split and merged in your browser. Nothing is uploaded to a server.

Encoding and Line Endings

Input file encoding

Output file encoding

Output line endings

Auto-detect reads the file as UTF-8 and falls back to Windows-1252 if the bytes are not valid UTF-8. If text looks garbled, pick the input encoding yourself.

Drag and drop a CSV or text file here

.txt, .csv, .log, .tsv, .json, and .md files

Each file is loaded into browser memory in full. Files of several hundred MB or more may run slowly.

Split Large CSV and Log Files, or Merge Several Into One

Server logs and exported CSV files often grow past what an upload form, an email, or a spreadsheet can take. This tool cuts one file into smaller files, and you choose how: a fixed number of lines per file, a maximum size per file, or a set number of equal parts. Each piece keeps whole lines, so no record is cut in half.

It also works in the other direction. Drop in daily logs or CSV exports from several sources, put them in order, and download them as a single file. For CSV, you can repeat the header row at the top of every split file, or remove the repeated header rows when merging.

The tool works on files, not pasted text, and it has no fixed file size limit of its own. Each file is read into your browser's memory, and all processing happens in the browser tab. Nothing is sent to a server.

When You Need to Break Up or Combine Files

A file is over an upload or email limit

A system, form, or mail service rejects your CSV or log because of its size. Split it by size so each part stays under the limit you enter.

A CSV is too big for Excel

An Excel worksheet holds up to 1,048,576 rows, header included. Split the export by lines so each part fits, then open the parts one at a time.

Daily logs or exports need to become one file

Merge a week of access logs or a set of regional CSV exports into one file for analysis. Reorder the files first, and remove repeated header rows if they are CSVs.

The file shouldn't be uploaded to a website

Logs and data exports can hold customer or internal information. This tool reads and writes the files in your browser, so the contents are not sent anywhere.

How to Split a File or Combine Several (5 Steps)

  1. Open the Split tab to cut one file apart, or the Merge tab to join several.
  2. Set the input encoding, output encoding, and line endings. The defaults (Auto-detect in, UTF-8 out, LF) work for most files.
  3. To split: drop in one file, pick By lines, By size, or Equal parts, and enter the value. Check the header option for CSV files.
  4. To merge: add the files, order them with the arrows, choose what goes between files, and click Merge Files.
  5. Check the result and the preview, then download the files one by one or as a ZIP (split) or as one file (merge).

Note: Files are processed in your browser and are not uploaded.

Limits and Behavior to Know About

  • The tool works on lines, not CSV fields. It does not read quotes, so a quoted cell that contains a line break can be cut across two files.
  • Auto-detect reads the file as UTF-8 and falls back to Windows-1252 if the bytes are not valid UTF-8. If the text still looks wrong, choose the input encoding yourself.
  • Windows-1252 output cannot store characters outside that character set. They are replaced with "?", and the tool shows how many were replaced. Use UTF-8 output to keep them.
  • Any line break style in the input (LF, CRLF, or CR) is read as one line break. The output uses the line ending you choose, and every file ends with a line break.
  • Each file is loaded into memory in full, so very large files (several hundred MB or more) can be slow or fail on devices with little memory.

Lines vs. Size vs. Equal Parts: Which Split to Pick

Pick the method that matches the limit or the goal you are working with.

MethodWhat you enterBest for
By linesLines per file (for example, 100,000)Staying under a row limit, or batching records in fixed groups
By sizeMaximum size per file, in KB or MBUpload caps and email attachment limits
Equal partsNumber of files (2 to 100)Dividing the work evenly among several people or processes

Fixing Common CSV Split and Merge Problems

Where splits and merges usually go wrong, and the option that handles each case.

Keeping column names in every split file

A CSV usually has a header row with column names on line 1. If you split by line count alone, only the first file has it. Turn on Repeat the first line (CSV header) at the top of every file and the header is copied to the top of each part, so each file can be opened and imported on its own.

Removing repeated headers in a merged CSV

If every CSV you merge starts with the same header, the combined file has that header again at each seam. With Remove repeated header rows on, the tool deletes the first line of the second and later files when it exactly matches the first line of the first file. A header that differs even by a space or a letter is kept.

Why size-based splits never cut a line in half

By size, the tool adds lines to a file one at a time and starts a new file when the next line would push it over your limit. Splits only happen between lines, so a record is never broken. A single line larger than the limit ends up alone in its own file.

Encodings, BOM, and garbled text

Most files today are UTF-8. Older Windows exports are often Windows-1252, which is why é can turn into a garbled symbol when the wrong one is used. A BOM is a few bytes at the start of a UTF-8 file. Some versions of Excel use it to recognize UTF-8, so choose UTF-8 with BOM as the output if a CSV opens garbled in Excel.

CSV cells that contain line breaks

A quoted cell such as an address with a line break inside is still one CSV record, but the tool sees two lines. A split can land inside it. If your file has multi-line cells, open the output files and check the split points, or use a tool that understands CSV quoting.

Common Problems and How to Fix Them

Only the first split file has column names

You split a CSV by lines, and the second and later files start straight with data, so you can't tell which column is which.

💡 See the solution▼
Check "Repeat the first line (CSV header) at the top of every file" and split again. The first line of the original file is copied to the top of every part.

The merged CSV has header rows in the middle

You merged exports that each start with a header row, and the headers now appear at every seam, which skews sums and imports.

💡 See the solution▼
Turn on "Remove repeated header rows" and merge again. The first line of later files is removed when it matches the first file's first line exactly.

Accented letters show up as strange symbols

Characters like é, ñ, or ü appear as � or as two odd characters, because the input was read with the wrong encoding.

💡 See the solution▼
Switch the input encoding between UTF-8 and Windows-1252 and run it again. One of them shows the text correctly.

The output opens garbled in Excel

The split or merged CSV looks fine in a text editor, but accented or non-English characters are garbled when you open it in Excel.

💡 See the solution▼
Set the output encoding to "UTF-8 with BOM" and download again. If you only need Western European characters, "Windows-1252" also works.

Some characters turned into question marks

You chose Windows-1252 output, and characters it cannot store, such as emoji or non-Latin text, were replaced with "?".

💡 See the solution▼
Switch the output encoding to UTF-8 or UTF-8 with BOM. The tool shows a warning with the number of replaced characters whenever this happens.

Questions About Splitting and Merging Files

Q.How do I split a large CSV file into smaller files?

Q.

A. Open the Split tab, drop in your file, and choose "By lines". Enter how many lines each file should hold and click Split File. Every file gets that many lines, except the last one, which may be shorter. If the first row holds column names, check "Repeat the first line (CSV header) at the top of every file" so each part keeps its headers.

Q.Can I split a file so each part stays under a size limit, such as an email attachment or upload cap?

Q.

A. Yes. Choose "By size" and enter a limit in KB or MB (1 KB is 1,024 bytes). The tool adds lines to a file until the next line would go over the limit, then starts a new file, so a line is never cut in half. The count includes the repeated header and the BOM if you use them, and it uses your chosen output encoding and line endings. A file only goes over the limit if a single line is larger than the limit by itself.

Q.How do I split a file into a set number of equal parts?

Q.

A. Choose "Equal parts" and enter the number of files (2 to 100). The lines are shared out evenly. When the line count does not divide evenly, the first files get one extra line each. If the file has fewer lines than the number of parts you ask for, you get fewer files, because empty files are skipped.

Q.How do I merge several CSV files without repeating the header row?

Q.

A. Open the Merge tab, add your files, and arrange them with the arrow buttons. Then check the option to remove repeated header rows. For the second file onward, the tool deletes the first line only when it is identical to the first line of the first file. Files whose first line differs are left untouched.

Q.Why do accented letters or symbols look garbled, and how do I fix it?

Q.

A. The file was read with the wrong encoding. Input is set to Auto-detect by default, which tries UTF-8 first and falls back to Windows-1252. If the result still looks wrong, select UTF-8 or Windows-1252 yourself and run it again. If the problem is in Excel after you open the output, try "UTF-8 with BOM" as the output encoding. Some versions of Excel need the BOM to recognize UTF-8 in a CSV file.

Q.Will it break CSV files that have line breaks inside quoted cells?

Q.

A. It can. The tool splits and counts plain lines and does not read CSV quoting. A cell that contains a line break counts as more than one line, so a split can land in the middle of that cell. For files like that, use a CSV-aware tool, or check the split points in the output files.

Q.What line endings do the output files use?

Q.

A. The tool reads LF, CRLF, and old-style CR line breaks. Output uses the one you select: LF (the default) or CRLF. Every output file ends with a line break after its last line.

Q.Are my files uploaded anywhere?

Q.

A. No. Reading, splitting, merging, and building the ZIP all run as JavaScript in your browser tab, and the file contents are not sent to a server. Large files are loaded into memory in full, so very big files (several hundred MB or more) may be slow, depending on your device and browser.

User Feedback & Request

Your feedback
makes this tool better.

Tell us which features you'd like, what should be fixed, or which new tool you'd like to see. An engineer reads every submission and uses it to guide development.

Send feedback