Add Moving Average to NDJSON Files Online
Add a moving average, rolling sum, rolling min, or rolling max column to NDJSON files directly in your browser. Choose window size, order-by column, and optional partitioning — no upload required.
How to add Moving Average to NDJSON files
- Drop your file onto the upload area. It is loaded into the in-browser engine and the first 200 rows are shown.
- Pick a window function: Moving Average (the default), Rolling Sum, Rolling Min or Rolling Max. The output column name changes to match, for example moving_avg or rolling_sum.
- Choose the value column (numeric columns only) and the window size in rows. The default is 3, and the window is the current row plus the rows before it.
- Choose an Order by column, usually a date, and optionally a Partition by column so each group gets its own series. Click Add Rolling Column.
- Check the preview, then download the 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 café tracks cups of coffee sold each day. Daily figures jump around with the weather, so the owner wants a 3-day moving average to see the underlying trend.
Input (NDJSON)
{"sale_date":"2026-05-04","weekday":"Mon","cups_sold":120}
{"sale_date":"2026-05-05","weekday":"Tue","cups_sold":150}
{"sale_date":"2026-05-06","weekday":"Wed","cups_sold":90}
{"sale_date":"2026-05-07","weekday":"Thu","cups_sold":180}
{"sale_date":"2026-05-08","weekday":"Fri","cups_sold":210}
{"sale_date":"2026-05-09","weekday":"Sat","cups_sold":150}Settings
- Window function: Moving Average
- Value column: cups_sold
- Window size: 3 rows
- Order by: sale_date
- Partition by: (none)
- Output column name: moving_avg
Result
| sale_date | weekday | cups_sold | moving_avg |
|---|---|---|---|
| 2026-05-04 | Mon | 120 | 120 |
| 2026-05-05 | Tue | 150 | 135 |
| 2026-05-06 | Wed | 90 | 120 |
| 2026-05-07 | Thu | 180 | 140 |
| 2026-05-08 | Fri | 210 | 160 |
| 2026-05-09 | Sat | 150 | 180 |
From Wednesday on, each value averages that day and the two before it: Thursday is (150 + 90 + 180) / 3 = 140. Monday and Tuesday do not have two earlier rows, so they average what is available: 120 alone, then (120 + 150) / 2 = 135. They are not left empty. Wednesday's dip is smoothed to 120, and the upward trend from Thursday is easy to see.
Frequently Asked Questions
How are the first rows handled when the window is not full yet?
They use whatever rows are available. With a window of 7, row 1 averages 1 value, row 2 averages 2, and from row 7 on every value covers 7 rows. No row is left empty for this reason.
Is the window centred or trailing?
Trailing. It covers the current row and the rows before it, up to the window size. Centred windows and exponential moving averages are not offered. Use the SQL Query tool with a custom window frame for those.
What is the difference between the four window functions?
Moving Average gives the mean of the window, Rolling Sum the total, and Rolling Min and Rolling Max the smallest and largest values. All four use the same window size, order and partition settings.
Related Tools
Round Numbers in CSV Files Online
Round numeric columns in CSV files to any number of decimal places directly in your browser. Set precision per column with a simple slider — no upload required.
Add Lag / Lead Column to CSV Files Online
Add a LAG or LEAD column to CSV files to shift any column forward or backward by N rows. See previous day's sales, next value in a sequence, or any time-shifted comparison — runs entirely in your browser.
Truncate Dates in CSV Files Online
Truncate date and timestamp columns in CSV files to a chosen precision — year, quarter, month, week, day, hour, or minute — directly in your browser. Rounds timestamps down to the start of each period. No upload required.
Add Moving Average to CSV Files Online
Add a moving average, rolling sum, rolling min, or rolling max column to CSV files directly in your browser. Choose window size, order-by column, and optional partitioning — no upload required.
Add Moving Average to Excel Files Online
Add a moving average, rolling sum, rolling min, or rolling max column to Excel files directly in your browser. Choose window size, order-by column, and optional partitioning — no upload required.
Add Moving Average to Parquet Files Online
Add a moving average, rolling sum, rolling min, or rolling max column to Parquet files directly in your browser. Choose window size, order-by column, and optional partitioning — no upload required.
Add Moving Average to JSON Files Online
Add a moving average, rolling sum, rolling min, or rolling max column to JSON files directly in your browser. Choose window size, order-by column, and optional partitioning — no upload required.
NDJSON Viewer Online
View and inspect NDJSON files directly in your browser. Browse rows, check column names and data types — no upload required, your data stays on your device.