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

112 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)
112 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
112 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
112 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
112 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

Apple Kukatpally Wallpaper

Apple Just Released Five New Products

Wednesday December 2, 2026 6:12 am PST by
Apple this week released five new (RED) products, which are available online and at Apple Stores in the U.S. and dozens of other countries. The five new products with (RED) editions:AirPods Max 2 ($549) HomePod mini 2 ($149) Apple Watch Series 12 (Titanium) ($699) AirPods Pro 3 with Wrist Strap ($269) AirTag 2 with AirTag FineWoven Key Ring ($59)Apple is now using (RED) branding instead...
macbook proled candy

PROLED MacBook Pro Receives Massive $1,000 Amazon Discount [Update: Gone]

Wednesday December 2, 2026 6:14 am PST by
Apple's MacBook Pro with PROLED XDR is seeing a massive $1,000 discount right now on Amazon, undercutting the Black Friday price by over $700. 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 keep the site running. The model in question is the 16-inch PROLED MacBook Pro with 36GB...
google authenticator

PSA: Don't Update Google Authenticator on iOS 27 Right Now [Update: Fixed]

Monday November 30, 2026 6:06 pm PST by
Google Authenticator users should avoid installing the latest 5.2.2 update because it seems to be crashing on launch. Multiple people on Google's support forums say that Google Authenticator 5.2.2 crashes on iOS 27, iOS 27.2, iOS 27.2.1, and the iOS 27.3 beta. Users are unable to access two-factor authentication codes for logins because the app doesn't launch. Complaints about the update...
Latest Stories
Apple's Former Software Design Chief Alan Dye on Why He Joined Meta
Apple's Former Software Design Chief Alan Dye on Why He Joined Meta
1 hour ago
Meta Considers iPhone Rival and Revives Smartwatch Plans
Meta Considers iPhone Rival and Revives Smartwatch Plans
2 hours ago
iPhone 20 Pro Titanium Rumors Grow as Material Orders Rise
iPhone 20 Pro Titanium Rumors Grow as Material Orders Rise
2 hours ago
Apple Announces 'The Morning Show' Season 5 Release Date
Apple Announces 'The Morning Show' Season 5 Release Date
3 hours ago
Apple Pay Promo Offers $25 Gift Card at Gorjana
Apple Pay Promo Offers $25 Gift Card at Gorjana
3 hours ago
Apple Announces 2026 iPhone App of the Year and More
Apple Announces 2026 iPhone App of the Year and More
4 hours ago
M6 MacBook Pro Cyber Week Deal Takes $250 Off Select Models
M6 MacBook Pro Cyber Week Deal Takes $250 Off Select Models
4 hours ago
Apple Music Launches as a Native App in BMW and Mini Vehicles
Apple Music Launches as a Native App in BMW and Mini Vehicles
5 hours ago
Proton Mail's iPhone App Adds Full-Text Search for Encrypted Email
Proton Mail's iPhone App Adds Full-Text Search for Encrypted Email
5 hours ago
Apple Backs US Warning Over AI Threat to Encryption
Apple Backs US Warning Over AI Threat to Encryption
8 hours ago
Apple's HomeView is Backordered Into February
Apple's HomeView is Backordered Into February
18 hours ago
CARROT Weather Adds Almanac for Personal Weather History
CARROT Weather Adds Almanac for Personal Weather History
19 hours ago
Instagram Cracking Down on Unlabeled Realistic AI Content
Instagram Cracking Down on Unlabeled Realistic AI Content
20 hours ago
Apple Stores Running Short on iPhone Duo Repair Parts
Apple Stores Running Short on iPhone Duo Repair Parts
21 hours ago
AirPods Max 2 or Beats 360? Here's Which Apple Headphones to Get
AirPods Max 2 or Beats 360? Here's Which Apple Headphones to Get
22 hours ago
Apple Releases 27.2.2 HomeView Software Update
Apple Releases 27.2.2 HomeView Software Update
1 day ago
Apple's FileMaker Pro Gaining Support for AI Coding Agents
Apple's FileMaker Pro Gaining Support for AI Coding Agents
1 day ago
ChatGPT Brings Redesigned App to iPhone Duo, Expands 'Dots' Access
ChatGPT Brings Redesigned App to iPhone Duo, Expands 'Dots' Access
1 day ago
Missed Black Friday? Amazon's MacBook Air Sale Brings Back Big $399 Discount
Missed Black Friday? Amazon's MacBook Air Sale Brings Back Big $399 Discount
1 day ago
Apple Preparing Online Store for AI Agent Integration
Apple Preparing Online Store for AI Agent Integration
1 day ago
Spotify Wrapped 2026 Now Available
Spotify Wrapped 2026 Now Available
1 day ago
Apple Shares New Video Highlighting Features for Parents With Disabilities
Apple Shares New Video Highlighting Features for Parents With Disabilities
1 day ago
PROLED MacBook Pro Receives Massive $1,000 Amazon Discount [Update: Gone]
PROLED MacBook Pro Receives Massive $1,000 Amazon Discount [Update: Gone]
1 day ago
Apple Escapes $502 Million Payout in UK Optis Patent Dispute
Apple Escapes $502 Million Payout in UK Optis Patent Dispute
1 day ago
iPhone 20 Pro's Redesign May Be Less Radical Than Expected
iPhone 20 Pro's Redesign May Be Less Radical Than Expected
1 day ago
Facebook Messenger Now Works With Apple CarPlay
Facebook Messenger Now Works With Apple CarPlay
1 day ago
Apple's OLED iPad Air Supply Race Heats Up as BOE Starts Production
Apple's OLED iPad Air Supply Race Heats Up as BOE Starts Production
1 day ago
Tim Cook and John Ternus Pay Tribute to Warren Buffett
Tim Cook and John Ternus Pay Tribute to Warren Buffett
1 day ago
Disney Finishes Merging Disney+ and Hulu Apps
Disney Finishes Merging Disney+ and Hulu Apps
2 days ago
Meta Working on New 'IRL' Social App
Meta Working on New 'IRL' Social App
2 days ago