---
schema_version: "1"
id: ab7a6761dc46a2f2ca722d71b67a9d2bef52311eaf7b6421740f54d57c9e1037
title: Random()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/ampscript/references/utilities/mc-ampscript-reference-utilities-random.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-random.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 725b5e3bffed58432fcd23be71f1a1433f7c5fcbc9000654764e85bb35bd6bb8
products:
  - AMPscript for Marketing Cloud
  - Marketing Cloud
---
# Random()

Returns a random number within a defined range.

## Availability

<table>
  <tr>
    <td>Marketing Cloud Engagement</td>
    <td>✅ Yes</td>
  </tr>
  <tr>
    <td>Marketing Cloud Next</td>
    <td>✅ Yes</td>
  </tr>
</table>

This function became available in Marketing Cloud Next during the Summer ’26 release (API version 67.0).

## Syntax

```
Random(lowerBound, upperBound)
```

The `Random()` function has two parameters:

- `lowerBound` (number): Required. The smallest number that the function can return.
- `upperBound` (number): Required. The largest number that the function can return.

## Usage

To use this function, pass it a lower and an upper bound. The numbers can be positive or negative integer or decimal numbers. The order of the `upperBound` and `lowerBound` parameters in the function doesn’t matter.

```
%%=Random(42,32256)=%%
```

The function returns a random number that is greater than or equal to the smallest number, and less than or equal to the largest number.
