A cron expression looks like a row of punctuation that wandered away from its sentence: 0 9 * * 1-5. Nothing in it is labelled, the numbers mean different things depending on where they sit, and one wrong field can move a job from weekday mornings to the middle of the night. Yet the whole system is small: five fields, four operators and a fixed reading order cover every schedule standard cron can express.

This guide takes the syntax apart piece by piece: each field with its range, each operator with a small example you can check, and a reading method that works on any expression you meet. The free Cron Expression Builder on Ovatly is the checking tool throughout, because it describes any expression back in plain English and lists the next five run times in your local time zone.

Contents

  • Quick answer
  • The five fields, one at a time
  • The four operators
  • How to read and check an expression, step by step
  • Worked example: taking one expression apart
  • Limitations and honest notes
  • Common mistakes
  • FAQs
  • Conclusion

Quick answer

A cron expression is five fields in a fixed order: minute (0-59), hour (0-23), day of month (1-31), month (1-12) and day of week (0-7, where 0 and 7 are both Sunday). Each field holds either a single value or a value shaped by one of four operators: * means every value, a comma such as 1,3,5 builds a list of separate values, a hyphen such as 1-5 builds a continuous range, and a slash such as */15 steps through a range. A job fires when all five fields match the current time, with one exception covered below: the two day fields combine as either-or when both are restricted.

The five fields, one at a time

Minute (0-59). The minute of the hour at which the job fires. This field is what separates "hourly" from "every minute": 0 * * * * fires at the top of each hour, while five asterisks fire every minute.

Hour (0-23). The hour of the day on a 24-hour clock, so 9 is 09:00 and 21 is 21:00. There is no AM or PM marker; writing 9 when you meant 21:00 moves a job by twelve hours.

Day of month (1-31). The calendar day. A value of 1 means the first of the month, as in 0 0 1 * *, which fires at midnight on the first. Months without a 31st simply never match a value of 31.

Month (1-12). The month of the year, 1 for January through 12 for December. Most schedules leave this as an asterisk; restricting it builds quarterly or seasonal jobs.

Day of week (0-7). The weekday, with the numbering that catches everyone out: 0 and 7 both mean Sunday, 1 is Monday, 2 is Tuesday, 3 is Wednesday, 4 is Thursday, 5 is Friday and 6 is Saturday.

The four operators

Asterisk: every value. * in a field means the field matches always. In 0 0 * * *, the asterisks in the day-of-month, month and day-of-week fields are what make the schedule daily: nothing about the date restricts it, so it fires at midnight every day.

Comma: a list of separate values. 0 9 * * 1,3,5 fires at 09:00 on Monday, Wednesday and Friday. The list picks individual values and skips everything between them, which a range cannot do. The same operator works in any field: 0,30 * * * * fires at minute 0 and minute 30 of every hour.

Hyphen: a continuous range. 0 9 * * 1-5 fires at 09:00 Monday to Friday, because the range covers every value from 1 to 5 with no gaps. Ranges work in every field: 0 9-17 * * * fires at minute 0 of every hour from 09:00 through 17:00.

Slash: a step through a range. */15 * * * * fires every 15 minutes, at minutes 0, 15, 30 and 45. The number after the slash is the step size. A step can start from a range rather than the whole field: 0 9-17/2 * * * fires at 09:00, 11:00, 13:00, 15:00 and 17:00, stepping two hours at a time through the range 9 to 17.

Operators combine freely, though most fields use just one.

How to read and check an expression, step by step

  1. Take any expression and split it into its five space-separated fields. If there are not exactly five, it is not standard cron.
  2. Name each field by position: minute, hour, day of month, month, day of week. Never read a number before naming its field.
  3. Translate each field using its range and operator into plain words: a value, every value, a list, a range or a step.
  4. Paste the expression into the lower field of the Cron Expression Builder. It explains the expression back to you in plain English.
  5. Compare the builder's description with your own reading, then check the next five run times listed below it, shown in your local time zone. If a run lands on a day or hour you did not expect, your reading of some field was wrong.

Worked example: taking one expression apart

Consider this expression:

30 8 * * 1,3,5

Reading it field by field:

  1. Minute: 30. The job fires at half past the hour.
  2. Hour: 8. The firing time is 08:30.
  3. Day of month: asterisk. Every calendar day matches.
  4. Month: asterisk. Every month matches.
  5. Day of week: 1,3,5. A comma list: Monday, Wednesday and Friday only.

Put together: the job fires at 08:30 on Mondays, Wednesdays and Fridays. Pasting the expression into the builder gives the matching plain-English description, and the next-run list shows the pattern in real dates: from a Tuesday, the next runs fall on Wednesday, Friday and the following Monday, all at 08:30 local time.

Limitations and honest notes

This syntax is standard five-field cron. Quartz-style schedulers add a seconds field at the front and sometimes a year field at the end, and the builder does not include either. A six or seven field expression read as standard cron will be misread by one field, which is enough to move a job by hours or days.

The builder lists next run times in your browser's local time. Servers usually schedule in UTC, so the times you check on screen may not be the times as the server's clock sees them. Convert deliberately when the two zones differ.

One behaviour deserves repeating: when both the day-of-month and day-of-week fields are restricted, a day matches if either field matches. A schedule restricted to the 1st and to Mondays fires on the 1st and on every Monday. Every other combination of fields works as a strict and.

Common mistakes

  • Reading the fields in the wrong order. Minute comes first, hour second. Swapping them produces a job that fires at the wrong time, or never.
  • Counting Sunday as 1. In the day-of-week field, 1 is Monday and Sunday is 0 or 7.
  • Using a range where a list was meant. 1-5 includes Tuesday and Thursday; 1,3,5 does not. The hyphen and the comma are not interchangeable.
  • Forgetting that the slash needs a base. */15 steps through the whole range; 9-17/2 steps through part of it. A slash on its own means nothing.
  • Pasting a Quartz expression into standard cron. The extra seconds field shifts every other field one position to the right, and the schedule that results is nonsense that still looks plausible.

FAQs

What are the five fields of a cron expression, in order? Minute (0-59), hour (0-23), day of month (1-31), month (1-12) and day of week (0-7, where both 0 and 7 are Sunday). The order never changes, and reading an expression means reading those five positions from left to right.

What does an asterisk mean in cron? An asterisk means every value of that field. An asterisk in the hour field means every hour, and an asterisk in the month field means every month. Five asterisks fire every minute of every day.

What is the difference between a list and a range? A range with a hyphen covers every value between two points, so 1-5 in the day-of-week field means Monday, Tuesday, Wednesday, Thursday and Friday. A list with commas picks separate values, so 1,3,5 means Monday, Wednesday and Friday only.

*What does /15 mean? The slash means step through the range. In the minute field, */15 steps through the hour in steps of 15, firing at minutes 0, 15, 30 and 45. The full expression */15 * * * * runs every 15 minutes.

Does cron syntax include seconds or a year field? Standard cron has five fields only. Seconds and year fields belong to Quartz-style schedulers, and the Cron Expression Builder does not include them. An expression written for those systems needs the extra fields removed before it can be read as standard cron.

Conclusion

Cron syntax is five fields and four operators, and the skill is reading, not memorising: name each field by position, translate its operator, then verify the whole thing in the Cron Expression Builder before trusting it. To see the syntax doing a specific job, the companion guide on how to run a cron job only on weekdays builds the weekday schedule from these same pieces, and the full set of guides for this category lives in the Developer Tools guides archive.