Wolfram Research

NotebookWordCount

Contributed by: Jon McLoone

Source Notebook

Count the number of words in a notebook document

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]=

Resource History