Get Top N Rows from JSON Files Online
Extract the top N rows per group from JSON files directly in your browser. Get the top 5 products per category, highest scores per team, or any ranked subset — no upload required.
About this tool
Extract the top N rows per group from a JSON file — for example the 3 best-selling products per region or the 5 most recent orders per customer. Choose the group column, the ranking column, the sort direction, and N. The output preserves all original columns. Equivalent to SQL's PARTITION BY with ROW_NUMBER(). All processing runs locally in your browser.
Frequently Asked Questions
What does top-N per group do to a JSON file?
It returns the top N rows within each group, ranked by the column and direction you choose — equivalent to SQL's ROW_NUMBER() OVER (PARTITION BY group_col ORDER BY rank_col DESC) with a WHERE row_num <= N filter. For example, the 3 highest-revenue customers per region.
Does top-N per group preserve all columns in the JSON output?
Yes. All columns from the original file are preserved. Only rows that fall outside the top N within their group are excluded from the output.
What happens when there are ties at the Nth position in a JSON top-N operation?
Ties are broken using row_number(), so one row from the tied group is arbitrarily selected and the others are excluded. To keep all tied rows at the boundary, use the SQL Query tool with RANK() and filter WHERE rank <= N.
Is my data private?
Yes — completely. Your file is never uploaded to any server. Everything runs locally in your browser using WebAssembly — processing happens entirely inside your tab. Once you close the tab, nothing is retained.
What is the maximum file size?
The free limit is 50 MB. For larger files, performance depends on your device's available memory — most modern machines handle 500 MB to 1 GB comfortably.
Related Tools
Normalize Columns in JSON Files Online
Normalize numeric columns in JSON files using min-max scaling (0–1) or z-score standardisation (mean=0, std=1). Adds new columns alongside the originals — no upload required.
Rank Rows in JSON Files Online
Add a rank column to JSON files based on any column's values. Choose RANK, DENSE RANK, or ROW NUMBER, with optional partitioning — runs entirely in your browser.
Add Cumulative Sum to JSON Files Online
Add a running total column to JSON files for any numeric column. Optionally order by a date or sequence column and restart totals per group — no upload required.
Detect Outliers in JSON Files Online
Detect statistical outliers in JSON files directly in your browser. Flag or remove rows where numeric values exceed a chosen number of standard deviations from the mean — no upload required.
Validate Email Addresses in JSON Files Online
Validate email addresses in JSON files directly in your browser. Add a boolean column flagging valid and invalid emails, or filter to show only invalid rows — no upload required.