⏰ 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.
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 — and that 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
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` does not mean "Friday the 13th" — it means the 13th of every month AND every Friday. 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 are conveniences of Vixie cron and derivatives, not 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?
What does */5 mean in a cron expression?
What do the five fields mean?
Is Sunday 0 or 7?
What happens if I set both day of month and day of week?
What does the slash mean in a cron expression?
Which time zone does a cron job use?
Why is my cron job not running?
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