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.
How to extract Head of JSON 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 (JSON)
[
{
"station": "WS-14",
"reading_time": "2026-07-01 00:00:00",
"temp_c": 11.4,
"humidity_pct": 82
},
{
"station": "WS-14",
"reading_time": "2026-07-01 00:10:00",
"temp_c": 11.1,
"humidity_pct": 83
},
{
"station": "WS-14",
"reading_time": "2026-07-01 00:20:00",
"temp_c": 10.9,
"humidity_pct": 85
},
{
"station": "WS-14",
"reading_time": "2026-07-01 00:30:00",
"temp_c": 10.8,
"humidity_pct": null
},
{
"station": "WS-14",
"reading_time": "2026-07-01 00:40:00",
"temp_c": 10.6,
"humidity_pct": 86
}
]Settings
- 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 JSON files
For a JSON array, N counts objects in array order. The first object in the file is row 1. If the file is a single object rather than an array, it loads as one row, so the head is that same object.
The output is a pretty-printed JSON array with two-space indentation. Every object in it has the same keys in the same order, because the file was loaded as a table first. If a key was missing from some objects in the source, those objects now carry that key with a null value. Numbers, booleans and nested objects keep their JSON types. Very large integers above 9,007,199,254,740,991 are written as strings so they are not rounded. Head is handy for making a short test fixture or documentation sample from a large API dump. The sample keeps the real key names and value types, so tests written against it use realistic data.
Frequently Asked Questions
Why do some objects in my JSON head output have extra null keys?
The file is loaded as a table with one column per key found anywhere in the file. Objects that lacked a key get null for it when written back out.
Can I take the first N lines of a newline-delimited JSON file here?
This page expects a JSON array. Use the NDJSON version of this tool for one-object-per-line files.
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 JSON Files Online
Drop or select specific columns from JSON files directly in your browser. No upload required.
Sample JSON Files Online
Sample rows from JSON files — first N, last N, or random — directly in your browser.
Extract Tail of JSON Files Online
Extract the last N rows from JSON files directly in your browser. Choose how many rows to keep and download the result — no upload required.
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.
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.
JSON Viewer Online
View and inspect JSON files directly in your browser. Browse rows, check column names and data types — no upload required, your data stays on your device.
Convert JSON to Parquet Online
Convert JSON files to Parquet format directly in your browser. No upload required — your data never leaves your device.