Google Sheets function

LEN function in Google Sheets

LEN in Google Sheets returns the number of characters in a text string, including spaces and punctuation. Numbers are counted by the characters in their displayed value. Use LEN to validate code lengths, measure text, or locate segments within consistently formatted strings.

Source: Google Docs Editors HelpLast verified Nov 5, 2026

Syntax

=LEN(text)

Arguments

ArgumentRequiredWhat it means
textYesThe text or value whose characters should be counted.

Examples

Count characters in an order code

A
1Order code
2A-104
=LEN(A2)

Result: 5

The order code contains five characters, including the hyphen.

Common mistakes

Forgetting that spaces count as characters.

Clean unwanted spaces before using LEN when they should not count.

Expecting LEN to count cells in a range.

Use a counting function when you need the number of filled or numeric cells.