How Words Are Counted in Every Language
Words are split with the browser's built-in Intl.Segmenter, which understands languages written without spaces such as Japanese, Chinese, and Thai, as well as Korean and alphabet-based languages.
Characters are counted as visible symbols, so an emoji or an accented letter counts once even when it is stored as several code units.