---
schema_version: "1"
id: c3cb6ba564a16632df401e923523c587e70c8bf434352cae7be8def85adf7230
title: char_length({str})
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/analytics/bi_dev_guide_sql/guides/bi-sql-string-char-length.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-string-char-length.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: aab0af121f134c3efaadccb191fbac4d0008f00c880be05c0fca5ebf0b9b3f0e
products:
  - SQL for Analytics Developer Guide
  - analytics
---

# char_length({str})

Returns the number of characters in a given string.

## Example

This example returns the number of characters in the first five entries in the City column.

```nolang
SELECT City, CHAR_LENGTH(City) as "CityLen"
FROM "Superstore"
GROUP BY City
LIMIT 5;
```

| City        | CityLen |
| ----------- | ------- |
| Aberdeen    | 8       |
| Abilene     | 7       |
| Akron       | 5       |
| Albuquerque | 11      |
| Alexandria  | 10      |
