# Cron expression explainer

Read a cron expression in plain English

Use it at https://www.quicktoolz.com/tools/cron-explainer. From QuickToolz.

A cron expression sets when a job runs, using five fields: minute, hour, day of the month, month and day of the week. A star means every value. So 0 9 * * 1-5 means 09:00 on weekdays. Paste one to read it in plain English and see its next five runs in your own time.

## How it works

minute hour day of month month day of week

We check each field, and name exactly what’s wrong if one isn’t valid. If you set both a day of the month and a day of the week, standard cron runs on either one.

Worked example: 0 9 * * 1-5 means minute 0, hour 9, any day, any month, Monday to Friday: At 09:00 on Monday, Tuesday, Wednesday, Thursday and Friday.

## Examples

| Expression | Meaning |
| --- | --- |
| */5 * * * * | Every 5 minutes |
| 0 * * * * | At the start of every hour |
| 0 0 * * * | At 00:00 |
| 0 9 * * 1-5 | At 09:00 on Monday, Tuesday, Wednesday, Thursday and Friday |
| 0 0 1 * * | At 00:00 on day 1 of the month |

## What this tool doesn't cover

- Some systems add their own symbols, such as ? and L, which this doesn’t read.
- Next runs use your own time zone, and your server may use another.

## Questions

### What does */5 mean?

Every 5 units. In the minute field, that’s every 5 minutes.

### Is Sunday 0 or 7?

Both work.

### What time zone does cron use?

Usually the server’s. Check yours, because next runs here use your own zone.

### How do I read a cron expression?

The five fields are minute, hour, day of the month, month and day of the week. A * means every value.

### How do I run a job every day at midnight?

Use 0 0 * * *. That means minute 0 of hour 0, on every day.

## Sources

- [POSIX crontab](https://pubs.opengroup.org/onlinepubs/9799919799/utilities/crontab.html)