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.
How to add Row Numbers to JSON files
- Drop your file onto the upload area. The row count is shown and the first 200 rows are previewed.
- Type a name for the new column. It defaults to row_number.
- Set Start at to the first number you want. It defaults to 1, and 0 or a negative number also works.
- Click Add Row Numbers. The new column appears as the first column in the preview.
- Click Download to save the numbered 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 research team has a batch of survey responses and a second batch already numbered up to 100. They want the new batch to carry on from 101 so the two can be combined later.
Input (JSON)
[
{
"respondent": "r_8f2a",
"country": "Ireland",
"score": 7,
"completed": true
},
{
"respondent": "r_03cd",
"country": "Portugal",
"score": 9,
"completed": true
},
{
"respondent": "r_b771",
"country": "Ireland",
"score": null,
"completed": false
},
{
"respondent": "r_5e10",
"country": "Canada",
"score": 6,
"completed": true
}
]Settings
- Column name: response_no
- Start at: 101
Result
| response_no | respondent | country | score | completed |
|---|---|---|---|---|
| 101 | r_8f2a | Ireland | 7 | true |
| 102 | r_03cd | Portugal | 9 | true |
| 103 | r_b771 | Ireland | NULL | false |
| 104 | r_5e10 | Canada | 6 | true |
A new integer column called response_no is placed in front of the existing columns and counts up by one per row from 101. Numbers follow the order of the rows in the file. The other columns are unchanged, including the missing score for r_b771.
Working with JSON files
Each object in the JSON array gets a new key holding its position. The new key is written first in every object, followed by the original keys. The value is a JSON number, not a string, so {"row_number": 1, ...} rather than "1".
Because the file passes through a table, every object in the output has the same set of keys. Keys missing from an object in the source are written with null. Objects with nested values keep them as nested JSON. If your records already have an id key, choose a different name such as seq or position for the new one so the two are easy to tell apart. Numbering follows array order. This helps before sending records to a system that may reorder them. Each object carries its original position, so you can match responses back to the source. Key names are case-sensitive in JSON, so Row_Number and row_number would be two separate keys.
Frequently Asked Questions
Is the row number added as a number or a string in JSON?
As a number. Each object gets a numeric value, such as "row_number": 42.
Where does the new key appear in each JSON object?
It is the first key in every object, before the original keys.
Can I start numbering at 0?
Yes. Set Start at to 0 for zero-based indexes. Any whole number works, including negatives. An empty box or a value that is not a number uses the default of 1, and decimals are cut to a whole number.
In what order are rows numbered?
In the order they appear in the file. The tool does not sort. Sort the file first if you want numbers to follow a date or ID column.
What if I leave the column name blank?
The column is named row_number. Choose a name that is not already used by a column in your file.
Related Tools
Sort JSON Files Online
Sort JSON files by any column, ascending or descending, directly in your browser.
Split JSON Files Online
Split JSON files into multiple smaller files by row count, directly in your browser.
Manage Columns in JSON Files Online
Drop or select specific columns from JSON files directly in your browser. No upload required.
Add Row Numbers to CSV Files Online
Add a row number index column to CSV files directly in your browser. Set the column name and starting number — no upload required.
Add Row Numbers to Excel Files Online
Add a row number index column to Excel files directly in your browser. Set the column name and starting number — no upload required.
Add Row Numbers to Parquet Files Online
Add a row number index column to Parquet files directly in your browser. Set the column name and starting number — 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.