Key takeaways
- Standard cron has exactly five fields in a fixed order: minute 0-59, hour 0-23, day of month 1-31, month 1-12, day of week 0-7. There is no seconds field and no year field.
- A step restarts at the field boundary. Star slash 7 in the hour field gives 0, 7, 14 and 21, so the last gap of the day is three hours, not seven.
- When both day-of-month and day-of-week are restricted they are combined with OR, not AND. The job fires on the 13th or on any Friday, whichever comes first.
- Both 0 and 7 mean Sunday. Month and weekday names work only as three-letter abbreviations, so JAN resolves and JANUARY does not.
- A schedule can parse cleanly and never fire: day 31 of April is impossible, and day 29 of February only exists in a leap year.
- The field values are local to the machine running the job. A browser-based parser shows your timezone; most servers run cron in UTC, and the two can differ by a whole day.
Five Fields, in a Fixed Order, Each Expanding to a Set
The whole grammar is five space-separated fields, left to right: minute (0-59), hour (0-23), day of month (1-31), month (1-12), day of week (0-7). Each field expands into a set of integers. The scheduler walks forward minute by minute and fires when the current minute, hour, day, month and weekday are all members of their respective sets. There is no sixth field for seconds and no seventh for a year — if you have seen those, you were looking at Quartz, Spring or systemd, not cron.
The mental shift that makes everything else click is that a field is a set membership test, not an interval. */15 in the minute field does not mean "wait fifteen minutes after the last run". It means "the set {0, 15, 30, 45}", and the job fires whenever the wall clock lands on one of those numbers. That distinction is the root of three of the four traps below.
The cron parser expands every field for you and shows the resulting sets alongside a plain-English sentence and the next eight fire times. That is the fastest way to settle what an expression actually does: read the expanded set rather than reasoning about the shorthand. It runs entirely in your browser, so a schedule copied out of a production config never leaves your machine.
Field count is checked before anything else, and the error tells you the count it found. A four-field expression reports that standard cron uses five fields and that this one has four. A six-field Quartz expression reports six. @daily and @reboot report one, because they are a single token — they are nicknames understood by some cron daemons, not part of the five-field grammar, and this parser does not expand them.
Out-of-range values are rejected individually and named: minute 60 reports that 60 is out of range 0-59, hour 24 reports 0-23, day 32 reports 1-31, month 13 reports 1-12, weekday 8 reports 0-7. A backwards range such as 5-1 is rejected as running backwards, and a step of zero is rejected because it would never advance. These are the easy failures. The hard ones all parse successfully.
The Operators: Star, Value, Range, List, Step and Names
Six forms cover everything. * means the whole range of the field. A bare number means that one value. a-b means every integer from a to b inclusive. a,b,c is a list, and each item may itself be any of the other forms. /n is a step, applied either to * or to a range. And in the month and weekday fields, three-letter names stand in for numbers.
Steps on a range are the least surprising: 1-10/3 in the minute field expands to 1, 4, 7, 10 — start at the range's lower bound and add the step until you pass the upper bound. 0-30/10 gives 0, 10, 20, 30. Note that the upper bound is included only if the arithmetic lands on it exactly; 1-10/4 gives 1, 5, 9 and stops, because 13 is past 10.
A step on a lone value is a widely supported extension rather than part of the original grammar: 5/10 in the minute field means "start at 5, step by 10, up to the field maximum", giving 5, 15, 25, 35, 45, 55. Some cron implementations reject it. If you need portability across daemons, write the equivalent range explicitly as 5-55/10 — same set, no extension required.
Names are case-insensitive but strictly three letters. JAN, jan and Jan all resolve to month 1; MON-FRI resolves to weekdays 1 through 5. Full names do not work: JANUARY is rejected as not being a number, and so is MONDAY. This is a common copy-paste failure when moving a schedule between a Quartz-style scheduler, which accepts full names, and a plain crontab, which does not.
Weekday numbering has one deliberate redundancy: both 0 and 7 mean Sunday. So 0-7 covers the entire week and is equivalent to *, and a range written 1-7 means Monday through Sunday rather than Monday through Saturday. If you are translating a schedule from a system where Sunday is 1, every weekday number shifts, and that is a silent off-by-one-day error rather than a parse failure.
Trap One: A Step Restarts at the Field Boundary
Because a field is a set built from its own minimum, a step that does not divide the field's span produces an uneven cadence. The set is generated from the bottom of the range and simply stops at the top; it does not wrap around and continue.
Measured in the minute field: */15 gives 0, 15, 30, 45 and the gaps are 15, 15, 15, 15 — even, because 15 divides 60. */25 gives 0, 25, 50 and the gaps are 25, 25, 10. The job runs at :50 and then again ten minutes later at :00. */7 gives 0, 7, 14, 21, 28, 35, 42, 49, 56 and the final gap is 4 minutes, from :56 to :00.
The hour field behaves the same way and the effect is larger. 0 */7 * * * expands to hours 0, 7, 14, 21 — gaps of 7, 7, 7, 3. Anyone reading that expression as "every seven hours" expects a steady cadence and gets a three-hour gap overnight. If you genuinely need a fixed seven-hour interval, cron cannot express it: the day is 24 hours and 7 does not divide 24. Use a divisor of 24 (1, 2, 3, 4, 6, 8, 12) or run the job from a scheduler that tracks elapsed time instead of wall-clock fields.
Two degenerate cases are worth recognising on sight. */60 in the minute field expands to {0} alone, because the next value would be 60 and that is outside the range. */90 also expands to {0}. Both are therefore identical to writing 0, and both fire once an hour — not once every 60 or 90 minutes in the sense of a drifting interval. They happen to be correct for "on the hour", but only by accident.
The general rule: a step is only a true interval when it divides the field's span evenly. Minutes and seconds divide by 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30. Hours divide by 1, 2, 3, 4, 6, 8, 12. Anything else gives you a short gap at the boundary, and the parser's expanded set will show it to you immediately.
Trap Two: Day-of-Month and Day-of-Week Are ORed, Not ANDed
This is the trap that catches almost everyone, because it contradicts how every other pair of fields behaves. Minute, hour and month are combined with AND. But when both day-of-month and day-of-week are restricted — that is, neither is * — the two day tests are combined with OR. The job fires if either one matches.
Measured from 1 December 2026, the expression 0 0 13 * 5 fires at midnight on 4 December, 11 December, 13 December, 18 December, 25 December, 1 January, 8 January and 13 January. The Fridays are the 4th, 11th, 18th and 25th; the 13th is a Sunday that month. It is the union of the two sets, not the intersection. Read as English, "on the 13th and on Fridays" is what most people intend, and it is not what they get.
The rule is conditional, which is what makes it survivable. If day-of-month is *, only the weekday test applies: 0 0 * * 5 fires every Friday and nothing else. If day-of-week is *, only the day-of-month test applies: 0 0 13 * * fires on the 13th of every month. The OR only engages when you have narrowed both.
So the fix is to leave one of the two day fields as *. If you want "the 13th, but only when it is a Friday", cron cannot express that directly — you would schedule 0 0 13 * * and have the job itself check the weekday and exit early. That is not a workaround to be embarrassed about; it is the standard pattern, because the condition is genuinely outside the grammar.
The parser states the rule in its own output rather than leaving you to discover it: when both day fields are restricted, the description ends with a note that day-of-month and day-of-week are combined with OR. Checking that sentence is a two-second habit that prevents a whole class of scheduling bug.
Trap Three: Valid Schedules That Never Fire
A cron expression is validated field by field, against the field's own range. Nothing checks whether the combination is possible on a real calendar. So 0 0 31 4 * — midnight on the 31st of April — parses perfectly, expands to a valid set, and can never fire, because April has 30 days. The same applies to the 31st of June, September and November, and to the 30th of February.
Leap day is the subtler version. 0 0 29 2 * is a real schedule that fires roughly once every four years. It is not invalid, and a parser is right to accept it. But it will show no upcoming runs from most starting points, and the reason is the search window rather than the calendar.
The cron parser walks forward minute by minute with a cap of 500,000 iterations so that a pathological expression cannot hang the tab. That cap is 347.22 days, about 11.4 months. From December 2026 the next 29 February is in 2028, more than fourteen months away, so the projection returns nothing and the tool reports that no matching minute was found within the next eleven months. Measured: from 1 March 2027 it still returns nothing, and from 1 April 2027 it correctly returns 29 February 2028.
The honest reading of an empty result is therefore "nothing inside the window", not "this schedule is broken". For a yearly job such as 0 0 1 1 * the window comfortably contains the next occurrence, so you get one row. For a leap-day job you usually get none. If you need to confirm a rare schedule, reason about the calendar directly or use a scheduler that can project years ahead.
One more calendar edge worth knowing: day-of-month 31 in a month that has 30 days is skipped rather than rolled forward. Cron does not fire on the 1st of the next month as a substitute. If you want "the last day of every month", standard cron has no syntax for it — the usual approach is to run on days 28-31 and have the job check whether tomorrow is the 1st.
Trap Four: The Numbers Are Local to Whatever Runs the Job
A cron expression carries no timezone. 0 9 * * * means nine o'clock in the local time of the machine whose crontab it is. On a laptop that is your own timezone; on a cloud server it is very often UTC, regardless of where you are. A schedule written at 09:00 local and deployed to a UTC server runs at 09:00 UTC, which can be five hours earlier or later than you intended.
This is why a browser-based parser shows times in your timezone while your production job runs in the server's. The two are not disagreeing about the expression; they are evaluating the same sets against different clocks. The parser computes its next-run list only after the page has mounted, precisely so the server-rendered markup and the browser's hydration do not disagree about what "now" is.
The date boundary is where this bites hardest. An instant that is 29 February locally can be 28 February in UTC, and a job scheduled for 00:30 local can land on the previous calendar day in UTC — which changes whether a day-of-month or day-of-week field matches at all. If a schedule involves midnight, a month boundary or a specific weekday, verify it in the timezone the server actually uses. The timestamp converter shows the same instant in both UTC and local time, which is the quickest way to see the shift.
Daylight saving adds two more failures. When clocks spring forward, the skipped hour does not exist, so a job scheduled inside it may not run at all that day. When clocks fall back, the repeated hour happens twice, and a job scheduled inside it may run twice. Neither is a cron bug; both are consequences of describing wall-clock time in a zone that is not monotonic. Scheduling in UTC avoids both entirely, which is the main reason servers default to it.
There is a related boundary trap inside the hour field that has nothing to do with timezones. 9-17 includes the whole of the 17:00 hour, so */15 9-17 * * 1-5 fires at 17:00, 17:15, 17:30 and 17:45. Measured on a Tuesday, the last four runs of the day are 17:15, 17:30, 17:45 and then 09:00 the next morning. "Nine to five" in cron means "up to a quarter to six". To stop at 17:00 exactly, write 0 9-17 * * 1-5 for hourly runs, or */15 9-16 * * 1-5 plus 0 17 * * 1-5.
Reading a Schedule Out of a Config, and a Routine That Catches Everything
Schedules rarely arrive as a bare expression. They arrive inside a YAML pipeline file, a JSON task definition, a Kubernetes CronJob manifest or a database row, usually next to the command they run and the environment they run in. Extracting the expression correctly is half the job, and the surrounding fields are what tell you which timezone and which scheduler dialect you are dealing with. If the config is JSON, the JSON formatter makes the nesting readable; the JSON formatter guide covers the same decode-then-inspect discipline for tokens, timestamps and other dense strings hidden inside payloads.
Know which dialect you are reading before you trust a translation. Quartz and Spring use six or seven fields, starting with seconds, and support ? for "no specific value", L for last, W for nearest weekday and # for the nth weekday of the month. systemd calendar events use a completely different syntax with names like Mon..Fri and *-*-* 09:00:00. Container schedulers such as Kubernetes CronJob use five-field cron but do not accept every token a full cron daemon does, so an expression copied from a Quartz job will not carry across unchanged. None of those extra tokens mean anything to a five-field parser, and the field-count check rejects most of them before the values are even examined.
A routine that catches all four traps takes about a minute. One: count the fields — five, or you are in a different dialect. Two: expand every step and look at the gaps, including the wrap from the last value back to the first; if the step does not divide the field's span, the cadence is uneven. Three: if both day fields are narrowed, remember it is OR, and decide whether that is what you meant. Four: ask whether the date combination exists on a real calendar, and which timezone will evaluate it.
Then confirm against the projected fire times rather than against your reading of the shorthand. The expanded sets and the next-run list are the ground truth; the expression is only a compact way of writing them. When a schedule matters — a billing run, a backup, a data deletion — check the first few projected times in the server's timezone and keep that output with the change. A schedule you have verified once is a schedule you do not have to think about again.
Frequently asked questions
The questions people ask most about cron syntax explained: five fields and traps, answered directly.