LENB Function

Counts the bytes in a text value (each double-byte character counts as 2 in Japanese, Chinese or Korean Excel).

Category

Text

Available in

All versions, Microsoft 365

Returns

A number

Want to practice LENB in a real spreadsheet? Open a blank sheet in our Practice Sandbox and try it with live data, with the AI Excel tutor beside you. No Excel needed — just a free account.Try it free in the Sandbox

Overview

LENB is the “byte” version of LEN. It counts bytes instead of characters — but only when a double-byte language (Japanese, Chinese or Korean) is set as Excel's default editing language. Then each double-byte character counts as 2.

In every other setup, including English, LENB gives exactly the same result as LEN. Unless you build workbooks for double-byte systems, use LEN.

Syntax

=LENB(text) Explain

Arguments

ArgumentRequired?What it does
textYesThe text to measure.

Examples

Example 1 — Measuring codes

With English as the default language, LENB counts characters.

B2fx=LENB(A2)
AB
1CodeBytes
2WST-10428
3Northstar9
=LENB(A2) Explain

With English as the default language, =LEN(A2) returns the same answers.

Common mistakes

  • Results change with language settings. A workbook using LENB can give different answers on a computer whose default language is Japanese, Chinese or Korean. Prefer LEN for workbooks you share.

Notes

Kyle Stott

Author

Kyle Stott

Certified Microsoft Excel Expert

Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.