LENGTH() in MySQL — How It Works

What the MySQL LENGTH() function does, with an example.

Published October 18, 2026

LENGTH() returns the length of a string in bytes (use CHAR_LENGTH() for character count with multi-byte encodings).

Key points

  • Part of standard SQL functions available in MySQL for working with text/strings

Example

SELECT LENGTH(email) FROM users;
More SQL articles