---
title: "SHA256"
description: "The SHA256 SQL function calculates hash value for parameter according to SHA256 algorithm."
language: en
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/sha256
original: https://documentation.invantive.eu/en/docs/invantive-universalsql/grammar/sql-functions/sha256
updated: 2026-08-09T00:00:00Z
license: https://documentation.invantive.eu/en/
---

## Syntax
```mermaid
%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    Start((START)) --> | | SHA256[SHA256]:::quoted
    SHA256 --> End((END))
```

## Purpose
The `SHA256` SQL function calculates hash value for parameter according to SHA256 algorithm.

See also [[SHA1]], [[SHA384]] and [[SHA512]].

Parameters:
- Value (`varchar2` or `blob`): text or BLOB to calculate SHA256 hash value for.

Returns: Hash value.

## Examples
The following example retrieves the SHA256 hash of `abcde`:
```sql
select sha256('abcde')

----------------------------------------------------------------
36bbe50ed96841d10443bcb670d6554f0a34b761be67ec9c4a8ad2c0c44ca42c
```
The following example returns `null` since the input is `null`:
```sql
select sha256(null)

-------------------

```