Practice free

LENB function

LENB returns the number of bytes used by a text string, counting each double-byte character as two. It differs from LEN only when an East Asian language is enabled.

Example

Practice this in the app

Syntax

LENB(text)

text (required)
The text to measure.

Returns: The number of bytes used by the text.

What Excel actually returns

Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.

FormulaExcel showsCase
=LENB("abc") 3 Single-byte text
=LENB("日本") 2 Double-byte text

Watch out for

  • Same as LEN in non-double-byte settings.

Where it works

Excel
LENB is in every version of Excel from 2007 on. Differs from the non-B version only in East Asian (double-byte) language settings.
Google Sheets
No direct equivalent. Use LEN.

Part of Text functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .