Build a Live Word and Character Counter with Reading Time in One HTML File

A single-file text counter showing live words, characters, sentences, paragraphs, reading and speaking time, and color-coded progress bars for common post length limits.

You getone complete HTML file in a single code block, then 3 short ideas to extend it.

The prompt

Prompt
You are a front-end developer who builds small, polished writing tools.

Build Tally Desk, a word and character counter for writers, marketers and students, as one self-contained web page. The user types or pastes text into a large text area, and every count updates live on each keystroke.

Rules:
1. Show eight stat tiles: words, characters, characters without spaces, sentences, paragraphs, average words per sentence, reading time at 238 words per minute, and speaking time at 150 words per minute. Format times as seconds under a minute, otherwise minutes and seconds.
2. Add a Length limits panel with progress bars for Headline 70, Meta description 160, Short post 280, Long post 500 and Photo caption 2,200 characters. Show how many characters are left or over. Bars are green, turn amber from 90 percent and red when over.
3. Count words with Unicode letters and numbers so accented words, hyphenated words and contractions count correctly. Paragraphs are blocks separated by blank lines.
4. Include Load sample and Clear buttons, prefill a realistic two-paragraph sample so the page looks alive on load, and add a polite live region announcing the word and character count.
5. Use a warm off-white background, white cards, one deep green accent, a clear type scale and a two-column layout that stacks below 880px. Disable bar animations under prefers-reduced-motion.
6. No external libraries, fonts, network calls or storage.

Output format: one complete HTML file in a single code block, then 3 short ideas to extend it.

Example output

One HTML file. Save it and open it in any browser.Open full screen

Example: Tally Desk, a live word and character counter with reading time.

Type or paste into the large text box and watch eight tiles update instantly: words, characters, sentences, paragraphs, average sentence length, plus reading and speaking time. The Length limits panel shows how close you are to headline, meta description, short post, long post and caption limits, turning amber near the limit and red when over. Try Load sample, then trim it until the Short post bar goes green.

Written by AI from this prompt. Your results will vary.

Tips and common edits

Why this works

  • Fixed rates (238 and 150 wpm) and exact limit numbers remove guesswork, so the counts match expectations on the first try.
  • Asking for Unicode-aware word matching avoids the common bug of counting dashes or emoji as words.
  • A prefilled sample and color thresholds make the tool look finished and testable the moment it opens.

Paste the prompt into ChatGPT, Claude or Gemini. Save the returned code as tally-desk.html and open it in any browser, or view it in the chat's preview or canvas panel.

Common edits

  • Swap the limit list for your own channels, such as SMS 160, email subject 50 or ad headline 30.
  • Change the reading speed to 200 wpm for technical writing or add a keyword density list below the stats.

Prompt details

By
Prompts-GPT editors
Published

Did this prompt work?

Keep exploring

More in Mini Apps & Tools