BroHelp.me

Word Counter

Counting the number of words in the text.




Number of Words - 0

How This Converter Works

Counts the pieces returned by JavaScript's split rule /\s+\b/. This can differ from a normal word count, and empty input returns 1.

Formula or rule

Count = input.split(/\s+\b/).length. An empty string therefore produces a count of 1.

Example

Input
red blue
Calculation
The space before the word boundary splits the string into red and blue.
Result
2
© BroHelp.me 2026 - 2026 is provided without warranty of any kind.