Cronwise

Cron Expression Basics: Understanding the 5 Fields

A plain-language breakdown of standard cron syntax that you can apply immediately

Try Cron Explainer

Why Cron Expressions Trip Up Even Experienced Developers

Most cron mistakes start before deployment, when schedule intent and syntax diverge. You want a job to run every weekday at 8 AM, but a misplaced value shifts it to every hour or every day of the month. The root cause is almost always the same: the five fields of a cron expression are compact, positional, and unforgiving.

A standard cron expression is a single line of five space-separated fields. Each field maps to a unit of time, and together they define a repeating schedule. There are no labels, no keywords by default, and no room for ambiguity once the scheduler reads the line.

This article explains the structure of the 5-field cron format in plain language. You will learn what each field controls, how common tokens work, and where typical misreadings occur. Every example can be verified instantly in the Cronwise Cron Explainer, which gives you a plain-language breakdown and a timezone-aware next-run preview for any expression you enter.

Whether you are writing your first crontab entry or reviewing a schedule someone else wrote, understanding these five fields is the foundation for every cron workflow that follows.

The Five Fields: What Each One Controls

Every standard cron expression follows the same positional format. From left to right, the five fields are:

PositionFieldAllowed ValuesDescription
1Minute0 – 59The minute of the hour when the job runs
2Hour0 – 23The hour of the day (24-hour format)
3Day of Month1 – 31The calendar day
4Month1 – 12The month of the year
5Day of Week0 – 7The weekday (0 and 7 both represent Sunday)

A concrete example makes the mapping clear. The expression 30 8 * * 1-5 means: at minute 30, of hour 8, on every day of the month, in every month, but only on weekdays Monday through Friday. In plain language: 8:30 AM, Monday to Friday.

The asterisk (*) is a wildcard that matches every allowed value for that field. When you see it, read it as "every." So * * * * * means every minute of every hour of every day — the most frequent schedule possible in standard cron.

Common Tokens and How They Work

Beyond the asterisk wildcard, cron fields support several tokens that let you express ranges, intervals, and lists without writing separate entries.

Comma (List)

A comma separates individual values. 0 9,12,18 * * * fires at 9:00 AM, 12:00 PM, and 6:00 PM every day. Each value in the list is treated independently.

Hyphen (Range)

A hyphen defines a continuous range. 0 9-17 * * * fires at the top of every hour from 9:00 AM through 5:00 PM. Ranges are inclusive on both ends.

Slash (Step)

A slash defines an interval. */15 * * * * fires every 15 minutes, starting at minute 0. You can combine a range with a step: 0-30/10 * * * * fires at minutes 0, 10, 20, and 30 of every hour.

Combining Tokens

Tokens can be mixed within a single field. 0 8-12,18 * * 1-5 runs at the top of hours 8 through 12 and also at hour 18, but only on weekdays. Each field is evaluated independently, and the scheduler fires when all five fields match simultaneously.

For a deeper walkthrough of reading strategies, see How to Read Cron Expressions Quickly, which covers mental models for parsing expressions at a glance.

How to Interpret Real Schedules

Reading a cron expression correctly means translating each field in order and then combining them into a single sentence. Here are practical examples with their plain-language equivalents:

ExpressionMeaningWhen to UseRisk Notes
0 0 * * *Midnight every dayDaily batch jobs, log rotationHeavy load if many jobs share this slot
*/5 * * * *Every 5 minutesHealth checks, queue pollingHigh frequency; confirm the job is idempotent
0 9 1 * *9:00 AM on the 1st of every monthMonthly reportsMonths with fewer than 31 days behave normally
30 2 * * 02:30 AM every SundayWeekly maintenance windowMay overlap with DST transitions in spring
0 */2 * * 1-5Every 2 hours on weekdaysBusiness-hours pollingRuns at 0, 2, 4 … 22 — not just working hours

The last example is a common misinterpretation. */2 in the hour field means every second hour from 0, not every two hours during business hours. If you only want 9 AM to 5 PM, you need 0 9-17/2 * * 1-5 instead. This is exactly the kind of subtle mistake that the Cronwise Explainer catches by showing you the next 10 scheduled runs in your timezone.

Edge Cases and Field Limits

The 5-field format has boundaries that are easy to forget. Understanding them prevents silent failures.

Day-of-Month vs. Day-of-Week Interaction

In standard cron, when both the day-of-month (field 3) and day-of-week (field 5) are set to non-wildcard values, most implementations treat them as a union: the job runs if either condition is true. This means 0 9 15 * 1 does not mean "the 15th if it is a Monday." It means "every 15th of the month and every Monday." This is one of the most frequently reported surprises in cron.

Month and Weekday Boundaries

Setting day-of-month to 31 means the job will only run in months that have 31 days (January, March, May, July, August, October, December). It will silently skip shorter months. Similarly, day-of-week values 0 and 7 both represent Sunday, but mixing them in the same expression can cause confusion during code reviews.

Timezone Dependence

A cron expression contains no timezone information by itself. The scheduler interprets times in whatever timezone it is configured to use, which may be UTC, the server's local time, or an explicit override. If your team spans multiple timezones, always confirm the scheduler's timezone setting before deploying. Cronwise lets you select any IANA timezone and preview runs accordingly.

Apply What You Know in the Cronwise Workflow

Once you understand the five fields, the next step is to move from reading cron expressions to building them confidently. Cronwise offers two complementary paths for this.

Explain First, Then Generate

Start with the Cron Explainer to verify an existing expression. Paste it in, read the plain-language summary, and scan the next-run table. If the schedule is not what you intended, switch to the Cron Generator to build the correct expression visually, field by field. The generator eliminates syntax guesswork by letting you select values from dropdowns and tabs.

Verification Checklist Before Deployment

CheckWhy It MattersPass Criteria
Plain-language summary matches intentCatches field-order mistakesSummary sentence aligns with your scheduling goal
Next-run timestamps are correctCatches token misuse (ranges, steps)First 5 runs match expected dates and times
Timezone matches target environmentPrevents off-by-hours executionSelected timezone equals the scheduler's configured timezone
No validation warningsCatches risky patterns earlyZero warnings or each warning intentionally accepted

For a full walkthrough of the visual builder, read Visual Cron Generator: Step-by-Step Workflow, which covers tab navigation, saved presets, and export options.

Conclusion: Deploy With Confidence

The 5-field cron format is deceptively simple: minute, hour, day-of-month, month, and day-of-week. Mastering it means knowing not just the field positions but also how tokens combine, where edge cases hide, and why a 10-second validation check is worth the effort every time.

Here are the key rules to carry forward:

  • Read fields left to right: minute, hour, day, month, weekday.
  • An asterisk means "every" — it is not a placeholder or a default.
  • Ranges, lists, and steps can be combined, but each field is evaluated independently.
  • Day-of-month and day-of-week form a union when both are non-wildcard — not an intersection.
  • Always verify the scheduler's timezone and preview the next runs before deploying.

Cronwise is built to make this verification fast. Paste an expression, read the explanation, check the runs, and deploy with confidence. Browse all cron articles on Cronwise to continue learning, or jump straight into the tool.