Cron Expression Generator

Generate, build, and configure standard 5-field Linux crontab expressions (Minutes Hours Day-of-month Month Day-of-week) with real-time field validation, human schedule translation, and next execution predictions.

How to Generate Cron Expressions Online

1

Select a Preset or Edit Fields

Choose from common intervals or adjust the 5 crontab parameters manually.

2

Real-time Generation

The tool automatically evaluates your inputs and builds a valid 5-field cron string.

3

Copy Cron String

Click Copy to grab the resulting expression for your crontab file or scheduler.

Tool Options

5-Field Standard Crontab

Fully compliant with Linux crontab syntax (Minutes, Hours, Day of month, Month, Day of week).

Quick Presets

One-click templates for common schedules like every 5 minutes, daily at midnight, or weekly.

Real-time Input Validation

Instant error reporting if field values fall outside allowable numeric ranges.

Your Data Privacy

Web Tool
Privacy-First Architecture
Most of our web tools process your data entirely in-browser. Where server processing is technically required, payloads are evaluated statelessly in-memory and are never stored, saved, or logged.
REST API
Stateless In-Memory Processing
When you use our API endpoints, your requests are processed strictly in-memory without persistent database storage, disk logging, or data retention.
Want to learn more about how we safeguard your information and infrastructure?
Read our full Privacy Policy for detailed security standards, data retention principles, and compliance guarantees.

What does the Cron Expression Generator do?

The Cron Expression Generator helps software engineers, DevOps practitioners, and system administrators build and validate standard 5-field Linux/Unix crontab expressions (Minutes Hours Day-of-month Month Day-of-week). It features structured schedule presets, granular field inputs, real-time syntax checking, and instant CSS/code export.

Core Concepts

Understanding Linux 5-Field Crontab Syntax:

  • Field Structure: * * * * * (Minutes, Hours, Day of Month, Month, Day of Week).
  • Wildcard (*): Represents all possible values for a field (e.g. every minute, every hour).
  • Step Values (/): Defines intervals (e.g. */15 in the minute field triggers every 15 minutes).
  • Ranges (-): Specifies inclusive ranges (e.g. 1-5 in Day of Week triggers Monday through Friday).
  • Lists (,): Specifies multiple discrete values (e.g. 0,30 in minutes triggers at minute 0 and minute 30).

How to use the tool?

  1. Select Preset or Edit: Pick a common schedule from the Quick Schedule Presets dropdown or edit the 5 field boxes manually.
  2. Real-time Evaluation: The tool validates inputs instantly and constructs the crontab string.
  3. Copy Output: Click Copy on the generated crontab expression.

Related Developer Utilities

If you work with scheduling, cloud infrastructure, or DevOps workflows, explore these complementary tools:

REST API Integration

Blueutils provides a free REST API endpoint (POST https://blueutils.com/api/devops/cron-generator) to programmatically calculate and validate 5-field Linux cron expressions.

API Request Parameters

Name Type Description Example
rawText String (Optional) Full 5-field cron string to validate. "*/15 * * * *"
minutes String (Optional) Minute field (0-59, *, /, -, ,). Default "0". "0/15"
hours String (Optional) Hour field (0-23, *, /, -, ,). Default "12". "*"
dayOfMonth String (Optional) Day of month field (1-31, *, /, -, ,). Default "*" "*"
month String (Optional) Month field (1-12, *, /, -, ,). Default "*" "*"
dayOfWeek String (Optional) Day of week field (0-7, *, /, -, ,). Default "*" "*"

API Request Payload Examples

cURL

curl -X POST https://blueutils.com/api/devops/cron-generator \
  -H "Content-Type: application/json" \
  -d '{
    "minutes": "*/15",
    "hours": "*",
    "dayOfMonth": "*",
    "month": "*",
    "dayOfWeek": "*"
  }'

Python

import requests

url = "https://blueutils.com/api/devops/cron-generator"
payload = {
    "minutes": "*/15",
    "hours": "*",
    "dayOfMonth": "*",
    "month": "*",
    "dayOfWeek": "*"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())

Java

import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Main {
    public static void main(String[] args) throws Exception {
        String jsonPayload = """
            {
                "minutes": "*/15",
                "hours": "*",
                "dayOfMonth": "*",
                "month": "*",
                "dayOfWeek": "*"
            }
            """;

        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://blueutils.com/api/devops/cron-generator"))
            .header("Content-Type", "application/json")
            .POST(HttpRequest.BodyPublishers.ofString(jsonPayload))
            .build();

        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}

API Response Parameters

Name Type Description Example
isValid Boolean Indicates whether expression calculation succeeded. true
cronExpression String Complete 5-field cron string. "*/15 * * * *"
rawFields Object Object containing individual field strings. { "minutes": "*/15", ... }

API Response Payload Examples

Success Response (HTTP 200 OK)

{
  "isValid": true,
  "cronExpression": "*/15 * * * *",
  "rawFields": {
    "minutes": "*/15",
    "hours": "*",
    "dayOfMonth": "*",
    "month": "*",
    "dayOfWeek": "*"
  }
}

Validation Failure Response (HTTP 400 Bad Request)

{
  "isValid": false,
  "error": "Invalid Minute value '75': Minute must be between 0 and 59."
}

Rate Limit Exceeded Response (HTTP 429 Too Many Requests)

{
  "error": "API rate limit exceeded. Please wait or contact support@blueutils.com."
}

Why use an API to generate Cron Expressions?

Integrating the Cron Expression API into internal developer portals, CLI utilities, or AI orchestration agents provides key benefits:

  • Automated Workflow Scheduling: Validates cron expressions before writing them to crontab files or database job tables.
  • AI Agent Tool Calling: Allows AI agents building automation tasks to generate valid 5-field crontab syntax programmatically.

Native Usage

How to generate crontab strings programmatically across programming environments:

Node.js (JavaScript)

function buildCron(minutes = '0', hours = '12', dom = '*', month = '*', dow = '*') {
  return `${minutes} ${hours} ${dom} ${month} ${dow}`;
}

console.log(buildCron('*/15', '*', '*', '*', '*'));

Linux (Bash Shell)

#!/bin/bash
MIN="*/15"; HOUR="*"; DOM="*"; MON="*"; DOW="*"
CRON="$MIN $HOUR $DOM $MON $DOW"
echo "$CRON"

Python

def build_cron(min="0", hour="12", dom="*", month="*", dow="*"):
    return f"{min} {hour} {dom} {month} {dow}"

print(build_cron("*/15", "*", "*", "*", "*"))

Java

public class CronBuilder {
    public static String buildCron(String min, String hour, String dom, String month, String dow) {
        return min + " " + hour + " " + dom + " " + month + " " + dow;
    }

    public static void main(String[] args) {
        System.out.println(buildCron("*/15", "*", "*", "*", "*"));
    }
}

Frequently Asked Questions (FAQ)

How do I generate a 5-field Linux cron expression online?

Select a schedule preset or input values into the Minutes, Hours, Day of Month, Month, and Day of Week boxes to output valid crontab syntax.

What is the 5-field Linux crontab format?

The 5 fields are: Minute (0-59), Hour (0-23), Day of Month (1-31), Month (1-12 or JAN-DEC), and Day of Week (0-7 or SUN-SAT).

How do I test and validate Linux crontab syntax before deploying to crontab -e?

Use our real-time validation engine to verify field numbers, step values (*/15), and ranges (1-5) before adding them to your server's crontab -e file.

Rate Limits

UI Limits
100 uses per 15 minutes
Max payload size: 5 MB
API Limits
5 requests per 60 minutes
Max payload size: 256 KB
Need higher API rate limits, increased payload sizes, or custom developer solutions?
Contact our engineering team at support@blueutils.com for custom rate limit increases, higher quota allocations, or tailored enterprise integrations.