SyntaxReference8 min read

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.

* * * * *
Minute 0–59
Hour 0–23
Day of Month 1–31
Month 1–12
Day of Week 0–7
Quick example: 30 9 * * 1-5 = At 9:30 AM, Monday through Friday.

The 5 Cron Fields

1
Minute— range: 0–59

Which minute(s) of the hour the job runs.

ValueMeaning
0At the start of the hour (xx:00)
30At half-past the hour (xx:30)
*/15Every 15 minutes (00, 15, 30, 45)
0,30At :00 and :30 each hour
1-5At minutes 1, 2, 3, 4, and 5
2
Hour— range: 0–23

Which hour(s) of the day the job runs (24-hour clock, UTC by default).

ValueMeaning
0Midnight (00:xx)
99 AM
*/6Every 6 hours: midnight, 6am, noon, 6pm
9-17Every hour from 9am through 5pm
0,12Midnight and noon only
3
Day of Month— range: 1–31

Which day(s) of the month the job runs.

ValueMeaning
1First day of every month
1515th of every month
LLast day of the month (not all cron variants)
1,151st and 15th of each month
*/5Every 5th day: 1st, 6th, 11th, 16th, 21st, 26th, 31st
4
Month— range: 1–12

Which month(s) the job runs. Numeric or named (JAN–DEC).

ValueMeaning
1January only
*/3Every 3 months: Jan, Apr, Jul, Oct
6,12June and December
1-3January, February, March
JANJanuary (named form — supported on most platforms)
5
Day of Week— range: 0–7 (0 and 7 = Sunday)

Which day(s) of the week the job runs. Both 0 and 7 represent Sunday.

ValueMeaning
0Sunday
1Monday
1-5Monday through Friday (weekdays)
0,6Saturday and Sunday (weekends)
MONMonday (named form — supported on most platforms)

Special Characters

*Asterisk (wildcard)

Matches every value in the field's range.

* * * * *
Every minute of every hour, every day
,Comma (list)

Specifies a list of values.

0 9,17 * * *
At 9:00 AM and 5:00 PM every day
-Hyphen (range)

Specifies a range of values.

0 9-17 * * *
At the start of every hour from 9 AM to 5 PM
/Slash (step)

Specifies a step value. */n means 'every n units'. m/n means 'start at m, then every n'.

*/5 * * * *
Every 5 minutes (0, 5, 10, 15, … 55)
?Question mark (no-op)

Used in day-of-month or day-of-week to mean 'no specific value'. Useful when one of the two is already specified.

0 12 15 * ?
Noon on the 15th, any day of week (Quartz/Spring)
LL (last)

In day-of-month: last day of month. In day-of-week: last occurrence of that day in the month.

0 0 L * *
Midnight on the last day of every month (AWS EventBridge)
#Hash (nth weekday)

Specifies the nth occurrence of a weekday in the month.

0 9 * * 1#2
9 AM on the 2nd Monday of each month (Quartz/Spring)
WW (nearest weekday)

Nearest weekday (Mon–Fri) to the given day of the month.

0 9 15W * *
9 AM on the nearest weekday to the 15th (Quartz/Spring)

@ Shorthand Macros

Many cron implementations support @ macros as human-readable shortcuts. They are NOT universally supported — always verify your platform.

MacroEquivalent
@yearly / @annually0 0 1 1 *
@monthly0 0 1 * *
@weekly0 0 * * 0
@daily / @midnight0 0 * * *
@hourly0 * * * *
@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.

Fix: To schedule on a specific weekday AND specific date, use application logic instead of cron.
!

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.

Fix: Use `*/5` for clean intervals starting at 0, or `m/n` when you need a specific start offset.
!

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.

Fix: Always clarify which timezone you're scheduling in. Use `TZ=` prefix in modern crontabs or platform-specific timezone fields.
!

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.

Fix: Use numeric values for maximum portability.
!

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.

Fix: Use 0 for Sunday consistently, and check your platform's documentation.

Quick Reference: Common Patterns

ExpressionMeaning
* * * * *Every minute
0 * * * *Every hour (at :00)
0 0 * * *Every day at midnight
0 9 * * 1-59 AM on weekdays
*/15 * * * *Every 15 minutes
0 0 1 * *Midnight on the 1st of each month
0 0 * * 0Every Sunday at midnight
0 9,17 * * 1-59 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.