---
schema_version: "1"
id: ec01fc0c6cf2557a26955562eaf61691410eb16eb67e8fa680c70d3d2095f149
title: Mod()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/ampscript/references/math/mc-ampscript-reference-math-mod.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-math/mc-ampscript-reference-math-mod.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 337ce328ed3394040ae5a0a3c8e9b62cf43f6ab6b0de1dd1476ddcd24ab20be9
products:
  - AMPscript for Marketing Cloud
  - Marketing Cloud
---
# Mod()

Returns the remainder after dividing the first parameter by the second parameter.

## 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

```
Mod(dividend, divisor)
```

The `Mod()` function has two parameters:

- `dividend` (number): Required. The initial number.
- `divisor` (number): Required. The number to divide the dividend by.

## Usage

To use this function, pass it two numbers. The numbers can be positive or negative integer or decimal numbers.

```
%%=Mod(500,12)=%%
```

The function returns the modulus of the two numbers: `8` (500 divided by 12 is 41 with a remainder of 8).

This function also works with decimal and negative numbers.

```
%%=Mod(-500.123,12.456)=%%
```

This example returns the remainder: `-1.88300000000001`.
