DEV Community

Dev Nestio
Dev Nestio

Posted on

Flesch Reading Ease Score Calculator in the Browser

I built a browser-only text statistics tool that includes a Flesch Reading Ease calculator.

Try it: https://devnestio.pages.dev/text-stats/

Flesch Reading Ease formula

Score = 206.835 - 1.015 * (words/sentences) - 84.6 * (syllables/words)
Enter fullscreen mode Exit fullscreen mode

Score ranges: 90+ Very Easy, 60-70 Standard, below 30 Very Difficult.

Syllable approximation in JS

function countSyllables(word) {
  word = word.toLowerCase().replace(/[^a-z]/g, "");
  if (!word) return 0;
  if (word.length <= 3) return 1;
  word = word.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/, "");
  const m = word.match(/[aeiouy]{1,2}/g);
  return m ? m.length : 1;
}
Enter fullscreen mode Exit fullscreen mode

More features

  • Word, character, sentence, paragraph counts
  • Unique words and reading time (238 wpm)
  • Top 20 keywords (stop words filtered)
  • Character breakdown: letters, digits, punctuation
  • Live update with 200ms debounce

DevNestio — browser-only developer tools.

Top comments (0)