Show length in characters, UTF-16 units, code points and UTF-8 bytes.
The String Length tool shows how long a piece of text is in several different ways at once: graphemes, code points, UTF-16 units, UTF-8 bytes and UTF-16 bytes. This matters for emoji, accents and non-Latin text, where the answer to how long is it depends on what you measure.
A string can be measured at different levels. A grapheme is what a reader sees as one character, such as a letter, an emoji or a flag. A code point is a single Unicode value, and one grapheme can be made of several. UTF-16 is the encoding JavaScript uses internally, and the length property counts its 16-bit code units, so any code point above U+FFFF takes two. UTF-8 is the encoding used on the web and in files, and it uses one to four bytes per code point. Databases, APIs and form fields may count in any of these. A family emoji is one grapheme but five code points, eight UTF-16 units and 18 UTF-8 bytes, which explains why a limit check that looks fine in one unit fails in another.
It depends on the system. Users usually think in graphemes, JavaScript string.length uses UTF-16 units, and many databases and protocols count bytes or code points. Check the documentation of the system that enforces the limit.
It is a single code point above U+FFFF, so UTF-16 stores it as a surrogate pair of two code units.
UTF-8 uses one byte for ASCII and two to four bytes for other code points.
No BOM is added. A BOM character inside your text would count like any other code point.
No. Measuring happens in the page and the text stays on your device.