Cron expression generator

The cron expression generator builds a schedule once and writes it in four dialects: classic 5-field Unix cron, 6-field cron with seconds for node-cron and Spring, Quartz, and AWS EventBridge, each with its own field order and weekday numbering.

Syntax
0-59
0-23
1-31
1-12
0-7

Every 5 minutes.

*/5 * * * * in standard 5-field cron

For classic 5-field crontab, crontab.guru is the tool and has been for years. This page is for the expressions it does not read: the ones with a seconds field, Quartz with its question marks, and AWS with its year. They look alike, and a schedule copied from one into another either fails to parse or, worse, runs on the wrong day.

Cron expression generator with 6 fields: two different sixth fields

"6 fields" means two different things. Quartz, Spring and node-cron add seconds at the front: second, minute, hour, day of month, month, day of week. AWS EventBridge adds a year at the end: minute, hour, day of month, month, day of week, year. Same count, shifted by one field: paste an AWS expression into Spring and every minute value becomes a second. Check which end the extra field is on before anything else.

Cron expression generator with seconds

node-cron takes an optional seconds field first. Spring @Scheduled requires it. Both keep Unix weekday numbers, 0 to 7, where 0 and 7 are Sunday. So */10 * * * * * is every 10 seconds, and 0 0 9 * * 1-5 is 09:00 on weekdays. A plain Linux crontab rejects all of these: its smallest unit is a minute.

Quartz cron expression generator

  • Fields: second, minute, hour, day of month, month, day of week, and an optional year.
  • Weekdays are 1 to 7 from Sunday. 1 is Sunday, 2 is Monday. Unix 1-5 becomes Quartz 2-6, or MON-FRI, which never drifts.
  • One of the two day fields must be ?. Unix 0 9 * * 1-5 is Quartz 0 0 9 ? * MON-FRI.
  • Extras: L for last, W for nearest weekday, # for nth weekday. 6#3 is the third Friday.

AWS cron expression generator for EventBridge

  • Wrapped as cron(minutes hours day-of-month month day-of-week year). Six fields, no seconds.
  • Weekdays are 1 to 7 from Sunday, like Quartz. Same ? rule: cron(0 9 * * * *) fails, cron(0 9 * * ? *) runs daily.
  • Legacy EventBridge rules always run in UTC. EventBridge Scheduler takes a time zone.
  • Nothing faster than once a minute.

The same conversion as a function you can paste into Node:

convert-cron.js
// 5-field Unix cron in, seconds / Quartz / AWS out.
function convert(unix) {
  const [min, hour, dom, month, dow] = unix.trim().split(/\s+/);
  if (dom !== '*' && dow !== '*') {
    throw new Error('Quartz and AWS cannot OR the day fields');
  }
  if (/-7\b/.test(dow)) throw new Error('Write Sunday as 0 in a range');

  // Unix weekdays 0-7 (0 and 7 = Sunday) become 1-7 from Sunday.
  const weekday = dow.replace(/\d+/g, (d) => String((Number(d) % 7) + 1));
  const days =
    dow === '*'
      ? `${dom.replace(/^\*\//, '1/')} ${month} ?`
      : `? ${month} ${weekday}`;
  const time = [min, hour].map((f) => f.replace(/^\*\//, '0/')).join(' ');

  return {
    seconds: `0 ${unix.trim()}`, // node-cron, Spring @Scheduled
    quartz: `0 ${time} ${days}`,
    aws: `cron(${time} ${days} *)`,
  };
}

console.log(convert('0 9 * * 1-5'));
// {
//   seconds: '0 0 9 * * 1-5',
//   quartz: '0 0 9 ? * 2-6',
//   aws: 'cron(0 9 ? * 2-6 *)'
// }

Logdash vs crontab.guru

FeatureLogdashcrontab.guru
Classic 5-field crontabYesYes, and the reference everyone links
Seconds, Quartz and AWS dialectsAll three, converted from one schedule5 fields only
Monitoring a nightly jobPush monitors expect a ping every check, 15 seconds on ProCronitor, from the same team, watches any schedule

When crontab.guru is the better pick

  • Your schedule lives in a Linux crontab or a GitHub Actions workflow. Both use 5 fields and crontab.guru reads them best.
  • You need to know when a job that runs hourly or nightly did not run. Cronitor checks each run against its schedule. Logdash push monitors do not.

Know when the scheduler dies

A seconds field is useful for one thing in monitoring: a heartbeat from a worker or scheduler process that should never stop.

heartbeat.js
import cron from 'node-cron';

cron.schedule('*/10 * * * * *', async () => {
  await fetch('https://api.logdash.io/ping/<monitorId>', { method: 'POST' });
});
  1. Create a push monitor On Pro, add a push monitor to the service and copy its id. The ping URL is public: no auth header, no body.
  2. Start the heartbeat Run the snippet inside the worker. Pro evaluates push monitors every 15 seconds, and a ping every 10 lands in every window.
  3. Kill the process Stop the worker. Within 30 seconds a check window passes with no ping, the monitor flips to down, and a Telegram alert arrives naming it.
Cron expression generator 6 fields: is the sixth field seconds or year?
Depends on the scheduler. Quartz, Spring and node-cron put seconds first. AWS EventBridge puts year last. Read the field order in the docs before you paste.
Cron expression generator with seconds: which schedulers accept it?
node-cron (optional), Spring @Scheduled (required) and Quartz (required). Linux crontab, GitHub Actions and AWS EventBridge stop at minutes.
Quartz cron expression generator: why does it need a question mark?
Quartz cannot combine a day-of-month and a day-of-week value, so one of them must be ?, meaning no specific value. Every day at 09:00 is 0 0 9 * * ?.
AWS cron expression generator: why does cron(0 9 * * * *) fail?
EventBridge does not allow * in both day fields. Put ? in one of them: cron(0 9 * * ? *) runs every day at 09:00, in UTC unless your Scheduler schedule sets a time zone.

Point it at your own URL and watch it for real.