Reading Time Estimator
Estimate how long it takes to read a text.
0
Words
0
Characters
0
Sentences
0
Paragraphs
Reading Time
β
@ 238 WPM
Speaking Time
β
@ 130 WPM
Frequently Asked Questions
Code Implementation
def estimate_reading_time(text: str, wpm: int = 238) -> dict:
"""
Estimate reading time for a given text.
Default WPM is 238 (average adult silent reading speed).
"""
words = text.split()
word_count = len(words)
minutes = word_count / wpm
seconds = round(minutes * 60)
return {
"word_count": word_count,
"char_count": len(text),
"char_no_spaces": len(text.replace(" ", "")),
"minutes": round(minutes, 1),
"seconds": seconds,
"display": format_time(seconds),
}
def format_time(total_seconds: int) -> str:
if total_seconds < 60:
return f"{total_seconds} sec read"
minutes = total_seconds // 60
seconds = total_seconds % 60
if seconds == 0:
return f"{minutes} min read"
return f"{minutes} min {seconds} sec read"
# Example
text = """
Reading time estimators divide word count by average reading speed.
The average adult reads about 200-250 words per minute silently.
Technical content is typically slower at 100-150 WPM.
"""
result = estimate_reading_time(text)
print(f"Words: {result['word_count']}")
print(f"Time: {result['display']}")Comments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.