Category: FUNCTION | Updated: 2026-11-22
How to Use the LEN Function in Google Sheets | Count Characters in a Text String
How to Use the LEN Function
The LEN function counts the number of characters in a specified text string and returns it as a number. It is frequently used to check character limits for social media posts and titles, as well as to validate data lengths.
Syntax
=LEN(text)
- text: The text string or cell reference whose character count you want to find (required).
Example Using a Table
Here is an example of counting the number of characters in draft article titles.
| Row | Column A (Draft Title) | Column B (Character Count) |
|---|---|---|
| 1 | Draft Title | Character Count |
| 2 | Google Sheets Basics | =LEN(A2) → 20 |
| 3 | Spreadsheet Guide | =LEN(A3) → 17 |
| 4 | (Blank) | =LEN(A4) → 0 |
- Formula:
=LEN(A2) - Result:
20
In row 3, Spreadsheet Guide returns 17 (11 letters in Spreadsheet + 1 space + 5 letters in Guide).
Common Errors and Notes
- Watch Out for Invisible Extra Spaces: Trailing spaces at the end of a string make the count higher than it looks. To measure the true character count, combine with
TRIMlike=LEN(TRIM(A2)). - Passing Number or Date Cells: Passing a cell containing
1000returns4(the number of digits). For cells styled with number formats such as$1,000or2026/11/22,LENcounts the characters of the underlying raw number (or serial value), not the formatted display text. - Passing a Range Does Not Return the Total Count: Passing a range like
=LEN(A2:A4)does not sum across cells. To get the total character count across a range, write=ARRAYFORMULA(SUM(LEN(A2:A4))).
Frequently Asked Questions
Q. Does the LEN function count spaces and line breaks as characters?
A. Yes. Half-width spaces, full-width spaces, and line breaks within a cell are each counted as 1 character.
Q. What is the difference between LEN and LENB?
A. LEN returns the character count (1 per character regardless of full-width or half-width), whereas LENB returns the byte count (1 byte for half-width characters and 2 bytes for full-width characters).