Xerobit

Sentence Counter: Count Sentences in Your Text

The sentence counter splits your text at every period, question mark or exclamation mark that really ends a sentence, so "Mr. Smith paid 3.50 dollars. Then he left." counts as 2, not 4. It also reports words, characters and average words per sentence. The text is processed in your browser and is never uploaded.

Result

  • Sentences
    0
  • Words
    0
  • Characters
    0
  • Characters (no spaces)
    0
  • Avg words/sentence
    0

How to use the sentence counter

  1. Paste or type your text into the box. The counts update as you edit.
  2. Read the Sentences row first, then Words and the two character counts.
  3. Check Avg words/sentence against your target length (the table below gives rough bands).
  4. If a count looks off, look for an abbreviation or initial the tool skips or a quote it splits (see the edge cases section).

The counting rule

The sentence counter walks through the text and looks for ., ? and !. A run of marks such as ..., ?! or !!! is one boundary. A question mark or exclamation mark always ends a sentence. A period ends one only when it passes three checks:

  1. It is followed by whitespace, a closing quote or bracket, or the end of the text. A period glued to the next character, as in 3.14, 2.0 or example.com, is ignored.
  2. The word before it is not a known abbreviation such as Mr, Mrs, Dr, Prof, St, vs, etc, Inc or a month name.
  3. The word before it is not a single-letter abbreviation. A single letter (e.g., i.e., an initial) is skipped only when the next word starts with a lowercase letter or a digit, or is another initial such as the K. in J. K. Rowling. Before a capitalised word it is a boundary, so Take vitamin C. Drink water. counts 2 and Option A. Option B. counts 2. The cost is that a lone initial before a capitalised surname, as in J. Smith left., counts as 2.

Text after the last mark counts as a final sentence when it holds a letter or digit, so Hello. How are you is 2 and What?!! Yes is 2. Marks with no letter or digit before them, such as a lone . or ..., end nothing and give 0 sentences. If the text has words but no mark at all, it counts as one sentence. Empty or whitespace-only input gives 0 for every row.

Worked examples with real output

InputSentencesWordsAvg words/sentence
Hello world. How are you? Fine!362
Mr. Smith went to Washington. Dr. Jones stayed home.294.5
Pi is 3.14 today.144
Visit example.com now. Thanks.242
He walked in. She sat down.263
Wait... really?! Yes.331

For the Mr. and Dr. line, the characters row shows 52 with spaces and 44 without. Words are whatever sits between whitespace, so Washington. is one word and the dots stay attached.

Edge cases and rounding

  • Words that double as abbreviations. in, no, sat, sun, mar and similar words only count as abbreviations when a digit or lowercase letter follows. He walked in. She sat down. is 2 sentences, while See Fig. 3 for details. keeps Fig. inside one sentence.
  • Quotes. "Stop!" he said. Go on. counts 3, because the exclamation mark inside the quote ends a sentence by this rule even though many style guides would call the quote plus tag one sentence.
  • Abbreviations at a real sentence end. We sold it to Acme Inc. Then we left. counts 1, since the period after Inc is treated as an abbreviation.
  • Missing space. It ended.Next began. counts 1 because the period has no whitespace after it.
  • Average. Words divided by sentences, shown with up to 2 decimals, so 5 words over 2 sentences shows 2.5 and 5 over 3 shows 1.67.

Method and standards

This sentence counter is rule-based, not a statistical model. Unicode Standard Annex #29 (Text Segmentation) defines default sentence boundary rules and says that good results need tailoring, such as abbreviation lists, so no short rule set matches it exactly. The abbreviation list here is fixed and English only, so text in other languages, or full of domain jargon with dots, may be over- or under-counted by a few sentences. For legal or publishing limits that depend on an exact count, check the sentences around abbreviations by hand.

Average sentence length bands

Style guides differ, but these bands are a common rule of thumb for general web copy.

Avg words/sentenceTypical reading
Under 10Very easy, short and punchy
10 to 15Easy, conversational
15 to 20Standard for most audiences
20 to 25Dense, formal or academic
Over 25Hard going, consider splitting

An average hides spread: one 60-word sentence among nine short ones still averages low. Pair it with the word counter for totals, the syllable counter for reading difficulty and the line counter for layout.

Worked examples

ExampleInputResult
Short paragraphText: The quick brown fox jumps over the lazy dog. It was a sunny day. Birds were singing!Sentences: 3; Words: 17; Characters: 84; Characters (no spaces): 68; Avg words/sentence: 5.67
Questions and exclamationsText: How are you? I am fine! What about you?Sentences: 3; Words: 9; Characters: 39; Characters (no spaces): 31; Avg words/sentence: 3
Abbreviations like Mr. and Dr.Text: Mr. Smith went to Washington. Dr. Jones stayed home.Sentences: 2; Words: 9; Characters: 52; Characters (no spaces): 44; Avg words/sentence: 4.5

FAQ

What does the tool treat as the end of a sentence?

A question mark, an exclamation mark, or a period that is followed by whitespace, a closing quote or the end of the text and does not follow a known abbreviation or single-letter initial.

Why is 3.14 or example.com not split into two sentences?

A period with a non-space character directly after it is ignored. Only a period followed by whitespace, a closing quote or bracket, or the end of the text can end a sentence.

Which abbreviations are recognised?

Titles (Mr, Mrs, Ms, Dr, Prof, Rev), ranks, street words (St, Ave, Blvd), months and weekdays, Latin forms (etc, vs, cf, e.g., i.e.), company suffixes (Inc, Ltd, Co) and units such as ft and oz. Any single letter followed by a period is also skipped.

Why can a sentence ending in Inc. or etc. be missed?

The tool does not look at whether the next capitalised word starts a new sentence, so the period after a listed abbreviation is not counted. Reword the ending if the exact count matters.

How are ellipses and repeated punctuation counted?

A run such as ..., ?! or !!! is one boundary. "Wait... really?! Yes." is 3 sentences.

What is returned for empty text?

Zero for sentences, words, characters, characters without spaces and average length. Text with words but no punctuation counts as 1 sentence.

How is average words per sentence calculated?

Total words divided by the sentence count, shown with up to 2 decimals. Words are runs of non-whitespace characters, so hyphenated words and numbers count as one word each.