Cron Expression Generator
Build cron expressions visually or describe existing ones in human-readable form.

Utilities

Cron Expression Generator

Build cron expressions visually or describe existing ones in human-readable form.

Cron Expression Generator turns cryptic five-field schedules into plain English and back again. You can build expressions visually in Field Builder — separate selects for Minute, Hour, Day of Month, Month, and Day of Week — or paste a raw expression into Direct Input and hit Describe to get bulleted phrases like "Runs every 5 minutes" or "Runs at 9:00 AM". Fourteen Quick Presets ("Every minute", "Every day at midnight", "Monday to Friday at 9 AM", …) jump you straight to a described expression.

Both directions share one Result block: an Expression code block with copy icon and a Description list you can hand to a teammate. Share encodes the full builder state into a URL hash so a colleague can reopen your exact fields, mode, and description. Generation and humanization are implemented in-repo with no cron-parser dependency, and nothing is sent over the network.

How it works

generateCron joins the five field values with spaces. describeCron splits the expression on whitespace, requires exactly 5 parts (anything else yields "Invalid cron expression: must have exactly 5 fields"), then runs describeField per slot: handle *, */n steps, a-b ranges (with day/month name expansion like 1-5 → "Monday through Friday"), a,b,c lists, and single values. Results compose into "Runs …" bullets stored in cronGeneratorSlice.

Quick Presets come from COMMON_EXPRESSIONS (14 entries) and switch you to Direct Input with the expression pre-filled and described. Share uses copyShareableUrl('cron-generator', { fields, directInput, mode, expression, description }) so reload restores everything via the URL hash. All logic lives in lib/cronGenerator.ts — no outbound calls.

How to use

  1. Step "Configure" — click a Quick Preset (auto-switches to Direct Input + describes) OR pick "Field Builder" mode.
  2. In Builder, set the Minute, Hour, Day of Month, Month, and Day of Week selects (option lists include *, */5, */15, 0, 15, etc.).
  3. Click "Generate" — expression + human description appear under "Result" (toast "Cron expression generated!").
  4. Or switch to "Direct Input", type e.g. */5 * * * *, click "Describe".
  5. Read the "Description" bullets ("Runs every 5 minutes", "Runs at 9:00 AM", …).
  6. Copy the expression via the icon next to the "Expression" label.
  7. "Share" copies a URL restoring fields/mode/expression (toast "Link copied!").
  8. "Clear" resets fields, direct input, and results (toast "Cleared!").

Tips

  • Presets jump you to Direct mode with the expression pre-filled and already described — fastest path for common schedules.
  • Wrong field count yields "Invalid cron expression: must have exactly 5 fields" — this tool is 5-field only, no seconds field.
  • Share round-trips the full builder state (fields, mode, expression, description) through the URL hash.
  • Day-of-week supports ranges like 1-5, described as "Monday through Friday" via day-name expansion.

Cron Expression Generator FAQ

5-field or 6-field cron?

Exactly 5 (minute hour dom month dow) — describeCron rejects any other length with the field-count error.

How do I explain */15 * * * *?

describeField's step handling turns it into "Runs every 15 minutes".

Are there presets?

Yes — 14 COMMON_EXPRESSIONS chips under "Quick Presets", from "Every minute" to "Every Saturday at midnight".

Can I share my expression?

Yes — Share encodes fields, mode, expression, and description into the URL hash via copyShareableUrl.

Does it need the internet?

No — generation and humanization are implemented in-repo in lib/cronGenerator.ts with no cron-parser package and no network calls.

Credits

  • In-repo describeCron — Generation + humanization in lib/cronGenerator.ts (no cron-parser dependency)
ShareTweet
More Utilities

Command Palette

Search for a command to run...