The Korean character counter measures Hangul text two ways at once: by composed syllable blocks and by decomposed jamo. Korean is unusual because each visible character is itself a little stack of letters, so a single count can mean two different things depending on whether you care about characters on screen or the consonants and vowels inside them.
How it works
Modern Hangul syllables occupy the Unicode range U+AC00–U+D7A3, and every block in that range can be split with a fixed formula. For a syllable with code S, subtract 0xAC00 to get an index, then the lead consonant is that index divided by 588, the vowel is the remainder divided by 28, and the tail consonant is the remainder modulo 28. A tail value of zero means the block has no final consonant, so it contains two jamo; any other value means it has a batchim and contains three. Standalone compatibility jamo, the lone ㄱ or ㅏ forms in the U+3131–U+318E range, are counted on their own.
Notes and example
Take 한글. The block 한 decomposes into ㅎ + ㅏ + ㄴ, three jamo because it has a tail, while 글 decomposes into ㄱ + ㅡ + ㄹ, also three jamo. That is two syllable blocks but six jamo. A simpler word like 나 is one block and two jamo because it has no batchim. Latin letters, digits and punctuation are reported separately so they never distort the Hangul figures. Everything is computed locally in your browser.