Utilia

Cron Expression Builder

Build a cron expression field by field, read it in plain words, see its next run times in any time zone and convert it to systemd, Quartz or AWS format.

Builder

FieldModeValue
Minute0–59
Hour0–23
Day of month1–31, L
Month1–12 or JAN–DEC
Day of week0–7 (0 and 7 = Sunday) or SUN–SAT

How to build a cron expression

  1. Type or paste an expression in Cron expression, or pick one from Presets. Macros such as @daily or @weekly are accepted too.
  2. Or use the Builder: for each field choose a Mode (Every, Every N, Specific values, Range or Custom) and fill in the Value. The expression updates as you go, and editing the expression updates the builder.
  3. Tick Add a seconds field (6 fields) if your scheduler supports seconds.
  4. Read the schedule In plain words (in the page language when the description library supports it, otherwise in English), then check the Next runs list. Choose the Time zone of the server that runs the job and How many runs to list.
  5. Copy the expression with Copy, or use one of the Other formats.

Errors are explained field by field, for example “Minute: 61 is out of range (0–59)”, so you know exactly what to fix.

The five cron fields

A standard (Vixie) cron line has five fields, then the command:

Field Allowed values
Minute 0–59
Hour 0–23
Day of month 1–31
Month 1–12 or JAN–DEC
Day of week 0–7 (0 and 7 are Sunday) or SUN–SAT

Each field accepts * (every value), a list 1,15, a range 9-17, a step */15 (every 15 units) or a range with a step 0-30/10. So */15 9-17 * * 1-5 means every 15 minutes from 9:00 to 17:45, Monday to Friday.

One rule surprises many people: when both Day of month and Day of week are restricted, classic cron runs when either matches. 0 0 13 * 5 runs on every 13th and on every Friday, not only on Friday the 13th. The tool shows a warning in that case.

Next run times and time zones

Cron uses the clock of the machine, or the CRON_TZ/TZ setting of the crontab. The Next runs list is computed for the time zone you choose, including daylight saving time changes: during the spring change a job set at 2:30 may be skipped, and in autumn it may run once or twice depending on the implementation. For jobs that must run exactly once, prefer times outside 1:00–3:00 or use UTC.

Vixie cron, systemd timers, Quartz and AWS

  • systemd timers use OnCalendar= with a different syntax: Mon..Fri *-*-* 09..17:00/15:00. Weekday and date conditions are combined with AND, not OR, so some cron expressions have no exact equivalent.
  • Quartz and Spring put a seconds field first and may add a year field. One of the two day fields must be ?, and Quartz numbers weekdays 1–7 from Sunday, unlike cron’s 0–6. The tool writes weekdays as names (MON-FRI) to avoid that trap.
  • AWS EventBridge uses cron(minutes hours day month weekday year): six fields, no seconds, a ? in one day field and a year at the end.

Standard cron has no seconds field. The 6-field form with seconds is supported by many libraries (node-cron, Spring, Quartz) but not by the system crontab.

Frequently asked questions

How do I run a job every 5 minutes?

Use */5 * * * *. The job runs at minutes 0, 5, 10… of every hour.

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

Many schedulers accept L in the day-of-month field: 0 18 L * *. With plain Vixie cron, run daily on days 28–31 and test in the script whether tomorrow is the 1st.

What does @reboot do?

It runs the command once, when the cron daemon starts. It has no schedule, so the tool cannot list run times for it.

Why does my job not run at the time shown?

Check the server’s time zone, the user’s crontab versus /etc/crontab (which has an extra user field), and the PATH: cron starts with a minimal environment.

Is 0 or 7 Sunday?

Both. In the day-of-week field, 0 and 7 mean Sunday, 1 is Monday and 6 is Saturday.