Skip to Content

How to Set Up a System-Wide Word Count Service on Your Mac

by

In this article, we're going to show you how to create a system-wide service that enables you to get an immediate word count and character count in TextEdit, Safari, Mail, or indeed any app on your Mac that lets you highlight text. It offers a handy home-made solution if you often find yourself pasting into a blank Word or Pages document for no other reason than to find out how many words are in a text selection.

word count automator service 2
The steps below will guide you through the process of creating your own word count service using the macOS Automator app. It's a simple procedure to follow and should only take five minutes, but if you'd rather use a third-party solution, then check out WordCounter, a free Mac menu bar utility from Onekerato.

How to Create a Word Count Service in Automator

  1. Launch Automator from the Applications folder.
    1 Automator

  2. Click New Document.

  3. Choose Service as the type of your document.
    2 Automator document type

  4. Type "run" into the Library search field at the top of the Automator sidebar, then drag the Run Shell Script action into the empty workflow area.
    automator drag shell script

  5. In the Run Shell Script action window, change the Pass Input: option to as arguments using the dropdown menu.
    automator run shell script

  6. Clear the text in the shell script box (highlight the text with your mouse cursor and hit Backspace) then copy and paste the following text into the same area:

    echo Words:

    echo $1 | wc -w

    echo Characters including spaces:

    echo $1 | wc -c
    automator word count script

  7. Clear the Library search field at the top of the Automator sidebar and type "set value", then drag the Set Value of Variable action into the workflow area.
    automator set value of variable

  8. Click the Variable: dropdown menu and select New Variable....

  9. In the blue dialog that appears, click inside the Name: input field. It may default to "storage", but you can rename it – we'll call it "count". Click Done, and you should now see "count" (or whichever name you used) appear in the variable list below the workflow area.
    automator variable name

  10. Clear the Library search field at the top of the Automator sidebar again, and this time type "ask", then drag the Ask for Confirmation action into the workflow area.
    drag ask for confirm

  11. Now, drag your "count" variable from the variable list up to the "Message" title in the Ask for Confirmation action.
    drag count variable

  12. In the Automator menu bar, select File -> Save..., call your new service "Word Count", and click Save.

Next time you want to get a word count and/or character count for some text you've highlighted, simply right-click (or Ctrl-click) on the text and select Services -> Word Count from the contextual dropdown menu.

word count
You can assign a key shortcut to it for even faster access. To do so, launch System Preferences, select the Keyboard pane, and click the Shortcuts tab. Select Services from the sidebar and you should find Word Count near the bottom of the list. Just click it, select Add Shortcut, and finally, enter your custom key combination.

word count shortcut

Top Rated Comments

111 months ago
Srsly guys... I don't think I'll need this. But you rock! Keep these guides and tutorials coming!!! They are MUCH appreciated!
Score: 11 Votes (Like | Disagree)
111 months ago
Srsly guys... I don't think I'll need this. But you rock! Keep these guides and tutorials coming!!! They are MUCH appreciated!
Was gonna say exactly this till I saw your post. Reminds me of MacOXSHints.
[doublepost=1526030048][/doublepost]
Or get WordService for free from the App Store to give you text stats and so much more:
https://itunes.apple.com/app/wordservice/id899972312?mt=12
Maybe but this also teaches you stuff.
Score: 6 Votes (Like | Disagree)
fairuz Avatar
111 months ago
Automator is one of the many amazing productivity features in macOS that few know about. It's saved me so much time.
Score: 2 Votes (Like | Disagree)
IJ Reilly Avatar
111 months ago
Or get WordService for free from the App Store to give you text stats and so much more:
https://itunes.apple.com/app/wordservice/id899972312?mt=12
Beat me to it. I've used this indispensable collection of services for over 15 years. Can also be downloaded here:

https://www.macupdate.com/app/mac/10523/wordservice
[doublepost=1526061714][/doublepost]
Maybe but this also teaches you stuff.
I learned that I don't have to do it myself. ;)
Score: 2 Votes (Like | Disagree)
100 months ago
Has anyone actually checked how exact this is? I'm testing it now and the "characters including spaces" count seems to always be one more than it should be, regardless of the text or the program that I'm using the action in (e.g. safari, textedit, etc). Can anyone confirm if it's working 100% properly or not on their mac?

I know it's not a 'huge deal', and I can just manually deduct 1 myself, but it'd be interesting to know if anyone else is experiencing this and if so, if there's a way to get it exact. The exact character count is what I'm using this function for, because I use sites which limit titles & descriptions to exact character counts; and some sites, for some reason, don't actually tell you how many characters you've entered, just that you've "exceeded the maximum number of characters".

Thanks
Score: 1 Votes (Like | Disagree)
ArtOfWarfare Avatar
111 months ago
There are definitely existing Sublime plugins for word count. I'm using this one ('https://github.com/titoBouzout/WordCount')and it's great.

Of course. There's plenty of plugins for Sublime for anything lots of people need to do.

I was saying that, more generally, I write plugins for Sublime when I regularly need to do something with text in some specific way. As opposed to writing a MacOS service, where it'll only work on Macs.
Score: 1 Votes (Like | Disagree)

Popular Stories

MacBook Neo 2 on Yellow Feature

Apple Reportedly Plans to Release These Products in February or March

Sunday November 22, 2026 7:32 am PST by
Apple plans to unveil an iPhone 18e, iPhone 18, updated entry-level iPad, and new MacBook Neo and MacBook Air models around February or March next year, according to the latest word from Bloomberg's Mark Gurman. In his Power On newsletter today, Gurman said Apple has some additional products planned for the first half of 2027, including the iPhone Air 2 and new iPad Air and iPad Pro models,...
apple design award 2025

Apple Announces 2025 Design Award Winners Ahead of WWDC 2025

Tuesday June 3, 2025 10:14 am PDT by
As we wait for WWDC to kick off next Monday, Apple today announced the winners of its annual Apple Design Awards, recognizing apps and games for their innovation, ingenuity, and technical achievement. The 2025 Apple Design Award winners are listed below, with one app and one game selected per category: Delight and Fun - CapWords (App) and Balatro (Game) Innovation - Play (App) and PBJ -...
Black Friday Deals 26 4

Apple Black Friday Deals Available Now: AirPods, Apple Watches, MacBooks, and More

Saturday November 21, 2026 9:17 am PST by
Black Friday is getting closer and closer, taking place on Friday, November 27 in 2026. As always, this will be the best time of the year to shop for great deals, including popular Apple products like AirPods, iPad, Apple Watch, and more. Note: MacRumors is an affiliate partner with some of these vendors. When you click a link and make a purchase, we may receive a small payment, which helps us ...
Latest Stories
iPhone Sales Ban in India Sought by Startup Over NameDrop Feature
iPhone Sales Ban in India Sought by Startup Over NameDrop Feature
1 minute ago
MacBook Neo Could Get New Colors and Upgrades Every Year
MacBook Neo Could Get New Colors and Upgrades Every Year
44 minutes ago
AirPods Pro 3 Drop to $169.99 in Amazon Black Friday Sale
AirPods Pro 3 Drop to $169.99 in Amazon Black Friday Sale
15 hours ago
iPhone Duo Could Get More Lock Screen Widgets, Leak Suggests
iPhone Duo Could Get More Lock Screen Widgets, Leak Suggests
15 hours ago
Gurman: Siri Layoffs Spared Newer AI Systems, But Problems Persist
Gurman: Siri Layoffs Spared Newer AI Systems, But Problems Persist
15 hours ago
M6 MacBook Pro Drops to $1,799 in New Black Friday Sale ($200 Off)
M6 MacBook Pro Drops to $1,799 in New Black Friday Sale ($200 Off)
20 hours ago
Apple Reportedly Plans to Release These Products in February or March
Apple Reportedly Plans to Release These Products in February or March
20 hours ago
Apple Watch SE 3 Lineup Sees Record Low Prices Starting at Just $179
Apple Watch SE 3 Lineup Sees Record Low Prices Starting at Just $179
20 hours ago
Apple Black Friday Deals Available Now: AirPods, Apple Watches, MacBooks, and More
Apple Black Friday Deals Available Now: AirPods, Apple Watches, MacBooks, and More
20 hours ago
Apple Store in UK Permanently Closing Today
Apple Store in UK Permanently Closing Today
2 days ago
Siri AI Settlement: Here's How Much Apple Will Pay You
Siri AI Settlement: Here's How Much Apple Will Pay You
2 days ago
RIP, Apple Support Community
RIP, Apple Support Community
2 days ago
Top Stories: iPhone Duo Face Unlock, HomeView Tidbits, and More
Top Stories: iPhone Duo Face Unlock, HomeView Tidbits, and More
2 days ago
Amazon Takes $120 Off 46mm GPS Apple Watch Series 12 With New Record Low Price [Update: Gone]
Amazon Takes $120 Off 46mm GPS Apple Watch Series 12 With New Record Low Price [Update: Gone]
2 days ago
Siri Recap Hands-On: Private, But Not Very Useful
Siri Recap Hands-On: Private, But Not Very Useful
3 days ago
Save on Headphones This Black Friday With Major Deals on Beats, Sony, Soundcore, and More
Save on Headphones This Black Friday With Major Deals on Beats, Sony, Soundcore, and More
3 days ago
MacRumors Giveaway: Win a 512GB OLED iPad Mini and a Year of Astropad Workbench
MacRumors Giveaway: Win a 512GB OLED iPad Mini and a Year of Astropad Workbench
3 days ago
The MacRumors Show: What's Next for iPhone Duo?
The MacRumors Show: What's Next for iPhone Duo?
3 days ago
Anker's Black Friday Steals: The Lowest Prices Yet on MagSafe Favorites
Anker's Black Friday Steals: The Lowest Prices Yet on MagSafe Favorites
3 days ago
Microsoft to Retire 'To Do' Apps Next Year
Microsoft to Retire 'To Do' Apps Next Year
3 days ago
First Look at iPhone Air 2 and iPhone 18 Revealed By Dummy Models
First Look at iPhone Air 2 and iPhone 18 Revealed By Dummy Models
3 days ago
WhatsApp Raises Group Chat Limit to 1,500 Members
WhatsApp Raises Group Chat Limit to 1,500 Members
3 days ago
MacBook Pro Black Friday Deals Are Here: Get Up to $250 Off M6 and PROLED XDR
MacBook Pro Black Friday Deals Are Here: Get Up to $250 Off M6 and PROLED XDR
4 days ago
Apple is Building an AI Agent That Can Use Apps and Code
Apple is Building an AI Agent That Can Use Apps and Code
4 days ago
Black Friday Deal: Apple TV Streaming Service for $6.99/Month
Black Friday Deal: Apple TV Streaming Service for $6.99/Month
4 days ago
AirPods Black Friday Deals Hit Pro 3 at $179 and Max 2 at $429
AirPods Black Friday Deals Hit Pro 3 at $179 and Max 2 at $429
4 days ago
Second iOS 27.3 and macOS Golden Gate 27.3 Public Betas Now Available
Second iOS 27.3 and macOS Golden Gate 27.3 Public Betas Now Available
4 days ago
Google's Gemini Can Now Control Apps on Your Mac
Google's Gemini Can Now Control Apps on Your Mac
4 days ago
iPhone Duo vs. Samsung Galaxy Z Fold8: Which is Better?
iPhone Duo vs. Samsung Galaxy Z Fold8: Which is Better?
4 days ago
Apple Executive in Charge of iPhone's Camera App Reportedly Retires
Apple Executive in Charge of iPhone's Camera App Reportedly Retires
4 days ago