Almost every developer eventually has to write a cron expression. You need a script to run every weekday at 9 AM. You need a backup at the top of every hour. You need a cleanup job to run on the first day of every month. The cron syntax is how you tell a scheduler when those jobs should fire.
The trouble is that cron syntax is cryptic. It is five fields of numbers, stars, slashes, and commas that look meaningless until you have memorised the layout. Even experienced developers reach for a reference every time they write a non trivial cron expression. A cron generator removes the guesswork. You pick the schedule visually and copy the resulting expression. This article explains how cron works, how to build expressions for common schedules, and how to use the DevHexLab Cron Generator to do it without memorising anything.
What Is Cron?
Cron is a Unix utility that runs scheduled tasks. The name comes from the Greek word chronos, meaning time. The cron daemon checks the system's list of scheduled jobs every minute and runs whichever ones are due.
The original Unix cron has been around since the 1970s. The basic syntax it introduced is now used far beyond Unix. AWS EventBridge, Azure Logic Apps, GitHub Actions, GitLab CI, Kubernetes, Jenkins, Power Automate desktop, and many other systems accept cron style expressions for scheduling.
If you can read and write cron, you can schedule things in almost any modern platform.
The Five Field Syntax
A standard cron expression has five space separated fields, in this order: minute, hour, day of month, month, and day of week.
The minute field is a number from 0 to 59. It says which minute of the hour the job should run.
The hour field is a number from 0 to 23 in 24 hour time. It says which hour of the day.
The day of month field is a number from 1 to 31. It says which day of the month.
The month field is a number from 1 to 12 or the three letter abbreviation (JAN through DEC).
The day of week field is a number from 0 to 6 where 0 is Sunday and 6 is Saturday. The three letter abbreviation (SUN through SAT) also works in most cron implementations.
An asterisk in any field means "every". An asterisk in the minute field means every minute. An asterisk in the hour field means every hour.
So the expression "0 9 * * 1" means "at minute 0 of hour 9 on any day of any month, but only when the day of the week is 1 (Monday)". In plain English, every Monday at 9 AM.
Step Values, Ranges, and Lists
Beyond plain numbers and asterisks, cron supports three more notations.
A slash followed by a number means "every N values". So */5 in the minute field means every 5 minutes. The expression "*/15 * * * *" runs every 15 minutes.
A dash between two numbers is a range. So 9-17 in the hour field means hours 9 through 17 (9 AM through 5 PM). The expression "0 9-17 * * 1-5" runs at the top of every hour from 9 AM to 5 PM on weekdays.
A comma separated list picks specific values. So 0,15,30,45 in the minute field means at minute 0, 15, 30, and 45 of each hour. The expression "0,30 * * * *" runs twice an hour, on the hour and the half hour.
You can combine these notations within a single field. So "0,30 9-17 * * 1-5" runs on the hour and half hour from 9 AM to 5 PM on weekdays.
Common Cron Expressions
Here are the cron expressions for the most common schedules.
Every minute is * * * * *.
Every 5 minutes is */5 * * * *.
Every hour at the top of the hour is 0 * * * *.
Every day at midnight is 0 0 * * *.
Every day at 9 AM is 0 9 * * *.
Every Monday at 9 AM is 0 9 * * 1.
Every weekday at 9 AM is 0 9 * * 1-5.
Every Saturday and Sunday at midnight is 0 0 * * 0,6.
First day of every month at midnight is 0 0 1 * *.
Every 15 minutes during business hours on weekdays is */15 9-17 * * 1-5.
Once you can read these, you can adapt them to almost any schedule by adjusting one field at a time.
How to Use the DevHexLab Cron Generator
Open the Cron Generator on DevHexLab. The page shows five controls, one for each cron field, plus a set of preset shortcuts.
Pick a preset that is close to what you want (such as Every day or Every Monday). The five fields fill in automatically. Then adjust any individual field that needs to be different.
For each field, you can pick a single value, a range, a list, or a step. The tool updates the cron expression at the top of the page in real time as you change each field. It also shows a plain English description of what the expression means, like "At 09:00 on Monday".
Once you have the schedule you want, click Copy to grab the cron expression. Paste it into your crontab, your GitHub Actions workflow, your AWS rule, or any other cron compatible scheduler.
Everything happens in your browser. No data is sent anywhere.
Cron Variations to Watch For
Not all cron implementations are identical. There are a few variations to be aware of.
Standard Unix cron uses five fields
This is the most common form, used by Linux crontab, GitHub Actions, GitLab CI, and many cloud schedulers.
Quartz cron uses six or seven fields
Quartz (a Java scheduling library) and some platforms that wrap it (like Spring's @Scheduled annotation and Azure Logic Apps) add a seconds field at the start and sometimes a year field at the end. So Quartz uses second, minute, hour, day of month, month, day of week, and optional year.
If you take a five field Unix cron expression and paste it into a Quartz scheduler, the schedule will be wrong because each field will be interpreted as the next one over.
AWS EventBridge cron has a different day of week
AWS EventBridge uses 1 through 7 for the day of week field where 1 is Sunday, instead of the Unix convention where 0 is Sunday. It also uses a question mark in either the day of month or day of week field when the other one is specified.
Some platforms support special strings
Many crons accept special strings like @daily, @hourly, @weekly, @monthly, and @yearly as shorthand for common schedules. These are convenient but not universal. When in doubt, use the explicit five field form.
Practical Examples
Scheduling a database backup at 2 AM every day
The expression is 0 2 * * *. Translated: minute 0, hour 2, every day, every month, every day of week.
Sending a weekly report Monday morning
The expression is 0 9 * * 1. Translated: minute 0, hour 9, any day, any month, Monday.
Running cleanup on the first of every month
The expression is 0 3 1 * *. Translated: minute 0, hour 3, day 1, every month, every day of week.
Polling an API every 10 minutes during business hours on weekdays
The expression is */10 9-17 * * 1-5. Translated: every 10 minutes, hours 9 through 17, every day, every month, Monday through Friday.
Running a quarterly job
The expression is 0 0 1 1,4,7,10 *. Translated: midnight, day 1, in months 1, 4, 7, and 10.
Mistakes to Avoid
Confusing day of month with day of week
The third field is day of month (1 to 31). The fifth field is day of week (0 to 6). If you specify both, most cron implementations run the job on either condition matching, which is rarely what you want. Use one or the other and put an asterisk in the field you do not need.
Using zero in the day of month field
Day of month is 1 to 31. Zero is not valid. If you want every day, use an asterisk.
Forgetting time zones
Most cron implementations use the server's local time zone. If your server is in UTC but you want a job to run at 9 AM in New York, you need to either convert the time to UTC or use a scheduler that supports time zones.
Scheduling too aggressively
If your job takes longer than the interval between runs, you can end up with overlapping executions that fight each other. Make sure your scheduled job either finishes well before the next run starts or uses a lock to prevent overlap.
Frequently Asked Questions
Does cron run on Windows?
The original cron is Unix only, but Windows has its own task scheduler, and PowerShell can be scheduled through it. Many cross platform tools (like GitHub Actions and AWS) accept cron syntax even when running on Windows under the hood.
How precise can cron be?
Standard cron has minute granularity. The smallest interval is one minute. For more frequent scheduling, you need a tool like systemd timers, a job runner like Celery, or a long running script with its own internal timing.
Can a single line run multiple commands?
In Unix crontab, yes, by joining commands with semicolons or double ampersands inside the cron line. The cleaner approach is to put your commands into a script and call the script from cron.
What happens if the system is off when a job should have run?
Standard cron skips the missed run. Other tools like anacron (and AWS EventBridge with catchup enabled) can run missed jobs after the fact. Check your scheduler's documentation if missed runs are important to you.
Schedule Without Guessing
Cron is one of those tools that you use rarely enough to never quite memorise but often enough that you need it ready. A generator turns the cryptic five field syntax into a few clicks. Open the DevHexLab Cron Generator, pick when your job should run, and copy the result. Save your memory for the work that actually matters.