Weighted Character Counter

Measure text using this counter's original rule: each UTF-16 unit from U+0000 to U+00FF adds 1, and every other unit adds 2. The six statistics update as you type. The weighted total is not a word count or a file size.

Runs locally in your browser

Check a weighted total

Paste or type plain text to update all six values automatically. Counting runs in browser JavaScript without sending the text in counting requests. Clear resets both the input and every statistic.

  1. Enter A你😀1. The weighted total is 8: A and 1 add 1 each, 你 adds 2, and the two UTF-16 units of 😀 add 4 together.
  2. The six rows for that sample are 1, 2, 3, 2, 1 and 8, in display order. The row for all units above U+00FF already includes the Han row and the other-units row.
  3. Edit or delete text to see the values change. Clear returns all six rows to 0, including the weighted total.

Exact counting boundaries

What the six rows mean

The Han row counts occurrences in U+4E00-U+9FA5 only, including repeats. It is not a complete Unicode Han inventory. Other units above U+00FF exclude that range; all units above U+00FF combine both groups.

The U+0000-U+00FF row includes Latin-1 letters, ASCII punctuation, spaces and controls in that range. ASCII digits counts only 0-9 and is already part of this row. Weighted total = units U+0000-U+00FF + 2 × units above U+00FF. Do not add the overlapping subtotals again.

Emoji and accents can change the apparent length

😀 occupies two UTF-16 units here and has weight 4. The combined family emoji 👨‍👩‍👧‍👦 occupies 11 units and has weight 22. This counter does not segment visible characters or words.

No Unicode normalization is applied: é has weight 1, while e followed by U+0301 has weight 3. U+9FA6, for example, falls in the other-units group. The rules deliberately retain the old counter's results.

Questions about weighted text length

Are spaces and line breaks included?

Yes. A space, tab or LF adds 1. The browser textarea normalizes actual CR and CRLF line endings to LF, so a pasted Windows newline contributes 1 here. The core counts raw CRLF as two units when used directly.

Can I use the total for a word limit or UTF-8 byte limit?

No. hello world has weight 11, not 2. The character é has weight 1 here but takes two bytes in UTF-8. The result only represents the displayed weighting rule.

Does the counter read HTML or count distinct Han characters?

It counts the entered text literally: <b>A</b> has weight 8, and &amp; has weight 5. It neither renders markup nor decodes references. Repeated Han characters are counted each time; 你你 has Han count 2.

Recent tools: