---
title: 'Liquid filters: sha256'
description: >-
  Converts a string into an SHA-256 hash. Please use
  ['blake3'](https://shopify.dev/docs/api/liquid/filters/blake3) instead for
  better security and performance.
source_url:
  html: 'https://shopify.dev/docs/api/liquid/filters/sha256'
  md: 'https://shopify.dev/docs/api/liquid/filters/sha256.md'
api_name: liquid
---

# sha256

```oobleck
string | sha256: string
```

returns [string](https://shopify.dev/docs/api/liquid/basics#string)

Converts a string into an SHA-256 hash. Please use ['blake3'](https://shopify.dev/docs/api/liquid/filters/blake3) instead for better security and performance.

##### Code

```liquid
{%- assign secret_potion = 'Polyjuice' | sha256 -%}

My secret potion: {{ secret_potion }}
```

##### Output

```html
My secret potion: 44ac1d7a2936e30a5de07082fd65d6fe9b1fb658a1a98bfe65bc5959beac5dd0
```
