Hongmu Notes

📊 Text length and line count statistics

Paste text and instantly get the character length and line count.

Text length and line count statistics

Instructions for use

  • Paste or enter text, the length and number of lines will be updated instantly, no need to click a button
  • Length is counted in UTF-16 units; last line wrap counts as a blank line
  • The results are read-only to avoid accidentally changing statistical values.

What can this tool do?

  • Enter or paste text and get the character length and line number in real time
  • Length is counted in UTF-16 units, consistent with browser string.length
  • The number of lines is divided into statistics based on newlines, and a newline at the end is counted as a blank line.
  • Completely done locally in the browser, the text is not uploaded

Actual measurement effect

inputlengthNumber of lines
abc31
a
b
32
a
b
43
three Chinese characters51

It can be seen that the newline character itself is also included in the length, and the number of lines is determined by whether the newline at the end is a blank line.

Usage tips

  • When you need to count multiple paragraphs of text, you can get the results at once by pasting the entire paragraph.
  • When the platform has a word limit, please use this page to confirm the length before submitting.
  • Results can be copied to a table and archived together with the source for review

All keywords and tutorials 12

❓ FAQ

How is the length calculated?
Calculated according to JavaScript string length (UTF-16 unit): common Chinese characters, letters and numbers are counted as 1, and supplementary flat characters such as expressions are counted as 2; the result is consistent with string.length in the browser console.
How is the number of rows calculated?
Follow the rules of the original implementation: split the text according to newlines for statistics, and the newline at the end is counted as a blank line; for example, "a↵b" is 2 lines, "a↵b↵" is 3 lines, and empty text is counted as 1 line.
Will statistics be updated in real time with input?
Yes. When you paste or modify content in the input box, the length and number of lines are updated immediately without clicking a button; you can also use the clear button to reset it with one click.
Will the text be uploaded?
No. Statistics are completed locally in the browser, the text does not go through the server, and is cleared when the page is refreshed.