---
schema_version: "1"
id: ac5299fba5c133bc804eb3d4737fb154cff7b78347af35a0ba528d504129ba6a
title: "Handlebars Helper Function: sha256"
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-sha256.md
canonical_url: https://developer.salesforce.com/docs/marketing/handlebars-for-marketing-cloud-next/references/mcn-handlebars-encryption-references/mcn-handlebars-reference-encryption-sha256.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 9dbb2ca574989e44d5b707245dfd4e39d3c2119c04458e8e82fce19db09dce45
products:
  - Handlebars for Marketing Cloud Next
  - Marketing Cloud
---
# Handlebars Helper Function: sha256

Converts a string to a 256-bit hexadecimal SHA-2 hash.

**note:** SHA-256 is a one-way hash and isn't suitable for securely storing passwords or other sensitive data.

## Availability

This helper is available in the Winter ’27 release of Marketing Cloud Next.

## Syntax

```handlebars
{{sha256 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 256-bit SHA-2 hash as a hexadecimal string.

## Usage Example

This example hashes a string of text by using UTF-16 character encoding.

```handlebars
{{sha256 "This is a string of text." charset="UTF-16"}}
```

The function returns a hash of the string.

```
84b87f1ae08610f97a0bb6c228dd2289a54203c23ee2af17d617a1c1b4a0ab1a
```
