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
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
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 like this
Build a BMI and Daily Calorie Calculator with Metric and Imperial Units in HTML
A prompt that makes an AI build Steady Scale, a single-file BMI and calorie calculator using Mifflin-St Jeor, activity levels, unit switching and plain-language ranges.
Build a Countdown Timer to Any Date With a Confetti Finish in One HTML File
Get a polished single-file countdown page with a custom event title, a large days-hours-minutes-seconds display and a confetti-and-chime celebration at zero.
Build a HIIT and Tabata Interval Workout Timer in a Single HTML File
A self-contained interval timer with adjustable work, rest and rounds, color-coded phases, synthesized countdown beeps and a tap-anywhere pause, all in one HTML file.
Build a Keyboard-Friendly To-Do Checklist with Priorities and Filters in One HTML File
A ready-to-paste prompt that makes an AI build a single-file to-do checklist where you can add, reorder, prioritize, filter and export tasks as plain text, all with keyboard shortcuts.
Build a Loan and Mortgage Calculator with Amortization Table in One HTML File
Get a polished, offline loan and mortgage calculator that shows monthly payment, total interest, an SVG balance chart, extra-payment savings and a full amortization schedule.
Build a Percentage Calculator for Discounts, Increases and Percent Change
A single HTML file that answers the four common percentage questions side by side, with live results and the worked formula shown under each answer.