Truncate Dates in JSON Files Online
Truncate date and timestamp columns in JSON 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.
How to truncate Dates in JSON files
- Drop your file onto the upload area. The first date or timestamp column is selected for you, and the first 200 rows are shown.
- Check the "Column to truncate" choice. Each column is listed with its detected type, so you can see whether it loaded as a date, a timestamp or text.
- Pick the precision under "Truncate to": year, quarter, month, week, day, hour, minute or second. Month is the default.
- Choose "Replace column in place", or "Append as new column (keeps original)" and give the new column a name. The default name is the column name plus _trunc.
- Click Truncate Dates, check the preview, and download the result 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 support team exports ticket open times and wants a week column to count tickets per week in a pivot table, while keeping the exact open time for reference.
Input (JSON)
[
{
"ticket_id": "T-101",
"opened_at": "2026-06-03 14:20:00",
"priority": "high"
},
{
"ticket_id": "T-102",
"opened_at": "2026-06-07 23:59:00",
"priority": "low"
},
{
"ticket_id": "T-103",
"opened_at": "2026-06-08 08:05:00",
"priority": "medium"
},
{
"ticket_id": "T-104",
"opened_at": "2026-06-12 17:40:00",
"priority": "high"
},
{
"ticket_id": "T-105",
"opened_at": null,
"priority": "low"
}
]Settings
- Column to truncate: opened_at
- Truncate to: Week (Monday, as a date)
- Output mode: Append as new column, named opened_week
Result
| ticket_id | opened_at | priority | opened_week |
|---|---|---|---|
| T-101 | 2026-06-03 14:20:00 | high | 2026-06-01 |
| T-102 | 2026-06-07 23:59:00 | low | 2026-06-01 |
| T-103 | 2026-06-08 08:05:00 | medium | 2026-06-08 |
| T-104 | 2026-06-12 17:40:00 | high | 2026-06-08 |
| T-105 | NULL | low | NULL |
Weeks start on Monday, so Wednesday 3 June and Sunday 7 June both fall in the week of Monday 1 June. A ticket opened a few minutes after midnight on Monday 8 June starts the next week. The missing open time stays empty. For year, quarter, month, week and day the new column holds plain dates. Hour, minute and second keep a time part.
Working with JSON files
JSON has no date type, so timestamps are strings. Plain ISO dates like "2026-06-03" are detected on load. Full timestamps like "2026-06-03T14:20:00" often load as text, which is fine: the tool converts each value during the run. Strings with a Z or an offset such as +02:00 are shifted to UTC first and then truncated, so "2026-06-01T01:30:00+02:00" lands in the previous day and week. Keys that hold plain dates such as "2026-06-03" need no parsing at all. Truncating those to month or week works directly, and truncating them to day leaves them unchanged.
Epoch numbers such as 1780000000 are not treated as dates and return null. Convert them with Format Timestamp first. Objects missing the date key get null in the truncated field. In the downloaded array, date precisions are written as "2026-06-01" and hour, minute and second as "2026-06-03 14:00:00", with a space rather than a T. Nested objects in other keys are copied through as nested objects.
Frequently Asked Questions
How are JSON timestamps with time zone offsets handled?
They are converted to UTC before truncating. A local time just after midnight in a zone ahead of UTC can therefore fall into the previous day, week or month.
Can I truncate a Unix epoch field in JSON?
Not directly. Epoch numbers come back as null. Convert them to timestamps with Format Timestamp, then truncate.
What day does a truncated week start on?
Monday. Week truncation follows ISO weeks, so every value from Monday 00:00 to Sunday 23:59:59 maps to that Monday.
Does truncating round to the nearest period?
No. It always rounds down to the start of the period. 2026-06-30 23:59 truncated to month is 2026-06-01, not 2026-07-01.
What happens to values that are not valid dates?
They become empty (NULL) in the output. The run does not fail, so compare the number of empty cells before and after to spot parsing problems.
Related Tools
Count Values in JSON Files Online
Group and count rows by any column in JSON files directly in your browser. Sort by frequency or value to find the most common entries — no upload required.
Aggregate JSON Files Online
Group and aggregate JSON files by any column directly in your browser. Calculate sum, average, min, max, and count for any numeric column — no upload required.
Filter by Date Range JSON Files Online
Filter JSON files to rows within a date range using simple start and end date pickers. See a live match count before you apply the filter — no upload required, runs 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.
Truncate Dates in Excel Files Online
Truncate date and timestamp columns in Excel 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.
Truncate Dates in Parquet Files Online
Truncate date and timestamp columns in Parquet 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.
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.