> ## 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.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.firebolt.io/feedback

```json
{
  "path": "/reference-sql/functions-reference/array/array-length",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

> 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":"github-light","dark":"github-dark"}}
ARRAY_LENGTH(<array>)
```

## Parameters

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

## Return Type

`INTEGER`

## Example

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT
	ARRAY_LENGTH([ 1, 2, 3, 4 ]) AS levels;
```

**Returns**: `4`

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT
	ARRAY_LENGTH([ [ 1, 2, 3 ], [ 4, 5, 6, 7 ]) AS levels;
```

**Returns**: `2`
