Cron Expression Generator
A cron generator with plain-English output, common recipes, and the field-count differences for Quartz, Spring and AWS that break copied expressions.
| Calculating from your clock… |
What Cron Expression Generator Does
A cron expression is a compact schedule. Standard Unix cron uses five fields (minute, hour, day of month, month, day of week), and a job runs whenever the current time matches all of them.
Two things trip people up. The first is that Quartz, Spring and several Java schedulers use six or seven fields, adding seconds at the front and sometimes a year at the end, so an expression copied between them is silently off by one position. The second is the day-of-month and day-of-week rule, which is an OR rather than an AND. That one is genuinely counter-intuitive.
This generator builds and explains standard five-field cron expressions. If your scheduler is Quartz or Spring, read the field-count table below before copying anything across.
How to Use Cron Expression Generator
- Choose a popular cron preset (every 5 min, daily at midnight, etc.) or set custom fields
- Modify Minute, Hour, Day, Month, or Weekday fields
- Read the human-friendly English schedule description
- Click Copy Cron Expression to paste into your crontab or GitHub Actions
How Cron Expression Generator Works
Expanding a cron expression into run times
each of the 5 fields → the set of values it allows (lists "," · ranges "-" · steps "/" · names) → a minute runs when minute, hour and month all match and the day rule passes → scan forward minute by minute for the next 5 matches
- fields
- minute 0–59, hour 0–23, day of month 1–31, month 1–12 or jan–dec, day of week 0–7 or sun–sat, where both 0 and 7 mean Sunday.
- step a/n
- Every nth value starting from a (or from the field minimum for *). */15 in the minute field is 0, 15, 30, 45.
- day rule
- If both day fields are restricted, either one matching is enough (OR). A field that starts with *, including */2, counts as unrestricted, as in Vixie cron and cronie.
- next runs
- Computed in your browser's local time zone, up to four years ahead so an impossible date such as 30 February ends the search instead of looping.
Worked example
0 9 * * 1-5, checked on Friday 25 September 2026 at 10:00
- minute = {0}, hour = {9}: only 09:00 qualifies
- day of month and month are *, so only day of week restricts the date
- day of week 1-5 = Monday through Friday; today's 09:00 has already passed
- Saturday and Sunday fail the day rule
Result: Described as "At 09:00, on Monday, Tuesday, Wednesday, Thursday, and Friday." Next runs: Mon 28 Sep, Tue 29 Sep, Wed 30 Sep, Thu 1 Oct, Fri 2 Oct 2026, each at 09:00.
The Five Standard Fields
In order. A job runs when the current time matches every field.
| Position | Field | Allowed values | Notes |
|---|---|---|---|
| 1 | Minute | 0–59 | |
| 2 | Hour | 0–23 | 24-hour clock; 0 is midnight |
| 3 | Day of month | 1–31 | See the OR rule below |
| 4 | Month | 1–12 or JAN–DEC | |
| 5 | Day of week | 0–7 or SUN–SAT | Both 0 and 7 mean Sunday |
Source: POSIX — crontab (The Open Group Base Specifications)
Field Count by Scheduler — the Copy-Paste Trap
An expression written for one of these will not mean the same thing in another. Check the count before pasting.
| Scheduler | Fields | Starts with | Example: every day at 02:30 |
|---|---|---|---|
| Unix / Linux crontab | 5 | Minute | 30 2 * * * |
| Quartz | 6 or 7 | Seconds | 0 30 2 * * ? |
| Spring (@Scheduled) | 6 | Seconds | 0 30 2 * * * |
| AWS EventBridge | 6 | Minute (year at end) | 30 2 * * ? * |
| Kubernetes CronJob | 5 | Minute | 30 2 * * * |
Common Schedules
| Expression | Meaning |
|---|---|
| */5 * * * * | Every 5 minutes |
| 0 * * * * | Every hour, on the hour |
| 0 2 * * * | Every day at 02:00 |
| 0 9 * * 1-5 | Weekdays at 09:00 |
| 0 0 1 * * | First day of every month at midnight |
| 0 0 * * 0 | Every Sunday at midnight |
| */15 9-17 * * 1-5 | Every 15 minutes, 9am–5pm, weekdays |
| 0 0 1 1 * | Once a year, 1 January |
Syntax Elements
| Symbol | Means | Example |
|---|---|---|
| * | Every value | * * * * * — every minute |
| , | List | 0,30 * * * * — on the hour and half past |
| - | Range | 0 9-17 * * * — hourly from 9 to 17 |
| / | Step | */10 * * * * — every 10 minutes |
| @daily | Shorthand | Equivalent to 0 0 * * * |
| @reboot | At startup | Not supported by every implementation |
How to Read Your Result
Day-of-month and day-of-week are ORed, not ANDed
This is the rule that surprises almost everyone. POSIX states that if both the day-of-month and the day-of-week fields are restricted, a job runs when *either* matches. So `0 0 13 * 5` means the 13th of every month AND every Friday, not "Friday the 13th". To get Friday the 13th you must restrict one field and test the other inside the command itself.
Check which timezone the scheduler uses
Cron normally runs in the server's local timezone, which means daylight saving transitions cause jobs to be skipped or run twice each year. Many managed schedulers default to UTC instead. A job scheduled for 02:30 local time may not run at all on the spring-forward night. Where it matters, schedule in UTC or avoid the 01:00–03:00 window.
Steps do not mean "every N from now"
*/20 in the minute field fires at :00, :20 and :40. It steps from the start of the range, not from when you installed the job. And a step that does not divide evenly produces uneven gaps: */7 fires at 0, 7, 14, 21, 28, 35, 42, 49, 56 and then waits only 4 minutes before 0 again.
Cron does not guarantee a run
If the machine is off, or the previous run is still going, standard cron simply skips or overlaps depending on the implementation. It has no retry, no catch-up and no concurrency control. Anything that must not overlap needs its own lock, and anything that must not be missed needs a scheduler with catch-up semantics.
Limitations & Accuracy Notes
- This generator produces standard five-field expressions. Quartz and Spring six-field formats, and the non-standard L, W and # characters they support, are not generated here.
- Next-run times are computed in your browser's timezone. Your server may differ, and that difference is a frequent source of "the job ran at the wrong time".
- Daylight saving behavior varies by implementation. Some run a skipped job immediately after the transition, some do not run it at all, and some run a repeated hour twice.
- @reboot, @yearly and similar shorthands come from Vixie cron and its derivatives rather than POSIX, and are not universally supported.
- The expression describes when a job is *eligible* to start. It says nothing about whether the machine is awake, whether the previous run finished, or what happens on failure.
Frequently Asked Questions
What do the 5 fields of a standard Cron expression mean?
The standard 5 cron fields represent: Minute (0-59), Hour (0-23), Day of Month (1-31), Month (1-12), and Day of Week (0-6, where 0 is Sunday).
What does */5 mean in a cron expression?
The slash step operator */5 in the minute position means "execute every 5 minutes" (e.g. at minutes 0, 5, 10, 15, etc.).
What does an asterisk (*) mean in a cron field?
It means “every” value for that field. An asterisk in the hour field matches every hour, so an expression of all asterisks runs every minute of every day.
Some systems use a 6th or 7th cron field — what is that?
Some schedulers add a seconds field before minutes or a year field at the end. The standard 5-field format (minute, hour, day-of-month, month, day-of-week) is the most widely supported baseline.
What do the five fields mean?
In order: minute, hour, day of month, month, and day of week. A standard cron expression has exactly five. Some systems add a sixth leading field for seconds and a few add a trailing year field, which is why an expression copied between platforms sometimes fails.
Is Sunday 0 or 7?
Both, in most implementations: the day-of-week field accepts 0 and 7 for Sunday, with Monday as 1. Names such as SUN and MON are also widely supported but not universal, so numbers are safer if the expression has to be portable.
What happens if I set both day of month and day of week?
This is the single biggest cron gotcha. When both are restricted, standard cron runs the job if either matches rather than requiring both, so "1 * * 1" fires on the first of the month and on every Monday. To require both conditions you need a different scheduler or a guard inside the job.
What does the slash mean in a cron expression?
It is a step. */15 in the minute field means every fifteenth minute starting from zero, so at :00, :15, :30 and :45. It does not mean "every 15 minutes from now", which is why a job set to */90 in a 0–59 field never behaves as people expect.
Which time zone does a cron job use?
The server's local time zone unless the scheduler is configured otherwise, which makes daylight saving a real hazard: a job scheduled inside the skipped hour may not run at all in spring, and may run twice in autumn. Scheduling in UTC avoids both.
Why is my cron job not running?
Beyond the expression itself, the usual causes are a different environment (cron runs with a minimal PATH and few environment variables), relative paths that resolve elsewhere, and a script without an executable bit. Redirecting output to a log file is the fastest way to find out which.
References & Further Reading
- POSIX — crontab (The Open Group Base Specifications Issue 7) — Normative field definitions, and the source of the day-of-month / day-of-week OR rule quoted above