DevFormatter

Cron Generator

Examples →
✓ Every minute

Quick Builder

Minute
Hour
Day
Month
Weekday
Next 10 Runs (UTC)

A cron expression is a string of five whitespace-separated fields — minute, hour, day-of-month, month, and day-of-week — that tells Unix-based systems and cloud schedulers exactly when to run a job. This free online cron generator builds, validates, and previews any cron schedule in real time, entirely in your browser.

How the cron expression generator works

Last updated: November 2026

A cron expression is a compact string of five space-separated fields that tells a scheduler exactly when to run a job. This free cron expression generator from DevFormatter validates your expression in real time, translates it into plain English, and shows the next 10 scheduled run times in UTC — so you can confirm the cron schedule before deploying.

Type directly in the expression box or use the Quick Builder dropdowns to construct each field without memorising the syntax — making it a visual cron expression builder as well as a validator. The field breakdown colour-codes each position so you always know which value controls which dimension of time.

Need a starting point? Browse the cron examples library for 50+ common cron job schedules — click any row to load it straight into the generator.

Cron field reference

Field Position Allowed values Special characters
Minute1st0 – 59* , - /
Hour2nd0 – 23* , - /
Day of month3rd1 – 31* , - / L W
Month4th1 – 12 or JAN–DEC* , - /
Day of week5th0 – 7 (0=Sun, 7=Sun) or SUN–SAT* , - / L #

Special characters

Char Meaning Example
*Any / every value* in hour = every hour
,List of values1,15 = 1st and 15th
-Range1-5 = Mon through Fri
/Step*/15 = every 15 units
LLast (day-of-month or day-of-week only)L in DOM = last day of month
WNearest weekday15W = nearest weekday to the 15th
#Nth day of week in month2#1 = first Monday of month

Common cron expressions

Expression Description
* * * * *Every minute
*/5 * * * *Every 5 minutes
0 * * * *Every hour (at minute 0)
0 0 * * *Every day at midnight
0 9 * * 1-59:00 AM every weekday
0 0 1 * *First day of every month at midnight
0 0 * * 0Every Sunday at midnight
0 0 1 1 *Once a year — January 1st at midnight

See the full cron examples library for 50+ categorised schedules.

Tips & tricks

0 and 7 both mean Sunday

In the day-of-week field, both 0 and 7 represent Sunday. This is a historical quirk — use 0 for maximum compatibility.

DOM and DOW use OR logic

If you set both day-of-month and day-of-week to non-wildcards, most cron daemons fire if either matches — not both. Use a wrapper script if you need AND logic.

Cron has no concept of "last run"

If a job is still running when the next trigger fires, cron launches a second instance. Use flock or a lock file to prevent overlapping runs.

GitHub Actions uses UTC

The schedule trigger in GitHub Actions always runs in UTC. Add an offset to your hour field if your team is in a different timezone.

@hourly is not the same as * * * * *

@hourly expands to 0 * * * * — it fires once per hour at minute 0. * * * * * fires every minute.

Step values don't wrap around

50-10/5 does not wrap midnight — it is invalid in most implementations. To straddle midnight use two separate entries in your crontab.

Code examples

Node.js — node-cron

const cron = require('node-cron');

// Run every weekday at 9 AM
cron.schedule('0 9 * * 1-5', () => {
  console.log('Running weekday task...');
}, { timezone: 'America/New_York' });

Python — croniter

from croniter import croniter
from datetime import datetime

expr = '*/15 * * * *'
now = datetime.utcnow()
cron = croniter(expr, now)

for _ in range(5):
    print(cron.get_next(datetime))

Linux crontab

# View current user's cron jobs
crontab -l

# Edit cron jobs (opens $EDITOR)
crontab -e

# Cron field reference
# ┌──────── minute      (0 - 59)
# │ ┌────── hour        (0 - 23)
# │ │ ┌──── day-of-month(1 - 31)
# │ │ │ ┌── month       (1 - 12 or JAN-DEC)
# │ │ │ │ ┌ day-of-week (0 - 7, 0=Sun, 7=Sun)
# │ │ │ │ │
# * * * * *  command

Frequently asked questions

What is a cron expression?

A cron expression is a string of five fields — minute, hour, day of month, month, and day of week — that defines when a scheduled job should run. For example, 0 9 * * 1-5 means "at 9:00 AM every weekday". Cron is the standard Unix job scheduler, originating in AT&T Bell Labs Unix in the 1970s, and its expression format is supported by virtually every CI/CD platform, cloud scheduler, and server environment. Each field accepts a plain integer, a wildcard (*), a comma-separated list (1,15), a range (1-5), or a step (*/15). Some schedulers like AWS EventBridge and Quartz add a sixth field for seconds. On Linux, cron jobs are managed with crontab -e; on GitHub Actions they go in the on.schedule key; on Kubernetes they go in a CronJob manifest. This tool validates your expression and shows the next 10 run times so you can verify the schedule before deploying.

What do the five fields mean?

In order: (1) minute (0–59), (2) hour (0–23), (3) day of month (1–31), (4) month (1–12 or JAN–DEC), (5) day of week (0–7, where both 0 and 7 are Sunday). A * means "every valid value" for that field. For example, the expression 30 8 1 * * breaks down as: minute 30, hour 8, day-of-month 1, every month, every day-of-week — meaning 8:30 AM on the 1st of every month. Month names (JAN–DEC) and day abbreviations (SUN–SAT) are accepted as alternatives to numbers on most cron daemons. Some platforms — including AWS EventBridge, Quartz Scheduler, and Spring @Scheduled — add a sixth field for seconds at the beginning of the expression, making it a six-field format. Standard Unix cron (Vixie cron, cronie) always uses five fields; never add seconds to crontab -e entries or the cron daemon will reject the line silently.

What does */ mean in a cron expression?

The */ syntax is a step value. */15 in the minute field means "every 15 minutes" — firing at 0, 15, 30, and 45. You can combine it with a range: 10-50/10 fires every 10 minutes between minute 10 and 50. The step value divides the allowed range evenly starting from the range's lower bound: 0-23/6 in the hour field fires at hours 0, 6, 12, and 18. Step values work in all five fields — for example, */2 in the day-of-month field runs on even-numbered days (2, 4, 6 … 30). One important caveat: step values do not wrap across the boundary of the field — 50-10/5 is not valid standard cron syntax and will fail silently or raise an error on most implementations. If you need a schedule that straddles midnight, use two separate crontab lines instead.

How do I run a cron job every 5 minutes?

Use */5 * * * *. This fires at minutes 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, and 55 of every hour, every day — a total of 12 runs per hour and 288 runs per day. The */5 step is shorthand for 0-59/5. In Node.js you can replicate this with the node-cron package: cron.schedule('*/5 * * * *', callback). In GitHub Actions, the minimum schedule frequency is every 5 minutes, using the same expression in the on.schedule.cron key — though GitHub warns that high-traffic periods may cause delays of several minutes beyond the stated run time. For anything more frequent than every minute, use a process-level scheduler like APScheduler (Python) or node-cron (Node.js) rather than the system cron daemon, which has a one-minute minimum granularity.

How do I schedule a cron job at a specific time daily?

Put the minute and hour values explicitly and use * for the remaining fields. For example, 30 14 * * * runs at 2:30 PM every day, and 0 0 * * * runs at midnight — equivalent to the @daily shorthand. Cron uses the server's local timezone unless you override it. On Linux with Vixie cron or cronie, you can set the timezone per-job with CRON_TZ=UTC as the first line of your crontab. GitHub Actions always evaluates schedules in UTC, so 0 14 * * * fires at 14:00 UTC regardless of where your repository or runner is located. AWS EventBridge Scheduler lets you specify an IANA timezone string (e.g. America/New_York) when creating a schedule rule, so the cron expression is always evaluated in that zone including DST transitions. Always verify the resulting run times in UTC using this tool's "Next 10 Runs" panel before deploying.

What is the difference between day of month and day of week?

Day of month (field 3) targets a specific date number, e.g. the 1st or 15th. Day of week (field 5) targets a named day regardless of date. If both are set to non-wildcard values, most cron implementations fire if either condition is true (OR logic) — a common source of bugs. For example, 0 9 1 * 1 fires on the 1st of every month and also on every Monday, not only on Mondays that happen to fall on the 1st. This OR behaviour is specified in the original Vixie cron implementation and is followed by cronie, macOS cron, and most cloud schedulers. The notable exception is AWS EventBridge, which uses a question mark (?) to explicitly mark the unused field — you must write either 0 9 1 * ? (1st of month) or 0 9 ? * 2 (every Monday) rather than setting both. If you need true AND logic (only on the first Monday), use a wrapper script that checks both conditions at runtime with [ $(date +%u) -eq 1 ] && [ $(date +%d) -le 7 ].

Does cron support timezones?

Standard cron uses the system timezone of the server and has no built-in timezone field. Many modern platforms add timezone support via a CRON_TZ environment variable placed at the top of a crontab file — for example, CRON_TZ=America/Chicago will make all subsequent jobs in that crontab evaluate in Central Time. GitHub Actions always evaluates schedules in UTC, documented in the GitHub Actions reference. AWS EventBridge Scheduler supports explicit IANA timezone strings such as Europe/London, and EventBridge automatically adjusts for DST — meaning a job set to run at 09:00 London time will fire at 08:00 UTC in winter and 09:00 UTC in summer. Kubernetes CronJobs have a .spec.timeZone field (beta in Kubernetes 1.25, stable in 1.27) that accepts any IANA timezone. For maximum portability, always write your expressions in UTC and document the offset for your team.

What does @reboot mean in cron?

@reboot is a non-standard cron shorthand supported by most Linux cron daemons (Vixie cron, cronie). It runs the command once each time the system starts up, before any user logs in. It is commonly used to start background services or mount network drives on boot. Other shorthands defined in the same extension are: @hourly (expands to 0 * * * *), @daily or @midnight (0 0 * * *), @weekly (0 0 * * 0), @monthly (0 0 1 * *), and @yearly or @annually (0 0 1 1 *). These shorthands are not part of the original POSIX cron spec and are not supported by all platforms — AWS EventBridge and Kubernetes CronJobs do not recognise them. Use explicit five-field expressions when targeting cloud or container schedulers to ensure maximum compatibility.

What is the maximum cron frequency?

Standard cron has a minimum granularity of one minute — the most frequent valid expression is * * * * * (runs every minute, 1,440 times per day). The cron daemon wakes up at the start of each minute and checks all crontab entries, so there is an inherent latency of up to 59 seconds even for per-minute jobs. For sub-minute scheduling, use a different mechanism: systemd timers support OnCalendar=*:*:0/30 for every 30 seconds; the node-cron package (npm) and APScheduler (Python) both accept a six-field expression with a seconds field; AWS EventBridge Scheduler does not support sub-minute frequency. If you need to run something every few seconds, consider a long-running process with setInterval (Node.js) or time.sleep() (Python) inside a systemd service rather than scheduling many cron jobs.

How do I run a cron job only on weekdays?

Set the day-of-week field to 1-5 (Monday through Friday, using the ISO-style numeric encoding where Monday=1 and Sunday=0 or 7). For example, 0 9 * * 1-5 runs at 9:00 AM every weekday and 30 17 * * 1-5 runs at 5:30 PM Monday to Friday. Leave the day-of-month field as * so it does not introduce OR logic with the day-of-week field. The equivalent using named abbreviations is 0 9 * * MON-FRI, which is accepted by most Linux cron daemons and is easier to read in a crontab. If your job must skip public holidays, cron alone cannot do this — implement a check at the start of the script using a holiday library such as Python's holidays package (pip install holidays) and exit early if today is a holiday.

How do I validate a cron expression?

Use DevFormatter's free cron expression validator — it checks your expression in real time as you type. A valid expression shows a green checkmark and a plain-English description of the schedule. An invalid expression shows a red error identifying the exact problem, such as a field value out of range (e.g. minute 60, which is invalid since the minute field only accepts 0–59) or an unsupported special character. Programmatically, you can validate a cron expression in Node.js with the cron-parser package: CronExpressionParser.parse(expr) throws on invalid input. In Python, the croniter library's croniter.is_valid(expr) method returns True or False without raising. Always validate before inserting a cron expression into a database or deploying to a scheduler, as most platforms silently ignore malformed entries rather than raising a deployment error.

What is the difference between a crontab and a cron expression?

A crontab (cron table) is the configuration file that stores one or more scheduled jobs — edited with crontab -e on Linux/macOS, which opens the file in your default $EDITOR. Each non-comment line in a crontab contains a cron expression (the five-field schedule) followed by the shell command to run. For example: 0 2 * * * /usr/local/bin/backup.sh >> /var/log/backup.log 2>&1 runs a backup script at 2:00 AM daily and appends both stdout and stderr to a log file. Use crontab -l to list current jobs and crontab -r to remove all jobs (be careful — there is no confirmation prompt). System-wide crontab files in /etc/cron.d/ include an extra field for the username before the command. This cron schedule generator helps you build cron expressions that you then paste into your crontab. Use the cron examples library to find a ready-made expression and copy it directly into your crontab file.

Related tools