That is, it shows, while you type, the count of unique words. Not a count of all words.

If the document had the words:

The cat is in the hat which is in Toledo.

It would show a count of 7.

I know I could write a short shell script to do this but I'm looking for real-time display. If you know of an editor that allows writing such a real-time plugin that would be helpful as well.

  • In case you're going for a shell script approach, you could use TextMate's "Filter through command…" menu item, using tr -d "[:punct:]" | tr -d "[:digit:]" | tr " " "\n" | tr "[:upper:]" "[:lower:]" | sort | uniq -u | wc -l as a command and showing the result as a tooltip. This should give the desired result as a tooltip repeatedly by simply pressing the menu item shortcut and then enter. – Asmus Jan 27 '15 at 18:19

Emacs can do it (as most things). Have a look at this page. The part: "How many times was each word used?" - is quite similar to your problem. WordCountMode shows how to put the info in the modeline. Shouldn't be too hard to get in a form you need.


Here is an online analyzer. Does it all in an instant! http://textalyser.net/

Dont forget to adjust the stoplist to "none" if you want to count every single word.


I can think of several possible solutions at all price points to help you tally up your words.


  • Text Wrangler, by Barebones Software, is a free text editor that should be able to do what you ask and much more.
  • Word Counter isn't a text editor, but it can count your words, report word frequency, and provide readability statistics.

Low cost

  • iA Writer, available on the App Store, shows running word and character counts and is unique in that it estimates how long it takes someone to read your work.
  • Byword, also available on the App Store, is my personal favorite for writing in Markdown.

These two low-cost apps don't report unique words; however, they work great with Marked, which can help you visualize word repetition.

Premium Software

  • BBEdit, also by Barebones Software, is among the first text editors for Mac OS and highly regarded with deep support for AppleScript.
  • TextMate, by Macromates, is another text editor that can do much more than provide word counts
  • DEVONthink Pro can do exactly what you want. Well, a unique word count is readily available and the app has a bonus; the capability of finding semantic connections among your documents using a pretty terrific artificial intelligence. DEVONnote may also have this capability, but it's been years since I've used it.

Sorry I didn't link to all of my suggestions, but I don't have the clout here at StackExchange to post all of them. I left links to what I believe are the two best answers to help you.

  • (The OP had a very specific request of count of unique words (So "The the cat the the" = 2). Not available in any of the usual editors AFAIK...) – beroe Aug 29 '13 at 23:00

With BBEdit (not free) this can be accomplished with these steps:

  1. Break up all words into individual lines by using several search and replace to turn any non-word character into a line break. To do that, use the Find command, turn on "Grep" checkbox, enter [^a-z]+ (this finds everything that's not a letter) into the Find box and \r (that's a line break) into the Replace box, then click "Replace All".
  2. Remove all empty lines by using the "Process Lines Containing..." command from the "Text" menu: Enter ^$ into the text field and check only the "Use grep" and the "Delete matched lines" options. Click "Process".
  3. Remove all duplicates by using the "Process Duplicate Lines..." command from the "Text" menu: Click "Leaving one" and check only the "Delete duplicate lines" option. Click "Process".

What's left in the text is one unique word per line. So, check how many lines the text now contains to know the number of unique words in your text.

  • That sure doesn't seem very close to "live display of unique word count" as requested by the OP. – Tom Gewecke Jan 27 '15 at 18:07
  • Right, it's far from being live. I had actually missed that part of the question. Yet, since I came here because of a similar question and saw that BBedit was mentioned as a possible solution, I thought of adding my hint nontheless. @TomGewecke would you know a better fitting question I could attach this answer to? – Thomas Tempelmann Jan 27 '15 at 19:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .