## Syntax
```mermaid
%%{init: {
'theme': 'base',
'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
'themeVariables': {
'fontSize': '11px',
'fontFamily': 'Arial'
}
}}%%
flowchart LR
Start((START)) --> UNICODE_TO_BLOB[UNICODE_TO_BLOB]:::quoted
UNICODE_TO_BLOB --> End((END))
```
## Purpose
The `UNICODE_TO_BLOB` SQL function converts a value into a `blob`. Text is interpreted as UTF-16.
See also [[ASCII_TO_BLOB]], [[HEX_TO_BLOB]] and [[TO_BINARY]].
Parameters:
- Input (`varchar2`): value to convert.
Returns: the input converted to a `blob`.
## Examples
The following example converts the text `hi` to a `blob` with the UTF-16 representation and retrieves the length in bytes; each character takes two bytes:
```sql
select length(unicode_to_blob('hi'))
-------------------
4
```
The following example converts a text to a `blob` with the UTF-16 representation and retrieves the BASE64-encoded value:
```sql
select base64_encode(unicode_to_blob('This is a base64 test'))
--------------------------------------------------------
VABoAGkAcwAgAGkAcwAgAGEAIABiAGEAcwBlADYANAAgAHQAZQBzAHQA
```