> ## 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 ARRAY_LENGTH function

# ARRAY_LENGTH

Returns the length of the given array, i.e., how many elements it contains. Produces `NULL` for `NULL` arrays.

**Alias:** [LENGTH](/reference-sql/functions-reference/string/length) (when used with an array argument)

## Syntax

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

## Parameters

| Parameter | Description                                 | Supported input types |
| :-------- | :------------------------------------------ | :-------------------- |
| `<array>` | The array whose length should be calculated | `ARRAY`               |

## Return Type

`INTEGER`

## Examples

<div className="query-window">
  ```
  SELECT ARRAY_LENGTH([1, 2, 3, 4]) AS levels;
  ```

  | levels <span>int</span> |
  | :---------------------- |
  | 4                       |

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

<div className="query-window">
  ```
  SELECT ARRAY_LENGTH([[1, 2, 3], [4, 5, 6, 7]]) AS levels;
  ```

  | levels <span>int</span> |
  | :---------------------- |
  | 2                       |

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