DeveloperMar 9, 2026 · Updated Oct 13, 2026 · 4 min read

How to Build a Cron Expression (With Examples)

Build cron expressions field by field, with what steps really do when they do not divide evenly (measured: */7 leaves a 4-minute gap each hour), how cronie decides the day-of-month/day-of-week OR rule, and how Quartz, AWS and GitHub Actions differ.

⏰
Try the Cron Builder
Free, no signup
→
DG
Derek Giordano
Designer & Developer
In this guide
01The Five Fields02Common Schedules03Steps That Do Not Divide Evenly: Measured04Day of Month and Day of Week Together05Not Every "Cron" Is Five Fields

The Five Fields

A standard crontab line has five fields: minute (0-59), hour (0-23), day of month (1-31), month (1-12 or JAN-DEC) and day of week (0-7 or SUN-SAT, where both 0 and 7 mean Sunday). Each field takes a value, a range (1-5), a list (1,15), a step (*/5 or 9-17/2) or * for every value. 30 9 * * 1-5 is 09:30 on weekdays.

Common Schedules

ScheduleExpression
Every 15 minutes*/15 * * * *
Hourly, on the hour0 * * * *
Daily at 02:3030 2 * * *
Weekdays at 18:000 18 * * 1-5
Every 2 hours in working hours0 9-17/2 * * 1-5 (09, 11, 13, 15, 17)
First of the month at noon0 12 1 * *
Sundays at 02:000 2 * * 0

Steps That Do Not Divide Evenly: Measured

A step does not mean "every n units forever". It means every n-th value within the field, starting again at the field's first value each hour, day or month. When n does not divide the field evenly, the last interval is short. We listed the next runs with croniter and with our own cron engine (they agree on all seven; October 13, 2026, UTC):

ExpressionWhat people expectWhat runsIntervals
*/7 * * * *every 7 minutes:00, :07 … :56, then :007 min, plus a 4-min gap each hour
*/25 * * * *every 25 minutes:00, :25, :50, :0025, 25, 10 min
*/45 * * * *every 45 minutes:00, :45, :00, :4545, 15 min
0 */5 * * *every 5 hours00, 05, 10, 15, 20, 005 h, plus 4 h overnight
0 */7 * * *every 7 hours00, 07, 14, 21, 007 h, plus 3 h overnight
0 0 */10 * *every 10 days1st, 11th, 21st, 31st10 days, or 1 day after the 31st
0 9-17/2 * * 1-5every 2 hours, 9-1709, 11, 13, 15, 172 h, then 16 h

If you need a true fixed interval that does not fit the field, cron cannot express it in one line. Use a divisor of 60 or 24, run more often and let the job skip work it does not need, or use a scheduler with interval syntax (a systemd timer with OnUnitActiveSec=, for example).

Day of Month and Day of Week Together

When both day fields are restricted, cron runs on days matching either: 0 0 13 * 5 runs on the 13th and on every Friday, not only on Friday the 13th. The detail most guides miss is how cron decides a field is "restricted". In cronie, the cron on most Linux systems, a field counts as unrestricted whenever it starts with an asterisk, including steps like */10; if either field is unrestricted, the two are ANDed. So 0 0 */10 * 1 in cronie runs only on Mondays that fall on the 1st, 11th, 21st or 31st (next: December 21, 2026), while croniter, a widely used Python library, treats */10 as restricted and runs on those dates or any Monday. Check which your scheduler follows before combining a day-of-month step with a weekday.

Testing this turned up a bug in our own tools: with */10 in the day-of-month field and * for the weekday, the shared engine behind the Cron Builder, Crontab Explainer and Cron Next Fire matched every day. It now follows cronie's rule exactly (fixed October 13, 2026).

Not Every "Cron" Is Five Fields

The Cron Builder writes five-field POSIX expressions, describes them in English and lists the next five runs in a time zone you choose.

Frequently Asked Questions

What is a cron expression?+
A cron expression is a five-field string that defines a schedule for recurring jobs. The fields are minute, hour, day of month, month, and day of week. Each field uses numbers, wildcards, ranges, or steps to define when the job runs.
How do I schedule a cron job for every 5 minutes?+
*/5 * * * *. Five divides 60, so the runs are evenly spaced (:00, :05 … :55). A step that does not divide the field, such as */7, restarts at :00 every hour and leaves a shorter gap.
What does * mean in a cron expression?+
The asterisk (*) is a wildcard that matches every possible value for that field. In the hour field, * means 'every hour.' In the day-of-month field, * means 'every day.'
Try it yourself

Use the Cron Builder — free, no signup required.

⚡ Open Cron Builder
DG
Derek Giordano
Written by the creator of Ultimate Design Tools. BA in Business Marketing.