---
schema_version: "1"
id: 0d7b7a0ae300f3f20028d12b16c5bb2969d74c6df0a6cd904761cc14e3a9a698
title: "Handlebars Helper Function: modulo"
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-modulo.md
canonical_url: https://developer.salesforce.com/docs/marketing/handlebars-for-marketing-cloud-next/references/mcn-handlebars-math-references/mcn-handlebars-reference-math-modulo.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 7c2cc31bdec683e1c177b6548b4acd80450cb455d18f0780c76c139703617b47
products:
  - Handlebars for Marketing Cloud Next
  - Marketing Cloud
---
# Handlebars Helper Function: modulo

Performs the modulo operation on two numeric arguments and returns the remainder. The function can handle both integer and floating-point numbers, and attempts to convert strings to numbers.

## Availability

This helper is available in the Winter ’26 release of Marketing Cloud Next.

## Syntax

```handlebars
{{modulo value1 value2}}
```

## Parameters

| Parameter | Type             | Description                                                                                        |
| --------- | ---------------- | -------------------------------------------------------------------------------------------------- |
| `value1`  | Number or String | Required. The first value (dividend). Must be a number or convertible to a number.                 |
| `value2`  | Number or String | Required. The second value (divisor). Must be a number or convertible to a number, and can’t be 0. |

## Return Value

The function returns the remainder of the division operation. If you provide more than two arguments, the operation uses only the first two. The result is always a number rounded to 2 decimal places. If you divide by 0, the operation throws an exception.

If either input is a string, the operation tries to convert it to a number. If a string value can’t be converted to a number, the operation throws an exception. Division by zero throws an exception.
