Wolfram Research

Function Repository Resource:

NotebookWordCount

Source Notebook

Count the number of words in a notebook document

Contributed by: Jon McLoone

ResourceFunction["NotebookWordCount"][nb]

counts the number of words in notebook nb.

ResourceFunction["NotebookWordCount"][]

counts the number of words in the selected notebook.

Examples

Basic Examples

Count the words in the current notebook:

In[1]:=
ResourceFunction["NotebookWordCount"][]
Out[1]=

Scope

You can specify another notebook with its NotebookObject or using its Notebook expression:

In[2]:=
ResourceFunction["NotebookWordCount"][
 Notebook[{Cell["Hello world", "Text"]}]]
Out[2]=

Requirements

Wolfram Language 11.3 (March 2018) or above

Resource History

License Information