Sentence Lengths is a small browser-based tool that colour-codes sentences by length, so you can see the pattern of long and short at a glance. You can find it here: Sentence Lengths.
I built it as a demonstration of Concise — the C in SCAMP, my plain English editing framework. Or rather I should say I rebuilt it, because a version of the tool has existed for over a decade as a word macro.
I couldn’t have built it without AI assistance
I used both Claude and ChatGPT to write the code. My JavaScript skills are rudimentary at best, and this tool required quite a lot of it — sentence splitting, colour assignment, image export, and a canvas-stitching fix for long documents that the first approach couldn’t handle.
But the decisions were all mine. Some were made up front, others (many others) in response to stuff not doing what I wanted it to.
It didn’t work perfectly the first time – or the fifth time
Here are a few specific things that went wrong and had to be fixed:
Long documents were being cropped when exported as images, because browsers have a maximum canvas height. The fix was to render the image in slices and stitch them together.
Hyphenated words that straddle two lines messed up the highlighting, because line-wrapping works differently for the phrase “my great-grandfather” (i.e. my dad’s dad’s dad) than it does for the phrase “my great grandfather” (i.e. my dad’s dad, who was an excellent person). Something which the bots and I solved by telling the tool that a hyphen is basically a space, for highlighting purposes.

Titles and abbreviations kept triggering false sentence breaks — the tool saw a full stop after “Mr.” or “Dr.” and assumed the sentence had ended. Mr. Smith became two sentences: “Mr.” and “Smith said he’d be late.” Mostly solved with an exceptions list: a set of words the tool knows are allowed to have a full stop without ending a sentence.
Punctuation in ordered lists is still a problem, but it’s one to tackle some other time.
If you’re the sort of person who fully understood those three examples, you would probably have predicted those problems in advance. But as I said, JavaScript is not my area of expertise, so I only discovered them when I tested real writing.
Mind you, I do feel like I know a lot more JavaScript than I did two weeks ago. There’s only so much trust I’m willing to put in the bots, so I’ve been getting them to explain the changes we make as we go along. I’m not putting JavaScript on the list of skills on my CV just yet, but I do feel like I’ve got a good grasp of the tool that I’ve designed.
When 2+2=5 (Orwell made me do it)
I ran the full text of “Politics and the English Language” through Sentence Lengths. Orwell spends 5,261 words arguing for precision in language – and after running his essay through my tool I had to redefine what a sentence is. I choose to believe he would have considered this a reasonable amendment rather than a thought crime.
The tool originally counted 4 things as end-of-sentence markers. Full stops, exclamation marks, question marks, and line breaks. And then Orwell presents me with a sentence like this:
If one gets rid of these habits one can think more clearly, and to think clearly is a necessary first step toward political regeneration: so that the fight against bad English is not frivolous and is not the exclusive concern of professional writers.
Which is 43 words long. Or this one:
As soon as certain topics are raised, the concrete melts into the abstract and no one seems able to think of turns of speech that are not hackneyed: prose consists less and less of words chosen for the sake of their meaning, and more and more of phrases tacked together like the sections of a prefabricated hen-house.
That’s 57 words from start to finish – something which my tool gives the blackout treatment.

But neither of those sentences are particularly difficult to read, because the colon between the two clauses is doing the work of a full stop.
So I had another decision to make. Do I tell the tool to treat a colon as an end-of-sentence marker or not?
Correct use of the colon is a dying art: most colons you encounter these days are introducing a bulleted list, not separating two independent clauses. But the people who still use them correctly shouldn’t be penalised for it. A colon between two clauses does the same job as a full stop. So that’s how the tool treats it.

The regex for that is `:(?=\s)`, if that sort of thing floats your boat.
What the tool can’t tell you
First up, it’s an English language tool. I have no idea how useful it is for other languages.
More importantly, while the tool can show you that a sentence is more than 29 words long, it can’t tell you whether that’s a bad thing. Orwell’s essay contains an 81-word sentence.
The colours are diagnostic. You still have to bring the judgment.
What’s next?
I’m still working on Sentence Lengths and keen to hear feedback. If you use it and something breaks, or doesn’t work the way you’d expect, I want to know. Message me on LinkedIn or email hello@whatshesaid.digital.
Once it’s finished, I’ll be testing Simple Words — a companion tool that flags long and uncommon words. Both tools are part of SCAMP, the plain English editing framework.
