Extract Head of CSV Files Online
Extract the first N rows from CSV files directly in your browser. Choose how many rows to keep and download the result — no upload required.
How to extract Head of CSV files
- Drop your file onto the upload area. The whole file is loaded, the total row count is shown and the first 200 rows are previewed.
- Enter how many rows to keep in the Number of rows box. The default is 100.
- Click Extract First Rows. The preview switches to show only the rows you kept.
- Click Download to save them in the same format you uploaded, with _head added to the file name.
Your file is processed locally in your browser and is never uploaded. The free limit is 50 MB per file; larger files work if your device has the memory for them.
Worked example
A weather station logs a reading every ten minutes into one long file. An engineer wants a small slice to share in a bug report without sending the full year of data.
Input (CSV)
station,reading_time,temp_c,humidity_pct
WS-14,2026-07-01 00:00:00,11.4,82
WS-14,2026-07-01 00:10:00,11.1,83
WS-14,2026-07-01 00:20:00,10.9,85
WS-14,2026-07-01 00:30:00,10.8,
WS-14,2026-07-01 00:40:00,10.6,86Settings
- Number of rows: 3
Result
| station | reading_time | temp_c | humidity_pct |
|---|---|---|---|
| WS-14 | 2026-07-01 00:00:00 | 11.4 | 82 |
| WS-14 | 2026-07-01 00:10:00 | 11.1 | 83 |
| WS-14 | 2026-07-01 00:20:00 | 10.9 | 85 |
The first three data rows are kept in their original order and the header is carried over. Nothing is sorted, so "first" means first in the file, not earliest by timestamp. Here the file was already in time order, so the result is also the three earliest readings.
Working with CSV files
The header line is not counted as a row. Asking for 3 rows gives the header plus the first three data lines. Before the rows are cut, the whole CSV is read and each column gets a detected type. That is why a file that fails to parse at line 90,000 will fail here too, even if you only want the first 10 rows.
The downloaded CSV is written fresh rather than copied byte for byte. It uses a comma delimiter and LF line endings, and fields are quoted only when they contain a comma, quote or line break. Numbers are written in plain form, so 11.40 becomes 11.4. If the original used semicolons, the head file will use commas. Use Change Delimiter afterwards if you need the old separator back. The on-screen table shows at most 200 rows. For N above 200 you see the first 200 in the preview, while the download contains all N.
Frequently Asked Questions
Does the header row count toward N for a CSV?
No. The header is always kept and N counts data rows only. Setting 100 gives 101 lines in the downloaded file.
Can I use this to split off a test file from a huge CSV?
Yes, as long as the full file fits in browser memory, because it is loaded in full before the first rows are taken. For files too large for that, a command-line tool such as head -n is the better choice.
Does it read only the first N rows?
No. The whole file is loaded into the in-browser engine and counted first, then the first N rows are kept. Very large files are limited by the memory your browser can use, not by N.
What is the difference between Head and Sample?
Head keeps the first N rows in file order and gives the same result every time. Sample picks rows at random, which is better when the start of the file is not typical of the rest.
What if I ask for more rows than the file has?
You get every row. If the box is empty or not a number, the default of 100 is used. 0 and negative numbers are treated as 1, so you always get at least one row.
Related Tools
Manage Columns in CSV Files Online
Drop or select specific columns from CSV files directly in your browser. No upload required.
Sample CSV Files Online
Sample rows from CSV files — first N, last N, or random — directly in your browser.
Extract Tail of CSV Files Online
Extract the last N rows from CSV files directly in your browser. Choose how many rows to keep and download the result — no upload required.
Extract Head of Excel Files Online
Extract the first N rows from Excel files directly in your browser. Choose how many rows to keep and download the result — no upload required.
Extract Head of Parquet Files Online
Extract the first N rows from Parquet files directly in your browser. Choose how many rows to keep and download the result — no upload required.
Extract Head of JSON Files Online
Extract the first N rows from JSON files directly in your browser. Choose how many rows to keep and download the result — no upload required.
CSV Viewer Online
View and inspect CSV files directly in your browser. Browse rows, check column names and data types — no upload required, your data stays on your device.
Convert CSV to Parquet Online
Convert CSV files to Parquet format directly in your browser. No upload required — your data never leaves your device.