Learn cron
Complete guide to cron syntax
A cron expression is a short string that tells a scheduler when to run a job. This guide walks
through every field and every special character — *,
/, - and , —
with real examples and live next-run times.
*/15 9-17 * * 1-5 That reads "every 15 minutes, between 9 AM and 5 PM, Monday to Friday". Change any part of it with the cron builder on the homepage.
- your local time
- your local time
- your local time
- your local time
- your local time
The five fields
A standard cron expression is five space-separated fields. In order they are minute, hour, day of month, month, and day of week:
| Position | Field | Allowed values | Wildcard |
|---|---|---|---|
| 1 | Minute | 0–59 | * |
| 2 | Hour | 0–23 | * |
| 3 | Day of month | 1–31 | * |
| 4 | Month | 1–12 or JAN–DEC | * |
| 5 | Day of week | 0–6 (or 7) or SUN–SAT | * |
A field set to * means “every value in range”. So the minimal expression
* * * * * runs every minute of every day. In the day-of-week field,
0 is Sunday and 6 is Saturday; most daemons
also accept 7 as an alias for Sunday. The hour field uses 24-hour time:
hour 0 is midnight and hour 23 is 11 PM.
The first two fields together describe the time of day; the last three describe the dates. This mental split is the fastest way to read any expression: look for the minute and hour first, then check which days qualify.
The asterisk * and steps with /
The asterisk selects every legal value of a field. On its own it is the “always” wildcard, but it becomes
much more powerful when combined with the step operator /:
*/5 in the minute field means every 5th minute (0, 5, 10 … 55).
The number after the slash is the increment, and it starts from the lowest value of the field:
*/2 in the hour field runs at hours 0, 2, 4 … 22.
Steps also attach to ranges: 9-17/2 in the hour field means 9, 11, 13, 15
and 17. A step on a single number, like 5/15 in the minute field, starts at
that value and counts up: 5, 20, 35, 50. This is how you offset an interval away from the top of the hour.
The most famous step expression is */5 * * * * — every 5 minutes;
every 15 minutes is */15 * * * *.
Ranges with - and lists with ,
The hyphen creates an inclusive range: 1-5 in the day-of-week
field means Monday through Friday, and 9-17 in the hour field means the
business day. The comma builds an explicit list: 0,30 in the
minute field runs twice per hour, and 1,15 in the day-of-month field runs
twice per month. Lists and ranges can be mixed inside one field, for example
0,15,30-45, which means minutes 0, 15 and 30 through 45.
A range whose start is larger than its end wraps around, matching cron's numeric order — so
22-2 in the hour field selects 22, 23, 0, 1 and 2. This is rarely needed but
occasionally shows up in night-shift schedules.
Month and weekday names
Most cron implementations accept three-letter English names for the month and weekday fields, which makes
schedules far more readable: JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV,
DEC and SUN, MON, TUE, WED, THU, FRI, SAT. Names and numbers can be
combined, e.g. 0 0 1 JAN * runs at midnight on the first of every January.
Your system may also accept full names — check the man page for your specific cron daemon.
The day-of-month vs day-of-week quirk
Here is the detail that trips up more people than any other. When both the day-of-month field and
the day-of-week field are restricted, the standard Vixie-style cron daemon runs the job when
either one matches — an OR, not an AND. So 0 0 1 * 1 fires
on the first of the month and on every Monday. If you want a true intersection you must keep one of
the fields wildcarded and encode the other with a list, as in
0 0 1 * * for the first of the month.
This page's examples all avoid the trap deliberately.
Common expressions, decoded
| Expression | When it runs |
|---|---|
| * * * * * | Every minute |
| */5 * * * * | Every 5 minutes |
| */15 * * * * | Every 15 minutes |
| 0 * * * * | Every hour on the hour |
| 30 2 * * * | Every day at 2:30 AM |
| 0 0 * * 1 | Every Monday at midnight |
| 0 9 * * 1-5 | Weekdays at 9:00 AM |
| 0 0 1 * * | First day of every month at midnight |
| 0 12 1,15 * * | Noon on the 1st and 15th of every month |
| 15 10 * * 0,6 | Weekends at 10:15 AM |
Every one of these schedules has a dedicated page with a full explanation and live run times. Browse them in the pattern grid below, or jump straight to every hour, daily at midnight, every Monday, weekdays only, every Sunday, first of the month, every 5 minutes and every 15 minutes.
Six-field and seconds variants
Standard Unix cron stops at minute resolution — there is no seconds field. Some systems extend the format:
Quartz, Node-cron and Python APScheduler accept a leading
seconds field, producing six fields like */15 * * * * *. Quartz additionally
supports question marks and the L, W and
# operators, which are not part of the traditional format. If a tool rejects
your five-field string, a missing or extra field is the first thing to check.
Timezones and daylight saving
Cron evaluates schedules against the local time of the machine running it, not a UTC time you
specify. A server in UTC and a server in Los Angeles run 0 9 * * * at different
real-world moments. Most daemons evaluate on wall-clock time, so during daylight saving transitions a daily
job can fire twice, once, or at an offset hour. If your schedule must be timezone-stable, either pin the
server to UTC or use a scheduler with explicit timezone support and verify with a tool that prints the next
run times in the target zone.
How to test and preview a cron expression
A cron expression is easy to misread and easy to mis-type, so never rely on eyeballing it. The safest habit
is to compute the actual next run times before you ship a job — exactly what the
builder on this site does: paste or build an expression and it lists the next five
occurrences in your local timezone. That instantly catches classic errors like putting a weekday in the
day-of-month field or using 24 for midnight (the hour field tops out at 23).
On a real server you can also review the daemon's own view of a user's crontab with
crontab -l. Some systems log when jobs were attempted — journald on
modern Linux exposes a CRON unit, and classic distributions log to
/var/log/syslog or /var/log/cron. A job that
never appears in the logs usually means the expression never matched (wrong timezone or an impossible date
combination), not that the command is broken.
Cron expressions in the real world
The five-field format is a de-facto standard that appears far beyond Unix crontabs:
- Linux cron daemons — the classic crontab described on the
crontab vs cron page, reading user files and the system
/etc/cron.ddirectory. - Kubernetes CronJob — each
CronJobspec takes aschedulefield in exactly this five-field syntax. - GitHub Actions — workflow
scheduletriggers use cron expressions (with cron's quirk that@hourly-style shortcuts are also accepted) and run in UTC. - AWS EventBridge and Google Cloud Scheduler — both take cron expressions and let you pin a timezone.
- Application schedulers — Quartz (Java), Node-cron, Python APScheduler and Go's robfig/cron all parse the same syntax, sometimes with an optional leading seconds field.
Because the string is portable, the same expression works across every one of these — which is the best reason to learn the five fields once and reuse them everywhere.
Common mistakes (and how to avoid them)
- Using 24 for midnight — hours run 0–23; midnight is
0, so the daily job is0 0 * * *. - Numbering the week from Monday — cron starts Sunday at
0. “Weekdays” is1-5, not2-6. - Putting both day fields in one schedule — the OR behavior of day-of-month and
day-of-week (covered above) almost never does what you expect; keep one of them
*. - Ignoring timezone — the daemon uses the machine's local time, so test with a preview that prints real timestamps rather than assuming your laptop's zone.
- Forgetting the command — a crontab line needs both the expression and the command; the expression alone schedules nothing.
- Expecting second resolution — traditional cron only fires on whole minutes; for second-level triggers you need a six-field extension or a dedicated scheduler.
Frequently asked questions
Below are the questions people ask most about cron expressions, matching the structured FAQ markup on this page. The crontab vs cron page explains how these expressions plug into your system.
Every 5 minutes
*/5 * * * * Run a job every 5 minutes around the clock with */5 * * * *.
Every 15 minutes
*/15 * * * * Quarter-hour scheduling with */15 * * * * — 96 runs a day.
Every hour
0 * * * * Fire a job on the hour every hour with 0 * * * *.
Every day at midnight
0 0 * * * The classic daily job: 0 0 * * * runs at 12:00 AM every day.
Every Monday
0 9 * * 1 A weekly Monday morning job with 0 9 * * 1.
First day of month
0 0 1 * * Monthly billing and reporting jobs start with 0 0 1 * *.
Weekdays only
0 9 * * 1-5 Business-hours scheduling with 0 9 * * 1-5 (Mon–Fri).
Every Sunday
0 9 * * 0 A weekly Sunday routine with 0 9 * * 0.