What is a cron expression?
A cron expression is the standard way to schedule repeating tasks on Unix/Linux systems: it tells the cron daemon exactly when to run a command, using five space-separated fields that represent, in order, minute, hour, day of month, month, and day of week.
┌───────────── minute (0–59)
│ ┌───────────── hour (0–23)
│ │ ┌───────────── day of month (1–31)
│ │ │ ┌───────────── month (1–12)
│ │ │ │ ┌───────────── day of week (0–7, where 0 and 7 are Sunday)
│ │ │ │ │
* * * * *
Each field accepts several notations:
*— any value, no restriction.- A specific value (
5) — matches only that value. - A range (
9-17) — any value within the range, inclusive. - A list (
1,15,30) — any of the listed values. - A step (
*/15or9-17/2) — values spaced by that interval within the range (or across the whole field, if it's*).
Combining these notations with commas can express almost any schedule: 0,30 9-17 * * 1-5 runs at minute 0 and minute 30 of every hour between 9 and 17, Monday through Friday.
The most common trap: day-of-month and day-of-week
The most frequent source of confusion when reading a cron expression comes up when both day-of-month and day-of-week are restricted (neither one is *). The intuitive expectation would be that both conditions combine with "and" (both must match at once), but the POSIX cron standard combines them with "or".
For example, 0 0 15 * 1 (midnight on the 15th of the month, or Monday) does not mean "the 15th, but only if it falls on a Monday." It means: it runs at midnight on every 15th of the month (whatever weekday that happens to be) and also every Monday at midnight (whatever the date happens to be). If the 15th falls on a Tuesday, it still runs that day because of the day-of-month rule, and it also runs on the Monday before or after because of the day-of-week rule.
This "or" rule only applies when both fields are restricted. If one of the two is * (for example, 0 0 * * 1, "every Monday"), the behavior is the intuitive one: only that condition matters.
Time zone
cron runs tasks according to the system's configured time zone (or the CRON_TZ variable, in implementations that support it), not necessarily UTC. This tool calculates the next executions using the browser's time zone as a reference — to know exactly which time zone a cron job runs in on production, check the configuration of the server where it's scheduled.
Common macros
Many cron implementations (including Linux's crontab) accept @-prefixed shortcuts instead of the five fields:
| Macro | Equivalent to | Meaning |
|---|---|---|
@yearly / @annually | 0 0 1 1 * | Once a year, January 1st at midnight |
@monthly | 0 0 1 * * | Once a month, on the 1st at midnight |
@weekly | 0 0 * * 0 | Once a week, on Sunday at midnight |
@daily / @midnight | 0 0 * * * | Once a day, at midnight |
@hourly | 0 * * * * | Once an hour, at minute 0 |
How to use this tool
Type a 5-field cron expression (or a macro like @daily) and the tool translates it into a plain-language description, field by field, and calculates the next 5 dates and times it would run starting from right now. If day-of-month and day-of-week are both restricted, a note explains the "or" rule so the result doesn't come as a surprise.