Cron Generator
Build a cron schedule and see when it will run.
- Local by default
- No signup
- AI is opt-in
Build with controls
minute · hour · day · month · weekday0–59
0–23
1–31
1–12
0=Sun
Next 5 runs
Cron expressions are compact and unforgiving: a single misplaced field can turn "every five minutes" into "once a year". Build the schedule with the controls below, or paste an existing expression to decode it, and preview the next five runs in the timezone your servers actually use.
The five fields, left to right
A standard cron expression is five whitespace-separated fields: minute hour day-of-month month day-of-week. Minute runs 0–59, hour 0–23, day of month 1–31, month 1–12, and day of week 0–6 with Sunday as 0 (7 is also accepted as Sunday by most implementations).
# ┌ minute (0-59)
# │ ┌ hour (0-23)
# │ │ ┌ day of month (1-31)
# │ │ │ ┌ month (1-12)
# │ │ │ │ ┌ day of week (0-6, Sunday=0)
# │ │ │ │ │
0 9 * * 1-5 → 09:00 every weekday Special characters
*means "every value" for that field.*/5means "every 5th value starting from the minimum", so in the minute field it is every five minutes.1-5is an inclusive range.1,15,30is a list of specific values.0-30/10combines a range with a step: 0, 10, 20, 30.
Macros such as @daily, @hourly and @weekly are widely supported and expand to the standard five fields. They are convenient in crontabs but are not understood by every scheduler — prefer the explicit form in application configuration.
Day of month and day of week together
This is the most misunderstood rule in cron. When both day-of-month and day-of-week are restricted, classic cron treats them as an OR, not an AND. The expression 0 0 1 * 1 fires on the first of the month and on every Monday — not only when the first falls on a Monday. To get an AND, most implementations require a workaround, and some (Quartz) use ? to explicitly say "no constraint" for one of the two fields.
Timezones and daylight saving
Cron itself has no concept of a timezone. The daemon evaluates the schedule in its own configured zone — usually the server’s, which is often UTC in production. That means a "9am" job on a UTC server runs at 09:00 UTC, not 09:00 for your users. Set CRON_TZ (where supported) or schedule in UTC and convert in code.
Daylight saving creates two hazards. In spring, a job scheduled for 02:30 may not run at all because that wall-clock time does not exist. In autumn it may run twice because 02:30 occurs on both sides of the transition. Jobs that must run exactly once per day should be scheduled off the 01:00–03:00 window, or guarded by an idempotency check.
Unix cron versus Quartz and systemd
- Unix/Vixie cron: five fields. No seconds. Day-of-week 0–6.
- Quartz (Java): six or seven fields with seconds first, plus
?,L(last) andW(nearest weekday). The leading seconds field is the most common source of copy-paste bugs. - systemd timers: not cron syntax at all.
OnCalendar=uses a date-like grammar with far better DST handling, andPersistent=truecatches up on missed runs.
Verifying a schedule before you ship it
Read the human-readable sentence above, then check the next five run times against what you expect — including the gap between runs, not just the first one. A schedule that looks right at 09:00 can still drift by an hour after a DST change. For anything billing-related, add a log line with the run id so duplicate executions are visible.
Frequently asked questions
How do I write "every 5 minutes" in cron?
Use */5 * * * *. The first field, minute, takes the step; the remaining four are wildcards. Writing 5 * * * * instead means "five minutes past every hour", which is a common and expensive mistake.
How do I run a job every weekday at 9am?
0 9 * * 1-5. Minute 0, hour 9, any day of month, any month, Monday through Friday. Remember this runs at 09:00 in the scheduler’s timezone, which is often UTC on servers.
Why did my cron job run twice?
The two usual causes are daylight saving (a wall-clock time that occurs twice) and overlapping runs where the previous execution had not finished. Add a lock or idempotency key, and avoid scheduling inside the 01:00–03:00 local window.
Does cron support seconds?
Standard Unix cron does not. Quartz and some libraries add a leading seconds field, producing six fields. If you paste a six-field expression into a five-field scheduler, every field shifts and the schedule changes silently.
What is the difference between @daily and 0 0 * * *?
None functionally — @daily, @midnight and 0 0 * * * all mean midnight every day. Macros are shorthand, but support varies; stick to explicit fields in configuration files and infrastructure-as-code.