A one-page reference for cron syntax across the common dialects: which fields exist, what values they accept, and what every special character does. Try any example in the explainer above.
Fields and allowed values
Field
Values
Notes
Second
0–59
Quartz, Spring and 6-field crons only
Minute
0–59
First field in crontab and AWS
Hour
0–23
24-hour clock
Day of month
1–31
L, W and LW in Quartz, Spring, AWS
Month
1–12 or JAN–DEC
Names are case-insensitive
Day of week
0–7 or SUN–SAT
Quartz and AWS: 1–7, 1 = Sunday
Year
1970–2199
Optional in Quartz, required in AWS
Special characters
Symbol
Meaning
Example
*
Any value
* * * * * — every minute
,
List of values
0 9,17 * * * — 09:00 and 17:00
-
Range
0 9 * * 1-5 — weekdays at 09:00
/
Step
*/15 * * * * — every 15 minutes
?
No specific value (day fields)
0 0 12 ? * MON — Quartz
L
Last day / last weekday
0 0 0 L * ? — last day of month
W
Nearest weekday
0 0 9 15W * ? — weekday nearest the 15th
#
Nth weekday of the month
0 0 9 ? * 2#1 — first Monday
Macros
Macros
Standard crontab
@yearly / @annually
0 0 1 1 *
@monthly
0 0 1 * *
@weekly
0 0 * * 0
@daily / @midnight
0 0 * * *
@hourly
0 * * * *
Reading order
Read an expression from the smallest unit to the largest: 30 2 * * 1 is minute 30 of hour 2 on any day of the month, in any month, when the weekday is Monday — 02:30 every Monday. In Quartz and Spring, prepend the seconds field; in AWS, append the year.
Common pitfalls
*/7 in the minute field does not mean “every seven minutes forever”: it restarts at each hour, so it fires at 0, 7, … 56 and then at 0 again. Restricting both day fields in crontab means either can match. And 0 in the day-of-week field is invalid in Quartz and AWS, where the week starts at 1.
Frequently asked questions
What is the order of cron fields?
Minute, hour, day of month, month, day of week. Quartz and Spring put seconds in front; AWS adds a year at the end.
What does the question mark mean in cron?
“No specific value”. Quartz and AWS require it in one of the two day fields; standard crontab doesn’t accept it.
How do I write “every 90 minutes”?
Cron can’t express intervals that don’t divide the hour or day evenly in one line. Use two entries, such as 0 0-21/3 * * * and 30 1-22/3 * * *.
Are month and weekday names case-sensitive?
No. JAN, Jan and jan are equivalent in every dialect covered here.