Cron Expression Generator
UpdatedHow do you read a cron expression? A cron expression has five fields: minute, hour, day of month, month and day of week. So */15 * * * * runs every 15 minutes, and 0 9 * * 1-5 runs at 9:00 on weekdays. The generator below builds expressions from presets, explains them in plain English and shows the next five run times.
Common schedules
What is a cron expression?
A cron expression is a five-field schedule string read by the classic Unix (Vixie) cron daemon. The fields, in order, are minute hour day-of-month month day-of-week. Each field accepts either a literal value, a wildcard, or one of the operators described below, and the daemon fires a job whenever the current wall-clock minute matches every field at once.
Worked example: 0 9 * * 1-5 resolves to "9:00 AM, Monday through Friday." Minute is 0, hour is 9, day-of-month and month are wildcards, and day-of-week is the range 1-5. Cron dates back to 1970s Unix, and Paul Vixie's 1987 rewrite became the version most Linux systems still descend from. GitHub Actions and Kubernetes parse the same five fields today.
Cron flavors and special characters
Three cron dialects dominate production systems, and each one counts fields differently. Mixing them up is the single most common reason a paste from Stack Overflow refuses to parse in the target scheduler.
Vixie cron uses five fields and is the dialect under classic crontab, GitHub Actions workflows, and Kubernetes CronJobs. Quartz uses six or seven fields, adding a leading seconds field and an optional trailing year field, and powers Spring Scheduler and the Quartz Java library. AWS EventBridge sits between the two with six fields (no seconds, but with year), and it explicitly disallows specifying both day-of-month and day-of-week in the same expression.
The operator alphabet also differs. Across all flavors, * matches any value, / defines a step, , joins a list, and - defines a range. Quartz adds four specials that Vixie does not understand: ? means "don't care" and is required when day-of-month and day-of-week are mutually exclusive, L means "last" (for example, last day of the month), W means "nearest weekday" to a given date, and # picks the nth weekday of the month (e.g., 2#1 for the first Monday). Our generator emits Vixie-style five-field output by default, which is the right target for the largest set of downstream schedulers.
Worked example, "every 15 minutes during business hours, weekdays only": */15 9-17 * * 1-5. Field one, */15, fires at minute 0, 15, 30, and 45 of every hour. Field two, 9-17, restricts to hours 9 through 17 inclusive. Fields three and four are wildcards, so the schedule applies on every day of every month. Field five, 1-5, restricts to Monday through Friday. The result is 36 fires per business day and zero fires on weekends.
Common pitfalls
Cron looks like a five-token string and feels trivially simple. The pitfalls below have all caused real production incidents, and they share one root cause: the expression appears to mean one thing in English while the scheduler reads it differently. We list the four that show up most often in postmortems.
- DST transitions are implementation-specific. A schedule like
30 2 * * *falls inside the hour that is skipped or repeated on transition days in many zones. Standard Linux cron runs a skipped fixed-time job right after the change and avoids a second run in the repeated hour, but other schedulers pick different rules, and none of them is portable. Schedule in UTC if timing matters; UTC never shifts, so the rule stays predictable across deploys. - The wildcard schedule
* * * * *runs every single minute. It is also the easiest expression to paste accidentally from a tutorial. A job hooked up that way against a downstream service with a 200ms latency floor will issue 1,440 requests per day and surface as a load anomaly long before it surfaces as a scheduling bug. - Specifying both day-of-month and day-of-week in classic Vixie cron treats them as a logical OR.
0 0 1 * 1fires on the 1st of the month or on every Monday, not on Mondays that fall on the 1st. Quartz avoids the trap by not allowing both: one of the two fields must be?. The bug stays invisible for weeks, then surfaces on the one date that exposes the OR. - Classic cron has no second-precision. Minimum granularity is one minute, and there is no seconds field to set. For sub-minute cadence, the right tools are Quartz (with its leading seconds field), systemd timers (for example
OnCalendar=*:*:0/30), or an external scheduler such as Temporal or a queue-driven worker.
When to use this tool
We built the generator for three concrete workflows. The first is a backend developer wiring a GitHub Actions workflow to run a nightly data import: pick a preset or set the fields, read the plain-English description back, and paste the five-field expression into the schedule: block. GitHub runs schedules in UTC unless you add a timezone field next to the cron line, and checking the next-run preview against that avoids the off-by-one-hour bugs that plague hand-written cron. The second is an ops engineer setting up a Kubernetes CronJob for nightly database backups, where spec.schedule also expects five-field syntax, spec.timeZone pins the zone, and the next-run preview confirms the job fires when expected. Our Kubernetes CronJob schedule page has a copyable manifest with the time zone, overlap and history fields filled in. The third is a cloud architect translating a schedule for AWS EventBridge, where the six-field dialect needs a year field and a ? in either day-of-month or day-of-week, as described above.
Frequently asked
What's the difference between Vixie cron and Quartz?
Vixie cron uses 5 fields (minute, hour, day of month, month, day of week) and is what crontab, GitHub Actions and Kubernetes CronJobs read. Quartz uses 6 or 7 fields, adding a leading seconds field and an optional year, plus the special characters ?, L, W and #. AWS EventBridge sits between them: 6 fields with a year but no seconds, and Quartz-style specials.
Why does my cron job run at the wrong time?
Three causes dominate. The scheduler runs in a different timezone than you assumed (often UTC), a daylight saving change shifted or skipped the run, or the fields are in the wrong order: Vixie is minute, hour, day of month, month, day of week. If timing matters, schedule in UTC and convert for display.
How do I schedule for the last day of the month?
Vixie cron has no L, so run on days 28 to 31 and check whether tomorrow is the 1st: 0 0 28-31 * * [ "$(date -d tomorrow +\%d)" = "01" ] && /path/to/job (the % must be escaped inside a crontab). Quartz supports it directly with 0 0 0 L * ?, and AWS EventBridge with cron(0 0 L * ? *). Kubernetes CronJobs follow Vixie syntax, so they need the script check too.
Does my cron schedule respect Daylight Saving Time?
It depends on the scheduler. Standard Linux cron runs fixed-time jobs from a skipped spring-forward hour right after the change and avoids running them twice in the repeated fall-back hour, while jobs that run more often than hourly just follow the clock. GitHub Actions uses UTC unless you add a timezone field to the schedule, and Kubernetes uses the controller manager's timezone unless you set spec.timeZone, which has been stable since Kubernetes 1.27.
What's the most frequent schedule cron supports?
Classic cron stops at one minute: * * * * * runs every minute and there is no smaller unit. Quartz goes down to seconds with its leading field, so 0/10 * * * * ? runs every 10 seconds. On Linux without Quartz, a systemd timer with OnCalendar=*:*:0/30 (and AccuracySec=1s) runs every 30 seconds; GitHub Actions won't schedule more often than every 5 minutes.
Sources: crontab(5) manual page · Kubernetes CronJob docs · GitHub Actions schedule event. How we check our data