Cron syntax: the five fields and every symbol
A cron expression is five values separated by spaces. Once you can read the five places, you can read any schedule.
The five fields
Standard cron, the kind used in a Linux or Mac crontab, in GitHub Actions and in Kubernetes, reads five fields from left to right.
| Position | Field | Allowed values |
|---|---|---|
| 1 | Minute | 0 to 59 |
| 2 | Hour | 0 to 23 (24-hour clock) |
| 3 | Day of the month | 1 to 31 |
| 4 | Month | 1 to 12, or JAN to DEC |
| 5 | Day of the week | 0 to 6 with 0 = Sunday, or SUN to SAT. Most Linux cron also accepts 7 as Sunday |
The first row of a table is its heading, so the order to remember is "minute, hour, day, month, weekday": small units first, then bigger ones, then the odd one out. Cron looks at the clock once a minute. When the minute, the hour and the month all match, and the day rule matches, the command runs.
The four symbols
- **
*(star)** means every value the field allows. A star in the minute field is every minute. ,(comma) makes a list.1,15in the day field is the 1st and the 15th. A list can mix single values and ranges, such as0-4,8-12.-(hyphen) makes a range, inclusive at both ends.9-17in the hour field means 9, 10, 11 up to and including 17. The first number must not be larger than the second./(slash) sets a step.*/15means "every 15th value". A step can follow a range too:0-23/2in the hour field means every second hour.
Names are allowed in the month and weekday fields: the first three letters, in any case. mon,wed,fri and jan-mar are both fine, and the cron manual notes that ranges and lists of names are allowed.
Reading an expression in four steps
Take 30 8 * * 1-5. Read it field by field. Minute: 30. Hour: 8. Day of the month: every day. Month: every month. Day of the week: 1 to 5, which is Monday to Friday. Together: "at 08:30 on weekdays". Now take 0 */4 1,15 * *: minute 0, every fourth hour (0, 4, 8, 12, 16, 20), on days 1 and 15 of every month, which is six runs on each of those two days.
Where it differs between systems
Not every system reads the same five fields in exactly the same way:
- Linux and Mac crontab (the cronie manual page, dated 3 August 2026): numbers 0-7 for the weekday, names, steps, ranges, lists, and shortcuts such as
@daily. - GitHub Actions documents POSIX syntax with days 0 to 6 or SUN-SAT, a start-and-step such as
20/15, runs in UTC unless you set a time zone, and allows no more often than every 5 minutes. - Kubernetes CronJob documents 0 to 6 for the weekday, accepts
?as another way to write*, and also accepts shortcuts like@monthly. - Quartz uses six or seven fields (a seconds field in front, an optional year at the end) and counts the weekday from Sunday = 1. Spring's own cron class has six fields and follows ordinary weekday numbers. See the Quartz guide.
The tool on the home page has a type selector for these four, so you can paste an expression and see whether it is accepted where you plan to use it.
Frequently asked
Is the first field minutes or seconds?
Minutes in standard five-field cron. Only Quartz and Spring expressions (six or seven fields) start with seconds.
Can I use 24 for midnight in the hour field?
No. The hour field runs from 0 to 23, and midnight is 0.
Does cron care about spaces?
Fields are separated by one or more spaces or tabs. The tool above collapses extra spaces before reading.
This is an independent guide and tool. It is not connected with crontab.guru, Quartz, GitHub, Kubernetes, Spring or the Linux projects named here. Product names belong to their owners.