Written and maintained by CASRAI Editorial Board
Last updated
Researchers searching for a word count in LaTeX usually need one thing: a number they can compare with a journal limit. LaTeX has no built-in counter, so the count comes from TeXcount, a Perl script that parses the source. Overleaf runs it for you under File, then Word Count; elsewhere you run texcount on the command line or use its web interface. However you phrase the task (latex word count, count words latex, word count on latex), what TeXcount includes by default is not what most journals count, so the settings below matter.
What word counting in LaTeX is used for in research
Journals, funders and universities set limits on abstracts, main text or whole manuscripts. A LaTeX source file mixes prose with commands, so a plain text editor count overstates the length. TeXcount counts words, headers and formulae separately and skips LaTeX commands. For the policy side of limits (what typically counts and how to cut a submission), see manuscript word count limits and how to shorten a submission.
Install or access (official sources only)
- Overleaf: nothing to install. Overleaf’s documentation states it runs TeXcount on the project’s main file and on files pulled in with
includeandinput. The main document must sit at the top level of the project, not inside a folder. - Local TeXcount: the TeXcount home page describes it as a Perl script for counting words in LaTeX documents, available from CTAN and included in several TeX distributions.
- Web interface: the TeXcount site offers an online version, useful when you cannot install anything.
Step-by-step: count words in a LaTeX document
Word count in Overleaf
- Open the project and make sure it compiles.
- Select File, then Word Count.
- Read the totals. Recompile and reopen the dialog after any change to the counting directives described below.
Word count from the command line
- Run
texcount mydoc.texon the main file (syntax:texcount [options] file(s)). - To follow
inputandinclude, add-inc: one count per file plus a total. Use-mergeto merge the subdocuments into the main document instead. - To see which parts were counted as what, add
-v(verbose parse output), for exampletexcount -v mydoc.tex. Add-htmlto write a colour-coded view:texcount -v -html mydoc.tex > tmp.html. On Windows the verbose option needs TeXcount version 3.0 or later. - To print only the total, combine
-1with-sum; the TeXcount FAQ states the output then contains only the total word count.
Output and how to read it: what is counted by default and how to change it
Overleaf’s documentation states that by default references, headers, captions, floats, displayed math and similar content are not included in the count. A journal limit that includes tables, captions or references therefore needs the changes in this table.
| You want to | Do this | Caveat |
|---|---|---|
| Exclude a region (for example the title block) | Wrap it in %TC:ignore and %TC:endignore; TeXcount ignores the region completely. |
Overleaf’s example wraps maketitle. |
| Count the abstract separately | Put %TC:break before it so it is counted as its own section. |
Documented in the TeXcount FAQ. |
| Include the reference list | Add %TC:incbib to the preamble (Overleaf also needs a latexmkrc file), or use -incbib locally. It processes thebibliography, or reads the .bbl file when bibliography is used. |
Works with a manual thebibliography or BibTeX. TeXcount does not currently support BibLaTeX (Overleaf documentation). |
| Count inline citations | Declare %TC:macro cite [option:text,text]; the same pattern applies to citep and citet. Each citation counts as one word. |
Declare each command you use. |
| Include table text | Add %TC:group table 0 1 and %TC:group tabular 1 1. |
Adds table words to the main text count. |
Make import work |
Add %TC:fileinclude import dir,file, then recompile before clicking Word Count. |
import is not recognised by default. |
Troubleshooting
- Parts of the project are missing from the count. Check that the files are pulled in with
includeorinput;importneeds the%TC:fileincludedirective. Locally, use-inc. - Word Count fails or counts the wrong file in Overleaf. The main document must be at the top level of the project, not in a folder.
- References are not counted with biblatex. TeXcount does not currently support BibLaTeX, per Overleaf’s documentation. See LaTeX bibliography styles explained for how BibTeX and BibLaTeX differ.
- Directive changes have no effect. Recompile first, then reopen Word Count.
- Unsure what was counted. Run
texcount -vand read the verbose parse.
Free alternatives
| Option | Where it runs | Source |
|---|---|---|
| Overleaf Word Count | In the browser, inside an Overleaf project (uses TeXcount) | Overleaf documentation |
| TeXcount command line | Locally, as a Perl script from CTAN or your TeX distribution | TeXcount site |
| TeXcount web interface | In the browser, without installing | TeXcount site |
If your team writes together in Overleaf, LaTeX and Overleaf collaborative writing covers the workflow around it.
FAQ
How do I do a word count in LaTeX?
Use TeXcount. In Overleaf choose File, then Word Count; locally run texcount yourfile.tex.
How do I count words in LaTeX when the document uses several files?
Run texcount -inc main.tex to count files pulled in by input and include, with one count per file and a total.
Does the LaTeX word count include references?
Not by default. Add %TC:incbib (BibTeX or manual thebibliography only; BibLaTeX is not supported).
How do I exclude the abstract or title page?
Wrap the region in %TC:ignore and %TC:endignore, or place %TC:break before the abstract to count it as a separate section.
Sources
- Overleaf documentation, Using the word count: docs.overleaf.com/writing-and-editing/using-word-count (read 2026-11-08).
- TeXcount home page: app.uio.no/ifi/texcount (read 2026-11-08).
- TeXcount how-to: app.uio.no/ifi/texcount/howto.html (read 2026-11-08).
- TeXcount FAQ: app.uio.no/ifi/texcount/faq.html (read 2026-11-08).







