πŸ› οΈToolsShed

Word & Character Counter

Count words, characters, sentences, and paragraphs in your text.

0
Words
0
Characters
0
Chars (no spaces)
0
Sentences
0
Paragraphs
1
Lines
~1 min
Reading time

Word Counter analyzes your text and instantly reports the number of words, characters (with and without spaces), sentences, and paragraphs. It is an essential writing aid for anyone working within specific length constraints β€” whether you are drafting a tweet, filling out a college application essay, meeting a journal submission word limit, or writing ad copy with character restrictions.

Paste or type your text into the input area and the counts update in real time as you write. The tool also estimates reading time based on an average adult reading speed of 200-250 words per minute, which is useful for blog posts, presentations, and speeches where you need to predict how long your content will take to consume.

Word and character counts differ slightly depending on how you count β€” does a hyphenated word count as one or two? Does a URL count as one word? This tool follows the most common convention used by word processors: consecutive non-whitespace characters form a word, and whitespace separates words. If you need a specific counting method, always verify the rules of your target platform.

Frequently Asked Questions

Code Implementation

def count_text(text: str) -> dict:
    words = text.split()
    chars_with_spaces = len(text)
    chars_no_spaces = len(text.replace(" ", "").replace("\n", "").replace("\t", ""))
    sentences = len([s for s in text.replace("!", ".").replace("?", ".").split(".") if s.strip()])
    paragraphs = len([p for p in text.split("\n\n") if p.strip()])
    reading_time_min = round(len(words) / 225, 1)  # ~225 wpm average

    return {
        "words": len(words),
        "chars_with_spaces": chars_with_spaces,
        "chars_no_spaces": chars_no_spaces,
        "sentences": sentences,
        "paragraphs": paragraphs,
        "reading_time_min": reading_time_min,
    }


text = """Hello world. This is a sample paragraph.

This is the second paragraph with more words and sentences!"""

stats = count_text(text)
for key, value in stats.items():
    print(f"{key}: {value}")

Comments & Feedback

Comments are powered by Giscus. Sign in with GitHub to leave a comment.