Cron Expression Syntax: Every Field Explained
A complete reference for cron expression syntax — all five fields, special characters, step values, and the most common gotchas that trip up experienced developers.
The Anatomy of a Cron Expression
A standard cron expression has exactly 5 fields, separated by spaces. Each field controls a specific aspect of when the job runs.
The 5 Cron Fields
Which minute(s) of the hour the job runs.
| Value | Meaning |
|---|---|
| 0 | At the start of the hour (xx:00) |
| 30 | At half-past the hour (xx:30) |
| */15 | Every 15 minutes (00, 15, 30, 45) |
| 0,30 | At :00 and :30 each hour |
| 1-5 | At minutes 1, 2, 3, 4, and 5 |
Which hour(s) of the day the job runs (24-hour clock, UTC by default).
| Value | Meaning |
|---|---|
| 0 | Midnight (00:xx) |
| 9 | 9 AM |
| */6 | Every 6 hours: midnight, 6am, noon, 6pm |
| 9-17 | Every hour from 9am through 5pm |
| 0,12 | Midnight and noon only |
Which day(s) of the month the job runs.
| Value | Meaning |
|---|---|
| 1 | First day of every month |
| 15 | 15th of every month |
| L | Last day of the month (not all cron variants) |
| 1,15 | 1st and 15th of each month |
| */5 | Every 5th day: 1st, 6th, 11th, 16th, 21st, 26th, 31st |
Which month(s) the job runs. Numeric or named (JAN–DEC).
| Value | Meaning |
|---|---|
| 1 | January only |
| */3 | Every 3 months: Jan, Apr, Jul, Oct |
| 6,12 | June and December |
| 1-3 | January, February, March |
| JAN | January (named form — supported on most platforms) |
Which day(s) of the week the job runs. Both 0 and 7 represent Sunday.
| Value | Meaning |
|---|---|
| 0 | Sunday |
| 1 | Monday |
| 1-5 | Monday through Friday (weekdays) |
| 0,6 | Saturday and Sunday (weekends) |
| MON | Monday (named form — supported on most platforms) |
Special Characters
Matches every value in the field's range.
Specifies a list of values.
Specifies a range of values.
Specifies a step value. */n means 'every n units'. m/n means 'start at m, then every n'.
Used in day-of-month or day-of-week to mean 'no specific value'. Useful when one of the two is already specified.
In day-of-month: last day of month. In day-of-week: last occurrence of that day in the month.
Specifies the nth occurrence of a weekday in the month.
Nearest weekday (Mon–Fri) to the given day of the month.
@ Shorthand Macros
Many cron implementations support @ macros as human-readable shortcuts. They are NOT universally supported — always verify your platform.
| Macro | Equivalent |
|---|---|
| @yearly / @annually | 0 0 1 1 * |
| @monthly | 0 0 1 * * |
| @weekly | 0 0 * * 0 |
| @daily / @midnight | 0 0 * * * |
| @hourly | 0 * * * * |
| @reboot | (on startup) |
Common Gotchas
Day of month AND day of week — it's an OR
If you specify both day-of-month and day-of-week (instead of *), most cron implementations run the job when EITHER condition is met, not both. So `0 0 1 * 1` runs at midnight on the 1st of the month AND every Monday.
The step value starts from the field's minimum, not zero
`*/5` in the minute field means 0, 5, 10, 15…55. But `1/5` means 1, 6, 11, 16…56. The start value matters.
Timezone: cron always runs in the server's local time
Standard crontab uses the system timezone. If your server is UTC, `0 9 * * *` fires at 09:00 UTC. Many cloud schedulers (GitHub Actions, AWS) always use UTC.
Month names and day names are not universally supported
`JAN` instead of `1`, or `MON` instead of `1` — most Linux cron implementations accept this, but Kubernetes CronJob, some cloud schedulers, and programming library parsers may not.
Day-of-week: 0 and 7 both mean Sunday
Standard cron supports both 0 and 7 for Sunday, which can cause confusion. Some implementations (Quartz) number weekdays 1-7 starting Monday.
Quick Reference: Common Patterns
| Expression | Meaning |
|---|---|
| * * * * * | Every minute |
| 0 * * * * | Every hour (at :00) |
| 0 0 * * * | Every day at midnight |
| 0 9 * * 1-5 | 9 AM on weekdays |
| */15 * * * * | Every 15 minutes |
| 0 0 1 * * | Midnight on the 1st of each month |
| 0 0 * * 0 | Every Sunday at midnight |
| 0 9,17 * * 1-5 | 9 AM and 5 PM on weekdays |
| 30 8 1,15 * * | 8:30 AM on the 1st and 15th |
| 0 */6 * * * | Every 6 hours |
Test your cron expression now
Paste any expression into our free tools to validate it, see it in plain English, and preview the next 10 run times.