How cron expressions work
A cron expression is five fields separated by spaces. Cron checks the clock every minute and runs the job when the time matches every field. * means any value, so 0 9 * * * reads: minute 0, hour 9, any day, any month, any weekday.
┌───────────── minute 0–59 │ ┌─────────── hour 0–23 │ │ ┌───────── day of month 1–31 │ │ │ ┌─────── month 1–12 or JAN–DEC │ │ │ │ ┌───── day of week 0–7 or SUN–SAT (0 and 7 are Sunday) │ │ │ │ │ * * * * * command to run
| Character | Means | Example | Works in |
|---|---|---|---|
| * | Any value | * in the hour field: every hour | All |
| , | A list of values | 1,15 in day-of-month: the 1st and 15th | All |
| - | A range | 1-5 in day-of-week: Monday to Friday | All |
| / | A step | */15 in minutes: 0, 15, 30, 45 | All (Linux needs */n or a-b/n) |
| ? | No specific value | Day-of-week ? when day-of-month is set | Quartz, AWS |
| L | Last | L in day-of-month: the last day; 5L in day-of-week: the last Thursday (Quartz) | Quartz, AWS |
| W | Nearest weekday | 15W: the weekday nearest the 15th | Quartz, AWS |
| # | Nth weekday of the month | MON#2 or 2#2: the second Monday (Quartz) | Quartz, AWS |
Cron expression examples
The schedules people look up most. Click one to load it into the tool and see its next runs.
| Schedule | Cron expression | In plain English |
|---|---|---|
| Every minute | * * * * * | Every minute. |
| Every 5 minutes | */5 * * * * | Every 5 minutes. |
| Every 10 minutes | */10 * * * * | Every 10 minutes. |
| Every 15 minutes | */15 * * * * | Every 15 minutes. |
| Every 30 minutes | */30 * * * * | Every 30 minutes. |
| Every hour | 0 * * * * | At the start of every hour. |
| Every 2 hours | 0 */2 * * * | Every 2 hours, on the hour. |
| Every 6 hours | 0 */6 * * * | Every 6 hours, on the hour. |
| Every 12 hours | 0 */12 * * * | Every 12 hours, on the hour. |
| Every day at midnight | 0 0 * * * | At 00:00 every day. |
| Every day at 9 am | 0 9 * * * | At 09:00 every day. |
| Twice a day | 0 9,21 * * * | At 09:00 and 21:00 every day. |
| Weekdays at 9 am | 0 9 * * 1-5 | At 09:00 on weekdays. |
| Every 15 minutes in business hours | */15 9-17 * * 1-5 | Every 15 minutes from 09:00 through 17:45 on weekdays. |
| Weekends at 10 am | 0 10 * * 6,0 | At 10:00 on weekends. |
| Every Monday | 0 0 * * 1 | At 00:00 every Monday. |
| Every Sunday at 3 am | 0 3 * * 0 | At 03:00 every Sunday. |
| First day of every month | 0 0 1 * * | At 00:00 on the 1st of the month. |
| Every quarter | 0 0 1 */3 * | At 00:00 on the 1st of the month every 3 months (Jan, Apr, Jul and Oct). |
| Once a year | 0 0 1 1 * | At 00:00 on the 1st of January. |
Quartz and AWS can say what Linux cron can't: the last day of the month (0 0 0 L * ?), the last Friday (0 0 17 ? * 6L) or the second Monday of the month (cron(0 9 ? * MON#2 *)).
Unix vs Quartz vs AWS cron
Same idea, different rules. Paste an expression into the wrong format and it either errors or, worse, means something else.
| Unix / crontab | With seconds | Quartz | AWS EventBridge | |
|---|---|---|---|---|
| Fields | 5 | 6 (seconds first) | 6–7 (seconds first, optional year) | 6 (year last) |
| Seconds | No | Yes | Yes | No |
| Day-of-week numbers | 0–7, Sunday = 0 or 7 | 0–7, Sunday = 0 or 7 | 1–7, Sunday = 1 | 1–7, Sunday = 1 |
| Both day fields set | Runs if EITHER matches | Runs if EITHER matches | Not allowed: one must be ? | Not allowed: one must be ? |
| L, W, # | No | No | Yes | Yes |
| Used by | crontab, GitHub Actions, Kubernetes, Vercel | node-cron and other 6-field schedulers | Quartz scheduler (Java) | Amazon EventBridge |
Common cron mistakes
0 12 13 * 5 doesn't mean Friday the 13th. When day-of-month and day-of-week are both set, Unix cron runs when either matches: every 13th, and every Friday.* 5 * * * runs every minute from 05:00 to 05:59, sixty times. For once a day at 5 am, write 0 5 * * *.*/7 in the minute field runs at :00, :07 … :56, then :00 again: the last gap is 4 minutes. Steps restart every hour (and every month for days).0 0 31 * * skips five months, and 0 0 30 2 * never runs. Linux cron has no “last day of the month”; Quartz and AWS have L.% ends the command and starts its input. date +%F breaks; write date +\%F.Questions
What is a cron expression?
A cron expression is a short string that describes a repeating schedule, such as */5 * * * * for every five minutes. Unix cron reads five fields: minute, hour, day of the month, month and day of the week. Cron and the many schedulers built on it run a job whenever the current time matches all of them.
What does * * * * * mean?
Five stars mean every minute of every hour of every day. Each * means “any value” for its field. Replace a star with a number to pin that field: 0 * * * * runs at the start of every hour, and 0 9 * * * runs at 09:00 every day.
How do I run a cron job every 5 minutes?
Use */5 * * * *. The /5 is a step: in the minute field it matches 0, 5, 10 … 55. For every 15 minutes use */15 * * * *, and for every 30 minutes use */30 * * * *. Steps that divide 60 evenly keep the gaps regular.
Does cron use UTC or my local time?
Linux cron uses the server's timezone (and CRON_TZ or TZ if set). GitHub Actions and Vercel always use UTC. Kubernetes CronJobs use the controller's timezone unless you set spec.timeZone, and AWS EventBridge Scheduler lets you pick one. Pick the timezone above to see the run times where your job actually runs.
What's the difference between Unix and Quartz cron?
Quartz adds a seconds field at the start and an optional year at the end, numbers the days of the week 1–7 starting on Sunday (Unix uses 0–7, with 0 and 7 both Sunday), requires ? in either day-of-month or day-of-week, and supports L, W and # for the last day, the nearest weekday and the nth weekday. Switch formats above and the expression is converted when possible.
Why didn't my cron job run?
The usual suspects: the server's timezone isn't the one you assumed; cron runs with a minimal environment, so commands that work in your shell can't find programs (use full paths or set PATH); an unescaped % in a crontab line, which cron treats as a new line; the script isn't executable; or both day fields are set, so it runs on different days than you expected. Check the warnings above and your system log (grep CRON /var/log/syslog).
Can cron run every 30 seconds?
Unix cron can't run more often than once a minute. Schedulers with a seconds field can: */30 * * * * * in the 6-field format (node-cron) or 0/30 * * * * ? in Quartz. With plain cron, a common workaround is two entries for the same command, one of them starting with sleep 30.
Is this a crontab.guru alternative?
It does the same core job, explaining a cron expression in plain English, and adds the next run times in any timezone, Quartz, AWS and 6-field formats, and warnings for common mistakes. It's free and runs in your browser.