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

# LENGTH

Calculates the length of the input string.

When used with an array argument, `LENGTH` is a synonym for [ARRAY\_LENGTH](/reference-sql/functions-reference/array/array-length)

## Syntax

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

## Parameters

| Parameter      | Description                                               | Supported input types                                                                                    |
| :------------- | :-------------------------------------------------------- | :------------------------------------------------------------------------------------------------------- |
| `<expression>` | The string or binary data for which to return the length. | `TEXT`, `BYTEA`. For `ARRAY`, see [ARRAY\_LENGTH](/reference-sql/functions-reference/array/array-length) |

## Return Type

`INTEGER`

## Example

Use the `LENGTH` to find the length of any string, such as:

<div className="query-window">
  ```
  SELECT LENGTH('The Accelerator Cup');
  ```

  | length <span>int</span> |
  | :---------------------- |
  | 19                      |

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

Spaces are included in the calculation of the total length of the string.
