A cron expression is a string of 5 (or 6) fields that defines a recurring schedule for running automated tasks. It is the standard format used in Unix cron jobs, CI/CD pipelines, cloud schedulers (AWS EventBridge, GitHub Actions), and most backend job frameworks.
Field Layout
┌─────────── minute (0–59) │ ┌───────── hour (0–23) │ │ ┌─────── day of month (1–31) │ │ │ ┌───── month (1–12 or JAN–DEC) │ │ │ │ ┌─── day of week (0–6 or SUN–SAT, 0=Sunday) │ │ │ │ │ * * * * *
Some systems add a 6th field for seconds (Quartz, Spring) at the beginning, or a 6th year field at the end.
Special Characters
| Character | Name | Meaning |
|---|---|---|
| * | Wildcard | Every value in the field |
| , | List | Multiple values: 1,3,5 |
| - | Range | A range of values: 1-5 |
| / | Step | Every N values: */5 = every 5 minutes |
| L | Last | Last day of month or week (some implementations) |
| W | Weekday | Nearest weekday to given day (some implementations) |
| # | Nth | 3rd Monday = MON#3 (some implementations) |
Common Schedule Examples
* * * * *Every minute*/5 * * * *Every 5 minutes0 * * * *Every hour (at :00)0 */2 * * *Every 2 hours0 9 * * *Daily at 9:00 AM0 0 * * *Daily at midnight0 9 * * MON-FRIWeekdays at 9:00 AM0 9 * * 1Every Monday at 9:00 AM0 0 1 * *First day of every month at midnight0 0 1 1 *Once a year on January 1st at midnight30 8 * * 1-5Weekdays at 8:30 AM0 0,12 * * *Twice daily: midnight and noon0/30 * * * *Every 30 minutes (Quartz syntax)Month and Day Names
Months
| Number | Name |
|---|---|
| 1 | JAN |
| 2 | FEB |
| 3 | MAR |
| 4 | APR |
| 5 | MAY |
| 6 | JUN |
| 7 | JUL |
| 8 | AUG |
| 9 | SEP |
| 10 | OCT |
| 11 | NOV |
| 12 | DEC |
Days of Week
| Number | Name |
|---|---|
| 0 (or 7) | SUN |
| 1 | MON |
| 2 | TUE |
| 3 | WED |
| 4 | THU |
| 5 | FRI |
| 6 | SAT |
Platform Differences
0 and 7 as Sunday for day-of-week. Always check your platform's documentation.Parse and explain any cron expression with the Cron Expression Parser tool.