Skip to content
DeviceCheckHub

Cron Expression Generator

Type a cron expression, or edit it one field at a time, to read the schedule in plain English and see exactly when it runs next in any time zone, with clock changes handled the way cron handles them. It is a crontab generator and checker for Linux cron, GitHub Actions and Kubernetes, and it runs in your browser.

Every 15 minutes, from 09:00 to 17:59, Monday to Friday.

A job with * in the minute or hour: it follows the clock, so a skipped hour has no runs and a repeated hour runs twice.

Next runs

#Date and timeWhenNote

Field by field

FieldValueMeans
Minute*/15every 15 minutes from 0 (0, 15, 30, 45)
Hour9-17hours 9 to 17
Day of month*any
Month*every month
Day of week1-5Monday to Friday

How to use the cron expression generator

  1. Type or paste a cron expression such as 30 2 * * *, a shortcut such as @daily, or a whole crontab line with its command: the command is kept aside and the schedule is explained.
  2. Or build one field at a time in the five boxes: minute, hour, day of the month, month and day of the week. A mistake is named in plain words, with the field it is in.
  3. Choose where it runs. Linux cron, GitHub Actions and Kubernetes read the same five fields but differ on shortcuts, time zones and the shortest interval, and the tool tells you what the one you picked will do.
  4. Read the next run times in your own time zone, UTC or any other, with how long until each one and how many runs that makes in a year. Copy the expression, a link to it or the list of times.

The five fields

FieldValuesNames
Minute0–59–
Hour0–23–
Day of the month1–31–
Month1–12JAN–DEC
Day of the week0–7 (0 and 7 are both Sunday)SUN–SAT

In every field, * means every value, a comma makes a list (1,15), a dash makes a range (9-17) and a slash makes a step: */15 is every fifteenth value from the start of the field, 9-17/2 is every second hour from 9 to 17, and 5/15 starts at 5 and carries on to the end of the field. Names are the first three letters in English and may be in any case; ranges of names such as MON-FRI work too. A range must go from low to high, so a night shift from 22:00 to 02:59 is written 22-23,0-2.

Shortcuts

ShortcutSame asRuns
@yearly or @annually0 0 1 1 *At 00:00, on the 1st of the month, in January.
@monthly0 0 1 * *At 00:00, on the 1st of the month.
@weekly0 0 * * 0At 00:00, on Sunday.
@daily or @midnight0 0 * * *At 00:00.
@hourly0 * * * *At minute 0 of every hour.
@reboot–Once, each time cron starts.

GitHub Actions does not take any of the shortcuts, so write the five fields there.

Cron expression examples

ExpressionRuns
* * * * *Every minute.
*/5 * * * *Every 5 minutes.
*/10 * * * *Every 10 minutes.
*/30 * * * *At minutes 0 and 30 of every hour.
0 * * * *At minute 0 of every hour.
0 */2 * * *At minute 0 every 2 hours.
0 */6 * * *At 00:00, 06:00, 12:00 and 18:00.
0 0 * * *At 00:00.
30 2 * * *At 02:30.
0 9,17 * * *At 09:00 and 17:00.
0 9-17 * * 1-5At minute 0 past hours 09 to 17, Monday to Friday.
*/15 9-17 * * 1-5Every 15 minutes, from 09:00 to 17:59, Monday to Friday.
0 8 * * 1At 08:00, on Monday.
0 10 * * 6,0At 10:00, on Saturday and Sunday.
0 0 1 * *At 00:00, on the 1st of the month.
0 0 1,15 * *At 00:00, on the 1st and 15th of the month.
0 0 1 */3 *At 00:00, on the 1st of the month, in January, April, July and October.
0 0 1 1,7 *At 00:00, on the 1st of the month, in January and July.
0 12 13 * 5At 12:00, on the 13th of the month and also on Friday.
5 4 * * SUNAt 04:05, on Sunday.

Day of the month or day of the week

The two day fields work together in an unusual way. If either of them starts with *, a day has to match both, so */2 in the day of the month with * in the day of the week means the odd-numbered days. But when both are set, cron runs on days that match either one. The crontab manual of cronie, the cron on most Linux systems, says: “If both fields are restricted (i.e., do not contain the "*" character), the command will be run when either field matches the current time.” So 0 12 13 * 5 runs at noon on every 13th and also on every Friday, not only on Friday the 13th. It surprises many people, so the tool points it out.

Time zones and clock changes

Cron reads its schedule in local time, so a job at 30 2 * * * runs at 02:30 by the server’s clock. On the night clocks go forward that time may not exist. The cron manual says what happens: “If the time has moved forwards, those jobs which would have run in the time that was skipped will be run soon after the change. Conversely, if the time has moved backwards by less than 3 hours, those jobs that fall into the repeated time will not be re-run.” This applies to jobs at a fixed time; a job with * in the minute or hour, such as */10 * * * *, simply follows the clock. The next-run list follows the same rules and marks the runs a clock change affects.

To avoid surprises, run important jobs in UTC, which has no clock changes, or keep them out of the hours when your zone changes its clocks (in most of Europe and North America that happens between 01:00 and 03:00 local time). GitHub Actions reads schedules in UTC unless the workflow sets a timezone, and a Kubernetes CronJob uses .spec.timeZone (stable since Kubernetes 1.27), not CRON_TZ inside the schedule.

Cron, Quartz and Spring

Quartz, a Java scheduler, writes 6 or 7 fields: seconds first, then the five cron fields, then an optional year; Spring’s @Scheduled cron has those 6 fields without the year. Both add ? (no specific value), L (last day), W (nearest weekday) and # (the nth weekday, such as 6#3 for the third Friday). Standard cron has none of these, so pasting a Quartz expression here tells you which part does not fit. Kubernetes accepts ? and reads it like *.

Privacy

The generator works entirely in your browser: expressions and commands are never sent to a server. Your last expression is saved in your browser’s local storage so it is there next time, and Copy a link puts the expression after a # in the link, a part that browsers never send to a server.

Frequently asked questions

What does * * * * * mean in cron?

Five stars mean every minute of every hour of every day. The fields are, in order, minute, hour, day of the month, month and day of the week, and * stands for every value of its field.

How do I run a cron job every 5 minutes?

Use */5 * * * *. The */5 in the minute field means every fifth minute starting from 0, so the job runs at :00, :05, :10 and so on. For every 5 minutes during office hours on weekdays, use */5 9-17 * * 1-5.

What time zone does cron use?

Cron on a server uses the server’s own time zone. Cronie, the cron of most Linux systems, also reads a CRON_TZ= line in the crontab for one table. GitHub Actions reads schedules in UTC unless the workflow sets a timezone, and a Kubernetes CronJob uses the controller’s local time zone unless .spec.timeZone is set. Pick the zone above to see the run times there.

Why did my cron job run on a day I did not expect?

When both the day of the month and the day of the week are set (neither starts with *), cron runs on days that match either one, not only days that match both. 0 12 13 * 5 runs on every 13th and also every Friday, not only on Friday the 13th. The tool says so whenever an expression does this.

What is the difference between cron and Quartz expressions?

Quartz (used by Java and Spring) adds a seconds field at the start and an optional year at the end, so its expressions have 6 or 7 fields, and it has extra characters: ? for no specific value, L for last, W for the nearest weekday and # for the nth weekday of the month. Standard cron has 5 fields and none of these, so the tool explains what to change.

How do I run a cron job on the last day of the month?

Standard cron has no field for it. A common way is to run on days 28 to 31 and let the command check that tomorrow is the 1st: 0 23 28-31 * * [ "$(date -d tomorrow +\%d)" = "01" ] && your-command. In a crontab a plain % in the command is turned into a new line, so it is written \% there.

Does this cron tool send my crontab anywhere?

No. Every description and run time is worked out by the page in your browser, and nothing you type is sent to a server. Your last expression is kept only in your own browser, so it is there when you come back.

Last updated · About DeviceCheckHub