Skip to content
CronExplain

Cron Syntax Cheatsheet

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

FieldValuesNotes
Second0–59Quartz, Spring and 6-field crons only
Minute0–59First field in crontab and AWS
Hour0–2324-hour clock
Day of month1–31L, W and LW in Quartz, Spring, AWS
Month1–12 or JAN–DECNames are case-insensitive
Day of week0–7 or SUN–SATQuartz and AWS: 1–7, 1 = Sunday
Year1970–2199Optional in Quartz, required in AWS

Special characters

SymbolMeaningExample
*Any value* * * * * — every minute
,List of values0 9,17 * * * — 09:00 and 17:00
-Range0 9 * * 1-5 — weekdays at 09:00
/Step*/15 * * * * — every 15 minutes
?No specific value (day fields)0 0 12 ? * MON — Quartz
LLast day / last weekday0 0 0 L * ? — last day of month
WNearest weekday0 0 9 15W * ? — weekday nearest the 15th
#Nth weekday of the month0 0 9 ? * 2#1 — first Monday

Macros

MacrosStandard crontab
@yearly / @annually0 0 1 1 *
@monthly0 0 1 * *
@weekly0 0 * * 0
@daily / @midnight0 0 * * *
@hourly0 * * * *

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.