---
schema_version: "1"
id: 38915b552f36b821576239f68614d67a9a357427b53cf47ec200ca29b327bc9f
title: BIT_LENGTH
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/data-cloud/data-cloud-query-guide/references/data-cloud-sql-reference/scalar-func/string-func/bit-length.md
canonical_url: https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/bit-length.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 7cfa50a813bf31c19d7c1d8412f62fb312043dfaff8e0ff86d545b0269bfbc77
products:
  - Data 360 Query Guide
  - Data 360 Developer Documentation
---
# `BIT_LENGTH`

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Returns the number of bits in a string.

## Syntax

```sql
bit_length(<string>)
```

## Arguments

### Required

- `<string>`: The string to measure.

## Returns

Returns an integer representing the number of bits in the string.

## Considerations

- For UTF-8 strings, multi-byte characters contribute more bits proportionally.
- Each byte equals 8 bits.

## Examples

### Calculate Bit Length

Get the bit length of a string.

```sql
SELECT bit_length('jose') AS result;
```

Returns `32` (4 characters × 8 bits per byte).

## Related Documentation

- [String Types](https://developer.salesforce.com/docs/data/data-cloud-query-guide/datatype/string.md)
