DeveloperApril 2026 · 7 min read

How to Build a Cron Expression (With Examples)

Cron is the Unix job scheduler that runs commands on a schedule. A cron expression is a five-field string that defines when a job runs — minute, hour, day of month, month, and day of week. The syntax is compact but cryptic until you've memorized the field order and special characters.

Try the Cron Builder
Free, no signup
DG
Derek Giordano
Designer & Developer
In this guide
01The Five Fields02Common Cron Schedules03Special Characters Explained04Common Gotchas
⚡ Key Takeaways
  • Build cron expressions for scheduling jobs.
  • The Five Fields.
  • Covers common cron schedules.
  • Covers special characters explained.
  • Covers common gotchas.

The Five Fields

A cron expression has five fields separated by spaces:

minute (0–59) | hour (0–23) | day of month (1–31) | month (1–12) | day of week (0–6, Sunday=0)

Each field can be a specific value, a range (1-5), a list (1,3,5), a step (*/5 = every 5 units), or a wildcard (* = every value). Example: 30 9 * * 1-5 means 'at 9:30 AM, every weekday.'

Common Cron Schedules

Every minute: * * * * *

💡 Tip
Use 3+ color stops instead of 2 to avoid the muddy gray band that appears in the center of complementary-color gradients.

Every hour: 0 * * * *

Every day at midnight: 0 0 * * *

Every day at 9 AM: 0 9 * * *

Every Monday at 8 AM: 0 8 * * 1

Every weekday at 6 PM: 0 18 * * 1-5

First day of every month at noon: 0 12 1 * *

Every 15 minutes: */15 * * * *

Every 6 hours: 0 */6 * * *

Every Sunday at 2 AM: 0 2 * * 0

Special Characters Explained

* (wildcard) matches every value in the field. / (step) creates intervals — */5 in the minute field means every 5 minutes. - (range) specifies a continuous range — 1-5 in the day-of-week field means Monday through Friday. , (list) specifies discrete values — 1,15 in the day-of-month field means the 1st and 15th. Some implementations also support @ shortcuts: @hourly, @daily, @weekly, @monthly, @yearly.

⚠ Warning
CSS gradients used as backgrounds cannot be animated with standard transitions. Use background-size animation or @property registered custom properties instead.

Common Gotchas

Cron uses 24-hour time — there's no AM/PM. The day-of-week field starts at 0 (Sunday) in most systems, but some use 7 for Sunday. If you specify both day-of-month and day-of-week, the job runs when either condition is true (OR logic), not when both are true — this surprises many people. Time zones matter — cron typically uses the server's local time zone. The Cron Builder tool lets you construct expressions visually, shows the next 5 run times, and catches these common mistakes.

Frequently Asked Questions

What is a cron expression?+
A cron expression is a five-field string that defines a schedule for recurring jobs. The fields are minute, hour, day of month, month, and day of week. Each field uses numbers, wildcards, ranges, or steps to define when the job runs.
How do I schedule a cron job for every 5 minutes?+
Use */5 * * * * — the */5 in the minute field means 'every 5 minutes.' The wildcards in the other fields mean 'every hour, every day, every month, every day of week.'
What does * mean in a cron expression?+
The asterisk (*) is a wildcard that matches every possible value for that field. In the hour field, * means 'every hour.' In the day-of-month field, * means 'every day.'
Try it yourself

Use the Cron Builder — free, no signup required.

⚡ Open Cron Builder
DG
Derek Giordano
Written by the creator of Ultimate Design Tools. BA in Business Marketing.