HandyBench

Cron Expression Generator

Build crontab schedules and preview next runs.

Unix: minute, hour, day of month, month, day of week (0-7, Sunday is 0 or 7). Paste 6 or 7 fields to switch to Quartz.

Schedule: At 09:00, on Mon-Fri

  • 10/7/2026, 9:00:00 AM
  • 10/8/2026, 9:00:00 AM
  • 10/9/2026, 9:00:00 AM
  • 10/12/2026, 9:00:00 AM
  • 10/13/2026, 9:00:00 AM

How to use the Cron Expression Generator

  1. 1 Pick Unix (5 fields) or Quartz (6-7 fields with seconds), then start from a preset or set each field.
  2. 2 Read the plain-English description to confirm the schedule.
  3. 3 Check the next run times, then copy the expression.

The five fields and what they accept

This builder reads two dialects and picks one from the number of fields. Five fields are the classic Unix crontab layout, read left to right, and are described first. Six or seven fields are Quartz, covered in its own section below.

FieldAllowed valuesNotes
Minute0–59
Hour0–2324-hour clock
Day of month1–31
Month1–12Names JAN to DEC also work, in any case
Day of week0–70 and 7 both mean Sunday; names SUN to SAT also work

Each field can hold *, a single number or name, a range (1-5 or MON-FRI), a list (1,3,5), or a step (*/15, 0-30/10 or 5/15). A step on a lone number such as 5/15 means "start at 5 and repeat every 15 up to the field maximum", so in the minute field it is 5, 20, 35 and 50. The parser rejects out-of-range numbers, a step of zero, shortcuts like @daily, and any expression that does not have 5, 6 or 7 fields.

Worked example

Take 30 2 13 * 5, which runs at 02:30 on the 13th and on Fridays. Because both day fields are restricted, standard cron joins them with OR, and the tool follows suit. Starting from Tuesday 6 October 2026 at 10:00, the next runs are Friday 9 October, Tuesday 13 October, Friday 16 October and Friday 23 October. Read it as "the 13th of the month or any Friday", not "Friday the 13th".

The tool follows the Vixie cron rule used by most Linux systems. The two day fields are joined with OR only when neither of them starts with *. If either one starts with *, including a step such as */2, the other field must match as well (AND). So 0 0 */2 * 1 runs only on Mondays that fall on an odd date (1st, 3rd, 5th and so on), not on every Monday plus every second day. Other implementations, such as some cloud schedulers, differ, so test an unusual combination on your own platform.

How the previews are produced

For Unix expressions, the next five run times come from a minute-by-minute scan forward from the current time, comparing each minute with all five fields. The scan covers about two years, which is why 0 0 29 2 * is found as long as a 29 February falls within the next two years, while 0 0 31 2 * reports no runs. Times are shown in your browser's local zone, but a server's crontab usually runs in the server's zone, often UTC, so shift accordingly. The plain-English line is a short summary. Day and month numbers are shown as names, ranges included (1-5 in the weekday field reads "Mon-Fri"), and a step such as 5/15 is spelled out as the minutes it produces. It is a summary only, so rely on the next-run list when an expression is complicated.

Quartz previews work a day at a time: months and years that cannot match are skipped, and the seconds, minutes and hours are expanded only on days that do, so a rule such as 0 0 0 ? * 6L 2030 shows its first runs at once instead of stepping through four years. Without a year, the search looks about eight years ahead. With a year field, it looks up to the latest year you allowed, and the list is empty if that year has already passed.

Quartz expressions with seconds

Quartz is a Java job scheduler, and its cron syntax is copied by many other Java tools. Its expressions have six fields, or seven with a year at the end, and the tool switches to this dialect as soon as it sees them. Weekdays are numbered 1 to 7 from Sunday (so Friday is 6), and names work in any case.

FieldAllowed valuesSpecial characters
Second0–59* , - /
Minute0–59* , - /
Hour0–23* , - /
Day of month1–31* , - / ? L W
Month1–12 or JAN–DEC* , - /
Day of week1–7 or SUN–SAT* , - / ? L #
Year (optional)1970–2099* , - /
  • ? means "no specific value" and is allowed only in the two day fields. Exactly one of them must be ?, so 0 0 0 * * * is rejected. Write 0 0 12 ? * MON-FRI for weekdays, or 0 0 12 * * ? for every day.
  • L in the day-of-month field is the last day of the month, L-3 is three days before it, and LW is the last weekday (Monday to Friday). A bare L in the day-of-week field means Saturday.
  • 15W is the weekday nearest the 15th, and it never leaves the month. A 15th on Saturday runs on Friday the 14th, and one on Sunday runs on Monday the 16th. A Saturday 1st moves forward to Monday the 3rd.
  • 6#3 is the third Friday of the month, and 6L is the last Friday. The occurrence number goes from 1 to 5, and a fifth Friday runs only in months that have one.

A step such as 0/30 in the second field means seconds 0 and 30. A day that a month does not have, such as 31W in a 30-day month, is skipped for that month. Unlike Unix, Quartz never joins the two day fields with OR, which is why one of them has to be ?.

Differences from other schedulers

  • Unix and Quartz number weekdays differently (0 or 7 is Sunday in Unix, 1 is Sunday in Quartz), so converting an expression between them means adding one to each weekday number and putting ? in one day field. Spring accepts six fields without a year and treats the weekday numbers the Unix way, so check the weekday when you move an expression to Spring. A Spring expression such as 0 0 12 * * MON-FRI is read here as Quartz and rejected, because it has no ?; the error says it looks like Spring or another 6-field dialect. Replace the * in the day-of-month field with ? to preview it, and add 1 to any numeric weekday (Spring Monday is 1, Quartz Monday is 2). Whenever a Quartz expression uses numeric weekdays, a small note under the result repeats that 1 is Sunday in Quartz and Monday in Spring and Unix.
  • systemd timers use OnCalendar= syntax such as Mon..Fri *-*-* 09:00:00, which is a different grammar.
  • A step on a lone number, as in 5/15, is read here as 5, 20, 35 and 50. Not every cron implementation accepts this form (some reject it or read it as the single value 5), so prefer the explicit 5-59/15 if the job will run elsewhere.

To work out the times in other zones, convert them with the time zone converter, and use the regex tester to check patterns in the logs your jobs write.

Examples

  • ▸ Building "0 9 * * 1-5" to run at 9am on weekdays.
  • ▸ Checking when "*/15 * * * *" will next fire.

Frequently asked questions

What do the five cron fields mean?

In order: minute (0-59), hour (0-23), day of month (1-31), month (1-12) and day of week (0-7, where 0 and 7 are both Sunday). Use *, ranges (1-5), lists (1,3,5) and steps (*/15). A step on a single number starts there, so 5/15 in the minute field means minutes 5, 20, 35 and 50.

Does it support Quartz, seconds or names like MON and JAN?

Yes. Month and weekday names work (JAN-DEC, SUN-SAT, so MON-FRI is valid). Five fields are read as Unix cron. Six or seven fields are read as Quartz: second, minute, hour, day of month, month, day of week and an optional year, with ?, L, L-n, W, LW, n#k and nL. Weekdays in Quartz run 1-7 from Sunday, and exactly one day field must be ?. Shortcuts like @daily are rejected.

What do ?, L, W and # mean in a Quartz expression?

? means "no specific value" and goes in the day field you are not using. L is the last day of the month (L-3 is three days before it, LW the last weekday) or, in the weekday field, the last of that weekday, so 6L is the last Friday. 15W is the weekday nearest the 15th without leaving the month. 6#3 is the third Friday. For example, 0 0 0 ? * 6#3 fires at midnight on the third Friday of every month.

Why does it say there are no upcoming runs?

The preview scans about two years ahead for Unix expressions, and about eight years for Quartz expressions without a year. Some expressions never match, such as 0 0 31 2 * (31 February). A date like 29 February is found only when a leap year falls inside that window. A Quartz year field in the past also gives an empty list.

How are the "next run" times calculated?

They are computed in your local timezone, by matching Unix expressions minute by minute from now and Quartz expressions day by day, so a far-off year is still instant. Servers often run cron in UTC, so adjust if your crontab uses a different timezone.

How do day-of-month and day-of-week interact?

For five-field Unix expressions the tool follows Vixie cron, the version on most Linux systems. If neither day field starts with *, the job runs when either one matches (OR), so 30 2 13 * 5 runs on the 13th and on Fridays. If either field starts with *, including a step such as */2, both must match (AND), so 0 0 */2 * 1 runs only on Mondays that fall on an odd date. Quartz never combines the two day fields, so one of them must be ? there.