Cron Expressions Explained: How to Read Those Five Asterisks
*/15 9-17 * * 1-5 — if that looks like line noise, you’re in good company. Cron, the scheduling syntax that runs everything from backups to billing jobs, has a reputation for being write-once, read-never. But it’s built on a single consistent pattern, and once it clicks, you can read any schedule at a glance. Here’s the whole thing.
The five fields
A standard cron expression is five fields separated by spaces. Each field controls one unit of time, always in the same order:
┌───────────── minute (0–59)
│ ┌─────────── hour (0–23)
│ │ ┌───────── day of month (1–31)
│ │ │ ┌─────── month (1–12)
│ │ │ │ ┌───── day of week (0–6, Sunday = 0)
│ │ │ │ │
* * * * *
A job runs when all the fields match the current time. That’s the entire model. Everything else is just ways of writing what counts as a match. Build and preview any expression with the cron generator, which shows the next run times in plain language.
The five symbols
Each field accepts the same small set of operators:
*(asterisk) — “every.”*in the hour field means every hour.,(comma) — a list.1,15in the day-of-month field means the 1st and the 15th.-(dash) — a range.9-17in the hour field means 9 AM through 5 PM inclusive./(slash) — a step.*/15in the minute field means every 15 minutes (0, 15, 30, 45).10/2means “from 10, every 2.”- A plain number — that exact value.
0in the minute field means the top of the hour.
That’s it. Five fields, five symbols. Combine them and you can express almost any schedule.
Reading real examples
Let’s decode some common ones:
0 0 * * *— minute 0, hour 0, every day. Midnight, daily.*/15 * * * *— every 15 minutes.0 9 * * 1-5— minute 0, hour 9, Monday–Friday. 9 AM on weekdays.0 0 1 * *— midnight on the 1st of every month. Monthly.30 2 * * 0— 2:30 AM on Sunday. Weekly, off-peak.*/15 9-17 * * 1-5— our opening example: every 15 minutes, 9 AM–5 PM, weekdays. A classic “during business hours” job.
Notice the pattern: read left to right as “at minute X, at hour Y, on these days.” If you can narrate it that way, you’ve read it correctly. The cron generator does this narration for you and lets you tweak each field with a dropdown if you’d rather not hand-write them.
The gotchas that bite everyone
Cron has a few sharp edges that cause real production incidents:
1. The two day fields are an OR, not an AND. If you set both day-of-month and day-of-week to specific values, the job runs when either matches, not both. 0 0 13 * 5 does not mean “Friday the 13th” — it means “every 13th and every Friday.” This surprises almost everyone. To target a specific weekday, leave day-of-month as *.
2. Sunday is both 0 and (sometimes) 7. Most cron implementations accept 0 or 7 for Sunday. Stick with 0 to avoid confusion.
3. Steps don’t always start where you think. */40 in the minute field fires at minute 0 and 40 — then the hour rolls over and it starts again at 0. So the gap between the :40 run and the next :00 run is only 20 minutes, not 40. Steps restart each cycle; they don’t span field boundaries.
4. Time zones. This is the big one. Cron runs in the server’s local time zone (or UTC, depending on the system). A job scheduled for 0 9 * * * runs at 9 AM server time, which may be the middle of the night for you — and daylight-saving shifts can move it by an hour twice a year. Always confirm what zone your scheduler uses. When you’re coordinating a job’s run time against your own zone, the timezone converter makes the offset explicit, and the timestamp converter helps when logs report run times as Unix timestamps.
Writing your own, safely
A reliable workflow:
- Start from intent in words — “every weekday at 9 AM.”
- Map each phrase to a field — minute 0, hour 9, day-of-week 1–5, the rest
*. - Preview before you deploy. Paste it into the cron generator and check the next several run times read the way you expect. This catches the day-field OR trap and step surprises immediately.
- Confirm the time zone your scheduler uses, separately.
Cron’s syntax is dense, but it isn’t arbitrary — it’s five fields, five operators, and a handful of well-known gotchas. Read it left to right, preview before you ship, and double-check the time zone, and those five asterisks stop being a mystery.