---
schema_version: "1"
id: 2bd0fc671c1b9e7a407dfaa4e5943257dff5e7735241c1ec5175ced3b45f5680
title: "Handlebars Helper Function: md5"
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/handlebars/reference/encryption/mcn-handlebars-reference-encryption-md5.md
canonical_url: https://developer.salesforce.com/docs/marketing/handlebars-for-marketing-cloud-next/references/mcn-handlebars-encryption-references/mcn-handlebars-reference-encryption-md5.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 19678b47b5d97839ed28a8c8658b2faa99daf90af3c64be49ef465f6ccc9bc64
products:
  - Handlebars for Marketing Cloud Next
  - Marketing Cloud
---
# Handlebars Helper Function: md5

Converts a string to a 128-bit hexadecimal MD5 hash.

## Availability

This helper is available in the Winter ’27 release of Marketing Cloud Next.

## Syntax

```handlebars
{{md5 STRING_TO_CONVERT charset=CHARSET}}
```

## Parameters

| Parameter           | Type   | Description                                                                                                               |
| ------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------- |
| `STRING_TO_CONVERT` | String | Required. The string to hash.                                                                                             |
| `charset`           | String | The character set to use. Specify as a named parameter. Accepted values are `UTF-8` and `UTF-16`. The default is `UTF-8`. |

## Return Value

The function returns the 128-bit MD5 hash as a hexadecimal string.

## Usage Example

This example hashes a string of text so that the plain-text value isn't stored or transmitted directly.

```handlebars
{{md5 "This is a string of text."}}
```

The function returns this MD5 hash:

```text
7ccb47715d465a9e6a2b7d3c0441da80
```

### Using UTF-16 Encoding

This example hashes the same string, but specifies UTF-16 encoding.

```handlebars
{{md5 "This is a string of text." charset="UTF-16"}}
```

Because the character encoding changes the bytes that are hashed, the function returns a different hash:

```text
3251ab3b9d54f085f6b57aa3bc134c3c
```

**note:** MD5 is a one-way hash and isn't suitable for securely storing passwords or other sensitive data.
