← Back to tool

Crontab · Syntax · Fields · Reference

Crontab Syntax Explained: The Five Cron Fields

Updated: May 2026

A crontab line looks cryptic the first time you see it, but it follows a strict, predictable structure. Once you understand the five time fields and the four special characters, you can read or write any schedule in seconds.

Open the cron generator →

Build and explain any expression · Free · No upload

The anatomy of a crontab line

A classic Unix crontab entry is made of five space-separated time fields followed by the command to execute:

┌── minute (0-59)
│ ┌── hour (0-23)
│ │ ┌── day of month (1-31)
│ │ │ ┌── month (1-12 or JAN-DEC)
│ │ │ │ ┌── day of week (0-6 or SUN-SAT)
│ │ │ │ │
* * * * *  /path/to/command

Each field accepts a value, a list, a range, or a step expression. The command runs whenever the current date and time match all five fields at once.

Allowed values per field

FieldValuesNotes
Minute0–59Minute of the hour
Hour0–230 is midnight, 23 is 11pm
Day of month1–31Calendar day
Month1–12Or JAN–DEC
Day of week0–60 and 7 are Sunday, or SUN–SAT

Both names and numbers work for months and weekdays, so 0 9 * * MON and 0 9 * * 1 are identical.

The four special characters

  • Asterisk * — every value. * * * * * runs every minute.
  • Comma , — a list. 0 9,17 * * * runs at 9am and 5pm.
  • Hyphen - — a range. 0 9-17 * * * runs every hour from 9am to 5pm.
  • Slash / — a step. */15 * * * * runs every 15 minutes.

These combine freely. 0 8-18/2 * * 1-5 means every two hours between 8am and 6pm, Monday to Friday.

Reading a real example

Take 30 2 1 * *. Field by field: minute 30, hour 2, day-of-month 1, every month, any weekday. That is "at 02:30 on the first day of every month" — a common pattern for monthly backups. Add a command and the full crontab line becomes 30 2 1 * * /usr/bin/backup.sh.

If you ever doubt a line, paste it into the generator: it shows a plain-English meaning and the next run times so you can confirm the schedule before deploying it.

Frequently asked questions

Where do I add the command?

After the five time fields, separated by a space. Anything after the day-of-week field is treated as the command line.

Are leading zeros required?

No. 09 and 9 are equivalent. Most people write the shorter form.

Does cron use the system or UTC time?

Classic cron uses the server's local time zone. Always confirm the time zone of the machine before relying on a schedule.