How Cron Expressions Work: 5 Fields, Examples and Common Mistakes
Learn how to read a five-field cron expression, understand each field, check common schedules and avoid field-count or time-zone mistakes before using a cron job.
Cron Expression
Generate, validate and preview common cron schedules locally in the browser.
Open Cron ExpressionA five-field cron expression describes a recurring schedule in this order: minute, hour, day of month, month, day of week. For example, */5 * * * * means “every five minutes” in the common five-field cron format.
The important part is not just generating a string. You should be able to read the schedule back and confirm that your target platform uses the same field count and time zone.
The five fields of a cron expression
A standard five-field expression looks like this:
* * * * *
│ │ │ │ └─ day of week
│ │ │ └─── month
│ │ └───── day of month
│ └─────── hour
└───────── minute
An asterisk means “every allowed value” for that field. Numbers select specific values, while ranges, lists and step values can describe recurring patterns. The exact syntax supported beyond the basic five fields can vary between schedulers.
Common cron examples
These examples use the common five-field format:
| Schedule | Expression |
|---|---|
| Every 5 minutes | */5 * * * * |
| Every day at midnight | 0 0 * * * |
| Every day at 09:00 | 0 9 * * * |
| Monday to Friday at 09:00 | 0 9 * * 1-5 |
| First day of each month at midnight | 0 0 1 * * |
Read an expression from left to right. In 0 9 * * 1-5, minute 0 and hour 9 set 09:00, while 1-5 limits the day-of-week field.
How to build a cron expression safely
Start by writing the schedule in plain language: for example, “every 15 minutes” or “at 02:00 every day.” Then map only the fields you need and leave the others broad.
- Choose the minute.
- Choose the hour.
- Restrict day of month only when the schedule needs it.
- Restrict month only when needed.
- Restrict day of week only when needed.
- Preview the next run times and compare them with the schedule you intended.
The Sikelia Cron Expression tool can help you generate, validate and preview common five-field schedules in the browser. The preview is especially useful because a cron string can look plausible while still expressing the wrong recurrence.
Common mistakes to check
Using the wrong number of fields. Some schedulers add a seconds field or use a different cron dialect. A five-field expression pasted into a six-field system can mean something different or be rejected.
Assuming the time zone. The expression itself does not tell you which time zone the scheduler will use. Check the runtime or platform configuration before relying on a specific local time.
Confusing day of month with day of week. If you restrict both fields, the matching rules can differ by cron implementation. Verify that combination in the system that will actually execute the job.
Treating a preview as the production scheduler. A preview helps you inspect the schedule, but the target service remains the authority for supported syntax and execution behavior.
Cron every 5 minutes, every day and other patterns
Do not create a separate guide for every tiny cron variation. Once you understand the five fields, most common schedules are small changes to the same pattern.
For “every 5 minutes,” use a step in the minute field: */5 * * * *. For a daily schedule, choose the minute and hour and leave the remaining fields unrestricted, such as 0 9 * * * for 09:00 every day in the scheduler’s configured time zone.
If you need a platform-specific schedule, check that platform’s cron documentation before copying a generic example. This matters for systems that use additional fields, different day-of-week rules or a fixed time zone.
A quick verification checklist
Before saving a cron schedule, ask:
- Does the target system expect five fields?
- Is the hour interpreted in the time zone I expect?
- Does the next-run preview match the plain-language schedule?
- Are day-of-month and day-of-week restrictions intentional?
- Have I checked the expression in the platform that will execute it?
That short verification is more useful than memorizing dozens of cron strings. Build the schedule, read it back, preview it, and then confirm it against the target scheduler.
Read more
Cron Expression
Generate, validate and preview common cron schedules locally in the browser.
Open Cron Expression