Web Development

How to Read Cron Expressions: A Step-by-Step Guide

Master the art of reading cron expressions with this practical guide. Learn to decode each field, understand common patterns, and translate cryptic scheduling strings into plain English.

By Inventive HQ Team

To read a cron expression, decode its five space-separated fields left to right — minute (0-59), hour (0-23), day of month (1-31), month (1-12), and day of week (0-7, where 0 and 7 both mean Sunday) — then combine them into one sentence. An asterisk (*) matches every value; a hyphen (1-5) is a range; a comma (9,12,15) is a list; and a slash (*/5) is a step interval. So 0 9 * * 1-5 reads: minute 0, hour 9, any day, any month, weekdays Monday–Friday — "at 9:00 AM on weekdays."

That is the summary an AI overview will hand you. What it can't give you is the muscle memory: a field-by-field map you can hold in your head, the four special characters that unlock 90% of real-world schedules, and the one gotcha (day-of-month vs. day-of-week) that trips up even experienced engineers. This guide builds that skill from the ground up, with worked examples you can check against the cron builder below.

The Five-Field Foundation

Every standard cron expression consists of exactly five fields, each separated by a space. Think of these fields as answering five questions about when a task should run — read strictly left to right:

The five fields of a cron expression A cron expression has five space-separated fields read left to right: minute, hour, day of month, month, and day of week. A highlight sweeps across each field in turn. Read left to right: one field at a time * * * * * Minute Hour Day of month Month Day of week 0-59 0-23 1-31 1-12 0-7 (Sun=0/7) Decode each field, then combine into one plain-English sentence. 0 9 * * 1-5 → "at 9:00 AM on weekdays"
  1. Which minute? (0-59)
  2. Which hour? (0-23)
  3. Which day of the month? (1-31)
  4. Which month? (1-12)
  5. Which day of the week? (0-7, where 0 and 7 are Sunday)

The key to reading cron expressions is to process these fields from left to right, building up a complete picture of the schedule.

Field Ranges and Special Characters at a Glance

Before decoding real expressions, keep this reference in view. Every valid character in a five-field cron string is one of these — there is nothing else to memorize.

FieldPositionAllowed valuesAlso accepts
Minute1st0-59* , - /
Hour2nd0-23* , - /
Day of month3rd1-31* , - /
Month4th1-12JAN-DEC, * , - /
Day of week5th0-7 (0 and 7 = Sunday)SUN-SAT, * , - /
CharacterNameMeansExampleReads as
*AsteriskEvery value* * * * *Every minute
,CommaList of values0 9,12,15 * * *At 9 AM, noon, 3 PM
-HyphenInclusive range0 9-17 * * *Every hour 9 AM–5 PM
/SlashStep / interval*/5 * * * *Every 5 minutes

Combine them and you cover nearly every schedule you'll meet: */15 8-17 * * 1-5 is a step, a range, and a range in one line ("every 15 minutes, 8 AM–5 PM, weekdays"). The rest of this guide walks each character in turn.

Reading Your First Cron Expression

Let's start with a simple example:

30 14 * * *

Step 1: Look at the first field (minute) → 30 This means "at 30 minutes past the hour."

Step 2: Look at the second field (hour) → 14 This means "at hour 14," which is 2:00 PM in 24-hour format.

Step 3: Look at the third field (day of month) → * The asterisk means "every day of the month."

Step 4: Look at the fourth field (month) → * Again, asterisk means "every month."

Step 5: Look at the fifth field (day of week) → * Once more, asterisk means "every day of the week."

Translation: "At 2:30 PM every day."

Understanding the Asterisk

The asterisk (*) is the most common character you'll see in cron expressions. It's a wildcard that means "every possible value" for that field. Think of it as "don't care about this field" or "any value works."

If all five fields contain asterisks (* * * * *), the task runs every single minute. If only the minute field is asterisk (* 9 * * *), the task runs every minute during the 9:00 AM hour.

Advertisement

Decoding Number Ranges

When you see a hyphen, it defines a range of values:

0 9 * * 1-5

The 1-5 in the day of week field means "Monday through Friday." Days of the week are numbered from 0 (Sunday) through 6 (Saturday), with 7 also representing Sunday for compatibility.

Translation: "At 9:00 AM, every day, every month, Monday through Friday" or more naturally, "At 9:00 AM on weekdays."

Another example:

0 8-17 * * *

The 8-17 in the hour field means hours 8 through 17 (8:00 AM through 5:00 PM).

Translation: "Every hour from 8:00 AM to 5:00 PM."

Reading Multiple Values with Commas

Commas let you specify multiple discrete values:

0 9,12,15 * * *

The 9,12,15 in the hour field means "hours 9, 12, and 15."

Translation: "At 9:00 AM, 12:00 PM, and 3:00 PM every day."

You can use commas in any field:

30 14 1,15 * *

Translation: "At 2:30 PM on the 1st and 15th of every month."

This is particularly useful for specifying specific days:

0 6 * * 1,3,5

Translation: "At 6:00 AM on Monday, Wednesday, and Friday."

Understanding Step Values with Slashes

The slash character specifies intervals or step values. It answers the question: "How often should this repeat?"

*/5 * * * *

The */5 in the minute field means "every 5 minutes." Starting from 0, the task runs at minutes 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, and 55.

Translation: "Every 5 minutes, all day, every day."

The slash can be used with ranges too:

0 9-17/2 * * *

The 9-17/2 means "every 2 hours between 9:00 AM and 5:00 PM," so it runs at 9:00 AM, 11:00 AM, 1:00 PM, 3:00 PM, and 5:00 PM.

Translation: "Every 2 hours during business hours (9 AM to 5 PM)."

Another common pattern:

0 0 */2 * *

The */2 in the day field means "every 2 days."

Translation: "At midnight every other day."

Combining Special Characters

The real power comes from combining these characters:

*/15 8-17 * * 1-5

Let's break this down:

  • */15: Every 15 minutes
  • 8-17: During hours 8 AM through 5 PM
  • *: Every day of the month
  • *: Every month
  • 1-5: Monday through Friday

Translation: "Every 15 minutes during business hours on weekdays."

A more complex example:

0,30 9-17 * * 1-5
  • 0,30: At minute 0 and minute 30 (on the hour and half-hour)
  • 9-17: During hours 9 AM through 5 PM
  • *: Every day of the month
  • *: Every month
  • 1-5: Monday through Friday

Translation: "Every 30 minutes during 9 AM to 5 PM on weekdays."

Common Patterns You'll Encounter

Once you recognize these patterns, reading becomes much faster:

Every Minute: * * * * * Runs 1,440 times per day. Usually too frequent for most tasks.

Every Hour: 0 * * * * Runs at the top of every hour (XX:00).

Daily at Midnight: 0 0 * * * The most common pattern for daily tasks.

Daily at Specific Time: 30 2 * * * Daily at 2:30 AM, often used for maintenance windows.

Weekdays Only: 0 9 * * 1-5 Common for business-related tasks.

Weekly on Monday: 0 9 * * 1 Weekly reports or maintenance.

Monthly on First Day: 0 0 1 * * Monthly billing, reports, or cleanup tasks.

First Monday of Month: This actually requires a script, as cron can't express this directly.

Time Format Considerations

Remember that cron uses 24-hour format for hours:

  • 0 = Midnight (12:00 AM)
  • 6 = 6:00 AM
  • 12 = Noon (12:00 PM)
  • 18 = 6:00 PM
  • 23 = 11:00 PM

If you see 0 0 * * *, that's midnight, not noon. For noon, you'd use 0 12 * * *.

Day Confusion: Month vs. Week

One tricky aspect is when both day-of-month and day-of-week are specified (neither is an asterisk). In most cron implementations, the task runs when EITHER condition is met (OR logic, not AND).

For example:

0 9 1 * 1

This runs at 9:00 AM on:

  • The 1st of every month (regardless of day of week), OR
  • Every Monday (regardless of day of month)

This is often not what people expect! If you want "first Monday only," you typically need to use an asterisk for one field or handle it in your script.

Practice Reading Real-World Examples

Example 1: 0 */6 * * *

  • Minute: 0 (on the hour)
  • Hour: */6 (every 6 hours)
  • Translation: "Every 6 hours at the top of the hour" (runs at 12 AM, 6 AM, 12 PM, 6 PM)

Example 2: 45 23 * * 6

  • Minute: 45
  • Hour: 23 (11 PM)
  • Day of month: * (any)
  • Month: * (any)
  • Day of week: 6 (Saturday)
  • Translation: "At 11:45 PM every Saturday"

Example 3: 0 0 1,15 * *

  • Translation: "At midnight on the 1st and 15th of every month"

Example 4: */10 9-17 * * 1-5

  • Translation: "Every 10 minutes from 9 AM to 5 PM on weekdays"

Example 5: 0 2 * * 0

  • Translation: "At 2:00 AM every Sunday"

Practice: Decode Any Expression Live

The fastest way to cement the field-by-field reading habit is to check your own translation against a tool. Type any expression below and confirm the plain-English reading and the next run times match what you decoded by hand.

Loading interactive tool...

Tips for Getting Better at Reading Cron

Practice with a Tool: Use our Cron Expression Builder to see how expressions translate to plain English and when they'll run next.

Read from Left to Right: Always process fields in order: minute, hour, day, month, weekday. Don't skip around.

Start with Asterisks: Look for which fields are asterisks (wildcards) first. These tell you what the schedule DOESN'T care about.

Look for Special Characters: Identify slashes (intervals), commas (lists), and hyphens (ranges) to understand the complexity.

Verify with Examples: Think through several execution times to ensure your interpretation matches reality.

Consider Time Zones: Remember that cron runs in the server's time zone unless configured otherwise.

When to Use Tools vs. Reading Manually

While learning to read cron expressions is valuable, you don't always need to decode them manually. For quick verification or complex expressions, use automated tools that provide:

  • Plain English translations
  • Next several execution times
  • Visual calendars showing when tasks run
  • Validation that the syntax is correct

Our free Cron Expression Builder provides all these features, making it easy to both create and understand cron schedules without memorizing every syntax rule.

Whether you're debugging an existing cron job, reviewing a colleague's automation, or simply trying to understand when a scheduled task will run, the ability to read cron expressions is an essential skill for developers and system administrators. With practice, these five-field strings become as readable as plain English.

Frequently Asked Questions

How do you read a cron expression?

Read the five fields left to right: minute, hour, day-of-month, month, day-of-week. Translate each field on its own, then combine them into one sentence. For example, 0 9 * * 1-5 reads as minute 0, hour 9, any day of the month, any month, weekdays 1 through 5 — "at 9:00 AM on weekdays." An asterisk means "every value," so scan for asterisks first to see what the schedule does not restrict.

What are the five fields in a cron expression?

A standard cron expression has exactly five space-separated fields, in this order: minute (0-59), hour (0-23), day of month (1-31), month (1-12), and day of week (0-7, where both 0 and 7 mean Sunday). Some systems add an optional sixth field for seconds at the front, but classic Unix cron and most schedulers use five.

What does the asterisk (*) mean in cron?

The asterisk is a wildcard that matches every possible value for its field. In the hour field it means "every hour"; in the day-of-week field it means "every day." The expression * * * * * — five asterisks — runs the task every single minute, 1,440 times a day.

What do the slash, comma, and hyphen mean in cron?

A hyphen defines an inclusive range (1-5 = Monday through Friday). A comma builds a list of discrete values (9,12,15 = 9, 12, and 15). A slash defines a step or interval (*/5 = every 5th value: 0, 5, 10, …). You can combine them: 0-30/10 means every 10 units from 0 to 30.

In cron, is 0 Sunday or Monday?

In the day-of-week field, 0 is Sunday. The valid range is 0-7, and 7 is also Sunday for backward compatibility, so both 0 and 7 mean Sunday. Monday is 1, and Saturday is 6. Many implementations also accept the three-letter names SUN, MON, … SAT.

Does a cron expression use 24-hour time?

Yes. The hour field is 0-23 in 24-hour format, with no AM/PM. 0 is midnight, 12 is noon, and 18 is 6:00 PM. So 0 0 * * * runs at midnight, not noon — for noon you would write 0 12 * * *.

What happens when both day-of-month and day-of-week are set?

When neither the day-of-month nor the day-of-week field is an asterisk, standard Unix cron (Vixie cron) uses OR logic: the job runs when EITHER condition matches. 0 9 1 * 1 fires at 9 AM on the 1st of the month AND on every Monday — not only on a 1st that happens to be a Monday. This surprises people; if you need an AND, keep one of the two fields as * and filter the other in your script.

How do I read every 5 minutes in cron?

*/5 * * * * reads as "every 5 minutes." The */5 in the minute field steps through 0, 5, 10, 15, … 55, and the four asterisks mean every hour, every day, every month, every weekday. See the dedicated guide on the every-5-minutes pattern for edge cases like intervals that don't divide evenly into 60.

cronautomationtask schedulingtutorialdevops