Count more than JavaScript string length
Unicode text can contain combining marks, joiners and multi-code-unit characters. A useful Sinhala text counter should therefore show several measurements rather than one unexplained number.
LankaTextTools reports total JavaScript characters, Unicode code points, Sinhala-range code points, whitespace-separated words and lines. These counts answer different questions and should not be treated as identical measures of visible letters.
Why code points and visible characters can differ
A visually combined Sinhala sequence can contain more than one Unicode code point. Zero-width characters also occupy code points without drawing a visible glyph. That is why a text-length limit in software may not match the number of shapes a person sees.
Use the counter with the Unicode cleaner
If the count is unexpectedly high, inspect the text with the Unicode cleaner. Hidden joiners, non-breaking spaces and copied formatting characters can affect technical character counts.
Code units, code points and grapheme clusters
JavaScript string length counts UTF-16 code units. Unicode code-point count treats each Unicode scalar value as one item. A user-perceived character, or grapheme cluster, can still contain several code points joined into one visual unit. Those measurements answer different technical questions.
The LankaTextTools counter exposes code units and code points separately so a developer can see why a platform limit may differ from what a reader perceives as the number of letters.
What the Sinhala code-point count measures
The Sinhala count reports code points that fall inside the Sinhala Unicode block. It can include independent vowels, consonants, signs and other characters from that block. It is not a linguistic word count and it is not guaranteed to equal the number of visible glyphs.
Useful checks for publishing and form limits
Word and line counts help with article drafts, captions and text-area planning. Code-point and code-unit counts are useful when a database, API or platform enforces a technical length limit. Joiner count helps identify text that contains ZWJ or ZWNJ characters that may not be visible.
When a limit matters operationally, use the same counting rule as the destination platform. A browser tool can explain the text, but another system may define “character” differently.
Diagnose unexpected counts before deleting characters
An unexpectedly high count can come from repeated spaces, line breaks, combining signs or invisible formatting. Inspect the source and use the Unicode cleaner when appropriate. Do not delete Sinhala combining marks merely to reduce a number because they can be part of valid script sequences.
Standards and references
For deeper technical context, these external references explain the Unicode standard or the legacy-conversion background used by this workflow.
- Unicode Sinhala blockOfficial Sinhala character block.
- Unicode text segmentationUnicode guidance on grapheme clusters and text boundaries.
Frequently asked questions
Does one Sinhala letter always equal one Unicode code point?
No. Some visible sequences can contain multiple code points, including vowel signs, virama and joiner characters.
What does the Sinhala code-point count include?
It counts code points in the Sinhala Unicode block. It is a technical measure, not a perfect count of user-perceived grapheme clusters.
Is the text uploaded for counting?
No. The counter runs in the browser.