How to Read and Write Cron Expressions (With Next Run Times)
Cron syntax is five cryptic fields that everyone half-remembers. A job meant to run "on the first Monday of the month" can easily end up running every Monday plus the 1st through the 7th, because of a rule most people never learn. Cron expression explainer reads an expression, explains it in a sentence, breaks down each field, and lists the next run times, so mistakes show up before production.
Steps
- Paste an expression, choose a preset, or fill in the five boxes.
- Read the plain-English sentence and the meaning of each field.
- Set a start time and how many upcoming runs to list.
The five fields
Standard Linux cron uses: minute, hour, day of month, month, weekday. Sunday is 0 or 7. Names like MON and JAN work, and so do the aliases @hourly, @daily, @weekly, @monthly, @yearly and @reboot.
@reboot is the odd one: it runs when the system starts, so the tool explains it but shows an empty timetable. The start-up is the trigger.
Example: 0 9 * * 1-5 is 09:00, Monday to Friday.
The trap: day of month AND weekday
When both the day-of-month and weekday fields are restricted, Linux cron runs the job if either one matches. So 0 9 1-7 * 1, which looks like "first Monday", actually runs on every day from the 1st to the 7th and every Monday.
Quartz, the scheduler common in Java apps, uses the opposite rule: both must match. The tool names which rule it's applying in the sentence, and you'll see the difference right away in the run list.
For a true "first Monday" on Linux, the usual trick is 0 9 * * 1 plus a check in the script that the date is 7 or less.
Six or seven fields
Some systems add a seconds field at the start, and some (Quartz) allow a year at the end and special day rules. The tool detects when an expression uses those and reads it accordingly, with six fields treated as starting with seconds.
Next runs
The list shows upcoming matches up to eight years from the start time. Leave the start blank to mean "now" in your browser's time zone. That last part matters: servers usually run cron in UTC, so a job set for 0 9 * * * on a UTC server fires at 14:30 in India. Set the start time with that in mind when you check.
Practical tips
- Always check the run list, not just the sentence. Seeing five actual dates catches most mistakes.
- Mind time zones and daylight saving. A job at 02:30 can be skipped or run twice on DST change nights in some regions.
*/15in minutes means every 15 minutes starting at :00, not 15 minutes after the job last finished.- Spread out heavy jobs. Everyone schedules
0 0 * * *. Pick 03:17 instead to avoid contention. - Log output. Cron failures are silent by default; redirect stdout and stderr somewhere.
- Write the schedule in a comment above the line, in plain words, so the next person doesn't have to decode it.
Privacy
The page says everything runs locally and pasted text stays in the tab; only options like a format choice may be put in the shareable link. Like every page on the site, it shows Google ads.
FAQ
What does 0 9 * * 1-5 mean?
09:00 on weekdays.
What if both a date and a weekday are set? Linux runs when either matches; Quartz when both match.
How far ahead does the list go? Up to eight years from the start time.
What is @reboot?
Run once at system start-up.
Before the next crontab goes live, paste it into Cron expression explainer.
— Alok Kumar Singh