Paste text, a list, or a CSV and cut it into chunks of N lines, or into a set number of equal parts. Copy each chunk or download them all.
This tool runs entirely in your browser. What you enter is never sent anywhere.Your input is never sent anywhere.
DetailsInput text
Use it for bullet lists, or to wrap each line in quotes and a comma for code.
None puts a single line break between chunks. The ZIP always has one file per chunk and ignores this setting.
Paste some text to see the chunks here
Cut a long list, log, or CSV into equal groups of lines
The tool reads your text line by line and groups the lines into chunks. You can fix the number of lines in each chunk or choose the number of chunks and let it spread the lines evenly.
For CSV and similar data, it can repeat the first line, the header row, at the top of every chunk. You can also number the lines, add text before or after each line, skip blank lines, and trim spaces.
Copy a single chunk, copy everything with a separator you pick, or download one text file or a ZIP with one file per chunk. You can paste text or open a text file, and nothing is uploaded.
What people split into chunks
Lists that go in batches
Break a long list of names, emails, or IDs into groups of a set size for a form, an import, or a team that works on one group each.
Logs and text files
Cut a long log or export into pieces that are easier to open, read, and send, and download them as separate files.
Long text sent in parts
Split a long pasted text into equal parts when a message box, form, or chat only takes so much at a time.
Numbered, bulleted, and quoted lists
Number the lines, start each one with a dash, or wrap each one in quotes and a comma to get a list ready to paste into a document or code.
How to split text every N lines in 4 steps
- Paste your text into Input text, or click Open file to load a text or CSV file.
- Choose Lines per chunk or Number of chunks and enter the number.
- Optional: turn on Repeat the first line in every chunk, Skip blank lines, line numbers, or text before and after each line.
- Click Copy chunk on any chunk, or use Copy all chunks, Download all (.txt), or Download ZIP.
Note: The chunks update as you type or change a setting. The preview shows 50 chunks at a time, and Copy all chunks and the downloads cover every chunk.
How the chunks are built
- Lines: text is split at Windows, old Mac, and Unix line breaks. One line break at the very end does not add an empty line. Trimming and skipping blank lines happen before counting.
- Lines per chunk: every chunk has the number you set, except the last one, which holds whatever is left.
- Number of chunks: lines are spread as evenly as possible. When they do not divide evenly, the first chunks get one extra line each. You never get more chunks than lines.
- First line repeated: the first line is used as the header for every chunk. It is not counted in the chunk size, and it is not numbered or given the before and after text.
- Order of formatting: each line gets its number, then the Before text, then the line itself, then the After text.
- Zero-padding: the width follows the largest number used. With continuous numbering that is the total count of lines, and with restarting numbers it is the size of the biggest chunk.
Settings for common splits
Which settings to use for the jobs people ask about most. The sizes shown are examples, so use whatever fits your data.
| Goal | Settings | Result |
|---|---|---|
| Groups of 10 lines from a list | Lines per chunk: 10 | Chunks of 10, and the last one holds the rest |
| Three equal parts | Number of chunks: 3 | Lines are spread evenly, for example 10 lines become 4, 3, and 3 |
| A CSV in pieces, each with its header | Lines per chunk: 1000, Repeat the first line on | Each chunk starts with the header, then up to 1000 data lines |
| One file per chunk | Download ZIP | chunk-001.txt, chunk-002.txt, and so on |
| A numbered list that sorts correctly | Number the lines: 1., Zero-pad on | 001. , 002. , 003. and so on, equal width |
| A bullet list | Before: - (dash and space) | Every line starts with a dash |
| Quoted items for code | Before: quote mark, After: quote mark and comma | Every line becomes a quoted item ending in a comma |
| Chunks that hold only real lines | Trim whitespace and Skip blank lines on | Empty lines are not counted toward the chunk size |
Lines, not characters. The tool cuts only at line breaks. A line that is very long stays whole, so use a character-count splitter if you need pieces of a fixed length.
Private by design. Everything runs in your browser. The text you paste and the file you open are not uploaded.
Splitting CSV files, logs, and long lists without losing rows
How to choose the settings so that every line ends up in exactly one chunk, with the structure you need.
Splitting a CSV and keeping the header row
Systems that take a file in pieces usually expect each piece to start with the column names. Turn on Repeat the first line in every chunk and each chunk begins with the header row followed by up to your set number of data lines.
The tool works on lines, not on CSV cells. If a cell contains a line break inside quotation marks, that cell is cut across two lines and can land in different chunks, so remove or replace such line breaks before you split.
Fixed size or equal parts
Use Lines per chunk when a limit decides the size, and you accept a shorter last chunk. For example, 3500 lines at 1000 per chunk give chunks of 1000, 1000, 1000, and 500.
Use Number of chunks when you want fair shares, such as handing a list to a number of people. The same 3500 lines in 4 chunks give 875 lines each.
Line numbers that sort correctly
If you number lines and then sort them as text in another program, 10 and 100 come before 2, because the characters are compared one by one. Zero-pad gives every number the same width, so 002 sorts before 010.
Choose Continuous numbering when the chunks belong to one list, and Restart in each chunk when every chunk is read on its own.
Common splitting mistakes
Later CSV chunks have no header row
You split a CSV by line count and only the first chunk has the column names. The other files open with data that nobody can read, and an import may fail or map the columns wrongly.
💡 See the solution▼
A last chunk much shorter than the others
The total does not divide evenly, so the last chunk holds only a few lines. That is fine for batches, but not when you meant to give everyone a fair share.
💡 See the solution▼
Chunks of different sizes because of blank lines
Empty or whitespace-only lines are counted like any other line, so a chunk of 10 lines may hold only 7 lines of real data.
💡 See the solution▼
A CSV cell split across two chunks
A cell with a line break inside quotation marks looks like two lines to the tool, so its two halves can end up in different chunks and both files become invalid.
💡 See the solution▼
Numbers that sort as 1, 10, 100, 2
You number the lines, paste the result into another program, and sort it as text. The numbers are compared character by character, so the order breaks once you pass 9.
💡 See the solution▼
Line splitter FAQ
Q.How do I split text every N lines?
A. Paste your text, keep the mode on Lines per chunk, and enter the number of lines you want in each chunk. The chunks appear right away, in order. If the total does not divide evenly, the last chunk holds the remaining lines, so 25 lines split by 10 gives chunks of 10, 10, and 5.
Q.How do I split text into 3 (or any number of) equal parts?
A. Switch to Number of chunks and enter how many parts you want. The lines are spread as evenly as possible, and when they do not divide evenly the first chunks get one extra line, so 10 lines in 3 chunks gives 4, 3, and 3. If you ask for more chunks than there are lines, you get one line per chunk.
Q.Can I split a CSV and keep the header row in every chunk?
A. Yes. Turn on Repeat the first line in every chunk. The first line is copied to the top of each chunk and is not counted in the chunk size, so 1000 lines per chunk means a header plus up to 1000 data lines. The tool splits on line breaks, so a cell that contains a line break inside quotation marks is counted as separate lines.
Q.Can I download each chunk as its own file?
A. Yes. Download ZIP (one file each) creates a ZIP with one text file per chunk, named chunk-001.txt, chunk-002.txt, and so on. Each file contains the chunk as shown in the preview, including any header, numbers, and added text. A ZIP can hold up to 2,000 files, so use larger chunks if you get more than that. Download all (.txt) gives you one file with every chunk instead.
Q.Can I add line numbers, and how do I keep them in order when sorting?
A. Yes. Under Number the lines, choose a style: 1., 1), [1], 1:, or a number followed by a tab. Continuous numbers run through the whole text, and Restart in each chunk starts again at 1. Turn on Zero-pad so the numbers have equal width, such as 001 and 010. Without padding, a text sort puts 10 before 2.
Q.How do I wrap every line in quotes and add a comma?
A. Type a quotation mark in the Before box and a quotation mark followed by a comma in the After box. Every line becomes a quoted, comma-ended item that you can paste into code or a query. The After text is added to every line, including the last one, so remove the final comma by hand if your syntax does not allow it.
Q.What do Skip blank lines and Trim whitespace do?
A. Trim whitespace removes spaces and tabs from both ends of every line. Skip blank lines then drops lines that are empty or hold only whitespace. Both happen before the lines are counted, so chunks hold the number of real lines you asked for. The badge under the input shows how many lines were counted.
Q.Does it work with Windows line endings, and does a blank last line count?
A. Yes. Windows (CRLF), old Mac (CR), and Unix (LF) line endings are all treated as the same line break. One line break at the very end of the text does not create an extra empty line, so a file that ends with a newline splits the same way as one that does not.
Q.Is my text uploaded, and is there a size limit?
A. No upload happens. The splitting runs in your browser and the file you open is read on your device only. The tool sets no limit on text length, and lines per chunk can be any number from 1 to 100,000. To keep the page fast, only 50 chunks are drawn at a time, but Copy all chunks and the downloads always include every chunk. A very large input can still be slow on an older device.
Q.Can I split by number of characters instead?
A. No. This tool cuts only at line breaks, so a very long single line stays in one piece. Use a character-count splitter if you need chunks of a fixed length.
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.