Sort JSON Files Online
Sort JSON files by any column, ascending or descending, directly in your browser.
How to sort JSON files
- Drop your file onto the upload area. It is loaded into the in-browser engine and the first 200 rows are shown.
- Choose the first column in the Sort by row and set it to Ascending or Descending.
- Click + Add sort key to add a Then by row for breaking ties. You can use up to four keys, and ✕ removes one.
- Click Sort. The preview shows the first 200 rows in their new order.
- Click Download to save the sorted file in the same format you uploaded.
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 teacher has exam results for two classes and wants each class grouped together, with the highest score at the top of each group. One student has no score yet.
Input (JSON)
[
{
"student": "Priya",
"class": "B",
"score": 88,
"submitted": "2026-05-12"
},
{
"student": "Tom",
"class": "A",
"score": 72,
"submitted": "2026-05-11"
},
{
"student": "Lena",
"class": "A",
"score": 91,
"submitted": "2026-05-12"
},
{
"student": "Omar",
"class": "B",
"score": null,
"submitted": "2026-05-13"
},
{
"student": "Jae",
"class": "A",
"score": 85,
"submitted": "2026-05-10"
}
]Settings
- Sort by: class, Ascending
- Then by: score, Descending
Result
| student | class | score | submitted |
|---|---|---|---|
| Lena | A | 91 | 2026-05-12 |
| Jae | A | 85 | 2026-05-10 |
| Tom | A | 72 | 2026-05-11 |
| Priya | B | 88 | 2026-05-12 |
| Omar | B | NULL | 2026-05-13 |
Rows are first ordered by class, so all of class A comes before class B. Inside each class, the second key orders scores from high to low. Omar has no score, and empty values always go last, whether the direction is ascending or descending. That is why he stays at the bottom of class B.
Working with JSON files
Each top-level key in the JSON array becomes a sortable column. JSON numbers sort numerically and strings sort by character code, with uppercase before lowercase. Date strings such as "2026-05-12" are detected as dates and sort chronologically. Objects that lack a key get NULL for it, and those objects sink to the end of the output whichever direction you choose. Booleans sort false before true in ascending order.
Nested objects become struct columns. They are carried through unchanged, and while they can be picked, they sort by their first field, then the next, which is rarely useful. Flatten the file first to sort on a field like customer.name. The output is a pretty-printed JSON array in the new order. Every object has the same keys in the same order, and a key that was missing in the input is written as null. Integers above 9,007,199,254,740,991, such as some 64-bit IDs, still sort by exact value, but they are written back as strings.
Frequently Asked Questions
Can I sort a JSON array by a nested key?
Not directly. The sort picker lists top-level keys only. Use Flatten JSON first so the nested key becomes its own column, then sort on it.
Does sorting change the key order inside each JSON object?
Keys are written in the order of the table's columns, which follows the order keys were first found in the file. The sort itself only changes the order of the objects.
How many columns can I sort by?
Up to four. The first key decides the main order, and each Then by key only breaks ties left by the keys above it.
Where do empty values go?
NULL values are always placed last, in both ascending and descending order.
Is the text sort case-sensitive?
Yes. Values are compared by character code, so uppercase letters sort before lowercase. Convert the column to one case first if you want "apple" and "Apple" side by side.
Related Tools
Split JSON Files Online
Split JSON files into multiple smaller files by row count, directly in your browser.
Add Row Numbers to JSON Files Online
Add a row number index column to JSON files directly in your browser. Set the column name and starting number — no upload required.
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.
Sort CSV Files Online
Sort CSV files by any column, ascending or descending, directly in your browser.
Sort Excel Files Online
Sort Excel files by any column, ascending or descending, directly in your browser.
Sort Parquet Files Online
Sort Parquet files by any column, ascending or descending, directly in your browser.
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.