How to create a cron expression
- 1.
Pick a preset or use the builder
Click a preset such as “Weekdays at 9:00” or set the frequency in the builder.
- 2.
Edit the expression
Fine-tune the expression by hand - the explanation and run list update live.
- 3.
Check the next runs
Compare the next 10 run times (in your browser time zone) with what you expect.
- 4.
Copy it
Paste it into crontab -e, a GitHub Actions workflow or a Kubernetes CronJob.
Cron syntax - the five fields
A standard cron expression has five space-separated fields: minute hour day-of-month month day-of-week.
| Field | Range | Example |
|---|---|---|
| Minute | 0-59 | 30 - at minute 30 |
| Hour | 0-23 | 9-17 - 9:00 to 17:59 |
| Day of month | 1-31 | 1,15 - the 1st and 15th |
| Month | 1-12 or JAN-DEC | */3 - every 3 months |
| Day of week | 0-7 or SUN-SAT (0 and 7 = Sunday) | 1-5 - Monday to Friday |
Use * for any value, , for lists, - for ranges and / for steps. Example: */15 9-17 * * 1-5 = every 15 minutes from 9:00 to 17:45 on weekdays. Macros: @hourly, @daily (= @midnight), @weekly, @monthly, @yearly (= @annually) and @reboot, which runs once at start-up and therefore has no next run times.
Common cron expressions
| Expression | Meaning |
|---|---|
* * * * * | every minute |
*/5 * * * * | every 5 minutes |
0 * * * * | every hour, on the hour |
0 */6 * * * | every 6 hours (0:00, 6:00, 12:00, 18:00) |
0 0 * * * | every day at midnight |
0 9 * * 1-5 | weekdays at 9:00 |
0 3 * * 0 | Sundays at 3:00 (e.g. backups) |
0 0 1 * * | midnight on the 1st of every month |
0 0 1 1 * | once a year, 1 January |
Gotcha: when both day of month and day of week are restricted (e.g. 0 0 13 * 5), classic cron runs the job on every 13th and every Friday - the conditions are combined with OR, not AND. The tool shows a warning when this happens.
Crontab vs GitHub Actions vs Kubernetes vs Quartz
| System | Fields | Time zone | Notes |
|---|---|---|---|
| crontab (cronie, Vixie cron) | 5 | server time zone | supports @reboot, @daily etc. |
GitHub Actions on: schedule | 5 | always UTC | shortest interval 5 minutes; runs can be delayed under load |
| Kubernetes CronJob | 5 | controller time zone or timeZone (1.27+) | supports @hourly, @daily etc. |
Quartz / Spring @Scheduled | 6-7 (seconds first, optional year) | configurable | ? L W #; Quartz requires ? in one of the day fields |
This tool accepts 5 fields and 6 fields with seconds first; the 7-field Quartz format with a year is not supported. Because GitHub Actions uses UTC, a job meant for 9:00 in New York needs 0 13 * * * in summer (UTC−4) and 0 14 * * * in winter (UTC−5).
Cron and daylight saving time
Where clocks change, one night a year has an hour that does not exist and another has an hour that happens twice. A job set to 30 2 * * * can therefore be skipped in spring and run twice in autumn, depending on the cron implementation. Schedule important jobs (backups, reports) outside the 1:00-3:00 window or run servers in UTC. The run list in this tool skips times that do not exist in your browser time zone.
Frequently asked questions
How do I run a cron job every 5 minutes?
+
*/5 * * * *. The job runs at minutes 0, 5, 10, …, 55 of every hour.How do I run cron every day at midnight?
+
0 0 * * * or the macro @daily (the same as @midnight).How do I run a job on weekdays only?
+
0 9 * * 1-5 for Monday to Friday at 9:00. Cron does not know public holidays, so it still runs on them.Is Sunday 0 or 7?
+
Which time zone does cron use?
+
timeZone. This tool shows run times in your browser time zone.Can cron run every 30 seconds?
+
*/30 * * * * *. In crontab you can add a second entry that starts with sleep 30.What does ? mean in a cron expression?
+
0 0 12 ? * MON-FRI.Updated: