created by Affan :)
Existing word counting solutions are poorly suited to LaTeX documents. General-purpose counters process raw source as plain text, producing inflated totals that include commands, preamble declarations, and environment syntax. TeXcount and Overleaf's built-in counter offer greater accuracy but present their own limitations: Overleaf's default "Total Words" counts only body text as interpreted by TeXcount, systematically excluding bibliography entries, citations, captions, and footnotes. TeXcount itself can be configured to include these elements, but doing so requires modifying command-line flags or compilation settings—a process that introduces friction disproportionate to the task of checking a document against a word limit.
This tool was developed to provide a purpose-built alternative. It performs single-pass parsing of LaTeX source entirely within the browser, requiring no server, no compilation step, and no external dependencies. The parser identifies and classifies the full structure of a .tex file: preamble content, sectioning commands, citation keys, figure captions, table environments, footnotes, mathematical expressions, and bibliography entries. Each element is assigned a typed token, and the word count is computed from whichever categories the user has toggled on. A colour-coded verbose view offers full transparency over every classification decision, allowing authors to verify precisely how each part of their document has been treated before submission.
The goal was something fast, transparent, and accurate enough to trust with a binding word limit—without requiring users to learn TeXcount flags or accept Overleaf's conservative defaults.
Affan · Land Economy Tripos · University of Cambridge
All word counting happens entirely within the browser. No LaTeX source is transmitted, uploaded, or stored on any server at any point. The tool runs as a self-contained HTML file with no external connections, so document content never leaves the machine it is opened on.
The entire source code is visible and open-source (MIT License). You can verify these privacy claims by viewing the page source (right-click → "View Page Source" or Ctrl+U). No tracking, no analytics, no cookies. Any preferences you set are stored only in your browser.
Paste your entire .tex file into the text area — preamble, \begin{document}, bibliography and all. The counter automatically strips the preamble and parses the rest. Press Count Words or Ctrl+Enter.
The \title{}, \author{}, and \date{} text within your document body are counted as body words — if these commands appear in the preamble (before \begin{document}), they are not counted.
If your assignment has a word limit, enter it in the Target field. A progress bar will show your count, percentage, and signed difference. The bar turns red if you exceed the target.
Each checkbox controls whether a category is included in the total. All are on by default. Turning one off excludes that category and updates the verbose view and structure counts live.
\cite-family command counts as 1 word per citation key (e.g. \citep{A, B} = 2 words). Inline text citations you type yourself ("Smith (2020) argues…") are body text regardless of this toggle.\begin{figure}...\end{figure} environments.table, tabular, tabularx, and longtable environments.\footnote{} commands.equation, align, etc.) and inline math ($...$). Each variable, number, or symbol command counts as 1 word. The summary separately shows "Math expressions" — the number of display-math blocks.\section{}, \subsection{}, and \subsubsection{} commands. When off, heading titles are excluded from the total.\begin{thebibliography}...\end{thebibliography}.| Body text | |
| Citations | |
| Figure captions | |
| Table contents | |
| Footnotes | |
| Mathematics | |
| Headings | |
| Bibliography | |
| LaTeX commands — never counted | |
| Comments — never counted | |
| Preamble — never counted | |
| Structural markers — never counted |
A single-pass parser classifies every character into a typed token. Both the word counter and the colour renderer read from the same token list, so they can never disagree. Words are counted by splitting on whitespace and filtering out LaTeX symbols and punctuation-only fragments.
v1.0 — 20 Feb 2026
Initial release.
\enquote{} and extended text wrapper commandsIf you encounter unexpected behaviour, an incorrect word count, or a parsing error, please report it so it can be fixed.
Email: bugs@latexwordcounter.com
Issue tracker: github.com/affan/latex-word-counter/issues
When reporting, please include the LaTeX source (or a minimal example) that produces the incorrect result, the expected word count, and which toggles were active.