---
schema_version: "1"
id: 6ce8512dcf0133a17e1e82feabc10de5ec8522a5f45d518d52e6d7cf92ed312b
title: "Handlebars Helper Function: random"
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/handlebars/reference/math/mcn-handlebars-reference-math-random.md
canonical_url: https://developer.salesforce.com/docs/marketing/handlebars-for-marketing-cloud-next/references/mcn-handlebars-math-references/mcn-handlebars-reference-math-random.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 176e49961a4884bf405eac6bce19d857417e7968bdde99000e9f93cbbd2e9c77
products:
  - Handlebars for Marketing Cloud Next
  - Marketing Cloud
---
# Handlebars Helper Function: random

Generates a random integer between two specified values. The function can handle both integers and floating-point numbers.

## Availability

This helper is available in the Winter ’26 release of Marketing Cloud Next.

## Syntax

```handlebars
{{random first second}}
```

## Parameters

| Parameter | Type             | Description                                                                                                             |
| --------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `first`   | Number or String | Required. The minimum value. Must be a number or convertible to a number.                                               |
| `second`  | Number or String | Required. The maximum value. Must be a number or convertible to a number, and must be greater than or equal to `first`. |

## Return Value

The function returns a random integer that is greater than or equal to `first` and less than or equal to `second`. If you provide more than two arguments, the operation uses only the first two.

The function throws an exception if the second parameter is less than the first, or if either input is a string that can't be converted to a number.
