Cron special characters explained
A cron expression looks like a row of numbers and symbols, and most of the confusion comes from four small characters that control when a job runs. Once you know what each one means, you can read any schedule at a glance and write your own without guessing.
The five fields
A standard cron line has five fields, separated by spaces, in a fixed order:
┌ minute (0-59)
│ ┌ hour (0-23)
│ │ ┌ day of month (1-31)
│ │ │ ┌ month (1-12)
│ │ │ │ ┌ day of week (0-6, Sunday is 0)
│ │ │ │ │
* * * * *
The job runs when the current time matches every field. The example above, five stars, matches every minute of every day.
Star, step, range, and list
Each field accepts the same four building blocks.
*(star) means every value the field allows. In the minute field it is every minute; in the month field it is every month.*/n(step) means every nth value, starting from the lowest.*/15in the minute field fires at minutes 0, 15, 30, and 45. You can also step inside a range, so0-30/10gives 0, 10, 20, 30.a-b(range) means every value from a to b inclusive.9-17in the hour field covers every hour from 9am through 5pm.a,b(list) means these specific values only.1,15in the day of month field fires on the 1st and the 15th. Lists can hold ranges and steps too, as in0,30or1-5,15.
Worked examples
Putting the pieces together makes the intent clear:
| Expression | Meaning |
|---|---|
*/5 * * * * | every 5 minutes |
0 * * * * | at the top of every hour |
0 9-17 * * 1-5 | hourly from 9am to 5pm, Monday to Friday |
30 2 1 * * | 2:30am on the 1st of every month |
0 0 * * 0 | midnight every Sunday |
Read each field left to right and the schedule falls out. 0 9-17 * * 1-5 is minute 0, hours 9 through 17, any day of month, any month, weekdays only.
Build it without memorizing
You do not have to hold all of this in your head. The Cron Generator lets you pick values for each field and shows the resulting expression with a plain English description and a preview of the next run times. It all runs in your browser, so the schedule you are building never leaves your device.
Start with the common patterns above, then adjust one field at a time. Steps and ranges cover almost every real schedule, and lists handle the rest. When a cron expression surprises you, the problem is usually the day fields rather than the characters themselves, which is worth reading about in common cron mistakes.