Cron expression guide

A cron expression is five fields that say when a scheduled job should run. Here is how to read and write them.

The five fields

┌─────────── minute (0-59)
│ ┌───────── hour (0-23)
│ │ ┌─────── day of month (1-31)
│ │ │ ┌───── month (1-12)
│ │ │ │ ┌─── day of week (0-6, Sun=0)
│ │ │ │ │
* * * * *

Some schedulers add a leading seconds field, making a 6-field expression. CronKit understands both.

Special characters

CharacterMeaningExample
*every value* * * * * — every minute
*/nevery n steps*/15 * * * * — every 15 minutes
a-ba range0 9 * * 1-5 — weekdays at 9 AM
a,ba list of values0 0 * * 6,0 — Saturday and Sunday
Llast day of month0 0 L * * — last day at midnight

Compute next runs in code

curl

curl "https://cron.wrapper-agency.com/api/v1/cron?expr=0 9 * * 1-5&tz=UTC"

JavaScript (fetch)

const res = await fetch(
  "https://cron.wrapper-agency.com/api/v1/cron?expr=" + encodeURIComponent("0 9 * * 1-5")
);
const { human, nextRuns } = await res.json();
console.log(human);            // "At 09:00 AM, Monday through Friday"
console.log(nextRuns[0].iso);  // next run as ISO timestamp

Python (requests)

import requests
r = requests.get(
    "https://cron.wrapper-agency.com/api/v1/cron",
    params={"expr": "0 9 * * 1-5", "tz": "Europe/Paris"},
)
print(r.json()["human"])

Common expressions

See the full cron API reference, or start from the explainer & builder.