> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firebolt.io/llms.txt
> Use this file to discover all available pages before exploring further.

> Reference material for OCTET_LENGTH function

# OCTET_LENGTH

Calculates the length of the input string in bytes.

## Syntax

```sql theme={"theme":{"light":"css-variables","dark":"css-variables"}}
OCTET_LENGTH(<expression>)
```

## Parameters

| Parameter      | Description                                               | Supported input types |
| :------------- | :-------------------------------------------------------- | :-------------------- |
| `<expression>` | The string or binary data for which to return the length. | `TEXT`, `BYTEA`       |

## Return Type

`INTEGER`

## Example

Use the `OCTET_LENGTH` to find the length of any string in bytes, such as:

<div className="query-window">
  ```
  SELECT OCTET_LENGTH('🔥');
  ```

  | octet\_length <span>int</span> |
  | :----------------------------- |
  | 4                              |

  <p><span>Rows: 1</span><span>Execution time: 5.21ms</span></p>
</div>

Because the UTF8 encoding of '🔥' has the byte sequence `0xF0 0x9F 0x94 0xA5`.
