What this tool does
Count the characters, words, lines and bytes in any text. You fill in these fields: Text. It shows characters, characters without spaces, words, lines, letters, digits, and size in UTF-8 bytes.
Inputs
- Text: Longer text, up to 100000 characters.
How to use
- Type the text.
- Read the result: characters, characters without spaces, words, lines, letters, digits, and size in UTF-8 bytes. It appears once every required field has a valid value.
Worked examples
Example 1. Inputs:
- Text: "Hello, world!"
Results:
- Characters: 13
- Characters without spaces: 12
- Words: 2
- Lines: 1
- Letters: 10
- Digits: 0
- Size in UTF-8 bytes: 13
How this is worked out: Counted by hand. H-e-l-l-o is 5, the comma is 1, one space is 1, w-o-r-l-d is 5, the exclamation mark is 1: 5 + 1 + 1 + 5 + 1 = 13 characters. Without the one space: 12. Words: Hello and world = 2. One line. Letters: 5 + 5 = 10. No digits. Every character is ASCII, so 13 bytes.
Example 2. Inputs:
- Text: "Café au lait line two"
Results:
- Characters: 22
- Characters without spaces: 17
- Words: 5
- Lines: 2
- Letters: 17
- Digits: 0
- Size in UTF-8 bytes: 23
How this is worked out: Counted by hand. The text is Café, two spaces, au lait, a line break, then line two. Café = 4, two spaces = 2, au = 2, one space = 1, lait = 4 (13 so far), the line break = 1 (14), line = 4, one space = 1, two = 3 (22 characters). Whitespace: 2 + 1 + 1 line break + 1 = 5, so 22 - 5 = 17 without. Words: Café, au, lait, line, two = 5. Two lines. Letters: 4 + 2 + 4 + 4 + 3 = 17. The e with an acute accent takes 2 UTF-8 bytes and the other 21 characters take 1 each: 23 bytes. Longest word has 4 characters.
Example 3. Inputs:
- Text: "Hi 👍🏽"
Results:
- Characters: 4
- Characters without spaces: 3
- Words: 1
- Lines: 1
- Letters: 2
- Digits: 0
- Size in UTF-8 bytes: 11
How this is worked out: Characters are counted as you see them: H, i, a space and one thumbs up (the skin tone is part of the same emoji) = 4, or 3 without the space. The emoji has no letter or digit, so it is not a word: 1 word, Hi, 2 letters, average length 2.
Example 4. Inputs:
- Text: ""
Results:
- Characters: 6
- Characters without spaces: 0
- Words: 0
- Lines: 2
- Letters: 0
- Digits: 0
- Size in UTF-8 bytes: 6
How this is worked out: Edge: the text is three spaces, a line break and two spaces (3 + 1 + 2 = 6 characters, 0 without spaces, on 2 lines). There is no word, so 0 words, no sentence and no paragraph, and the average word length is shown as 0 when there are no words.
Where this comes from
Count the characters, words and lines of a text. Characters are counted as a reader sees them. A word is a run of text between spaces or line breaks that has at least one letter or digit. Every line break starts a new line, and a blank line separates paragraphs. Source: Unicode Standard Annex 29, Unicode Text Segmentation (user-perceived characters and word boundaries), and the UTF-8 encoding (RFC 3629) for the size in bytes.
Limitations
- A word is a run of text between spaces, tabs or line breaks that has at least one letter or digit. So well-known, don't and 3.5 are one word each, and a dash on its own is not a word. For Chinese, Japanese, Thai and similar scripts the count depends on how your browser splits words.
- Characters are counted as a reader sees them, so an emoji or an accented letter is one character. Sites that count a different way, such as some message and post length limits, can give another total for the same text.
- Letters are letters of any alphabet and digits are decimal digits of any script. Punctuation, symbols and emoji are neither.
- Size is the UTF-8 size of the text. Other encodings such as UTF-16 give different byte counts.
- Sentence counting is a rule of thumb and can miscount initials and unusual abbreviations.
- Words joined by a dash or slash with no spaces around it count as one word.
- Paragraphs need a blank line between them. Text with a single line break between paragraphs counts as one paragraph.
- Text longer than 100,000 characters is not accepted.
FAQs
- Q: Does a line break count as a character?
- A: Yes. Each line break is one character in the total. It is left out of the count without spaces, which skips every space, tab and line break.
- Q: Why are bytes more than characters for some text?
- A: Size is measured in UTF-8. Plain English letters and digits take one byte each, while most accented letters take two or three and an emoji takes four or more, so text with them is larger in bytes than in characters.
- Q: Is an emoji one character or several?
- A: One. The count follows what a reader sees as a single character, so an emoji with a skin-tone modifier counts once.
- Q: How are lines counted?
- A: Every line break starts a new line, and a blank line counts as a line. A single line break at the very end of the text does not add an empty line.
- Q: How are words counted?
- A: A word is a run of characters between spaces or line breaks that contains at least one letter or digit. So "don't" and "well-known" are one word each, and a lone dash is none.
- Q: How are sentences counted?
- A: A sentence ends at a full stop, question mark, exclamation mark or ellipsis followed by a space or the end of the line, and each line break also ends one. Common titles such as Mr and Dr do not end a sentence, and neither does a single full stop followed by a word in lower case. Decimal points like 3.50 do not either.
- Q: How is average word length worked out?
- A: The characters in all the words, without punctuation at the start or end of each word, divided by the number of words. An apostrophe or hyphen inside a word counts as a character.
- Q: What counts as a paragraph?
- A: A block of lines separated from the next block by at least one blank line.
Explore Similar Tools
Explore more tools like this one:
- Word Counter - Advanced text analysis with word, character, and...
- AI Token Counter - Count the exact number of tokens in your text for GPT-4,...
- Day Counter - Count the total number of days between two dates, with...
- Money Counter - Count bills and coins by denomination to get a total...
- BPM Counter - Tap to the beat to instantly measure Beats Per Minute...