Stylometry and authorship analysis: what it can and cannot show

schedule 6 min read · Last updated: October 15, 2026

Stylometry is the oldest quantitative method for asking who wrote a text, and it is now being asked a new question: whether a person wrote a text at all, or a machine did. This guide explains what stylometry measures, where it has worked, how it differs from AI detectors, and why it cannot settle questions of AI use on its own.

Short answer: Stylometry measures writing habits, such as how often a writer uses common function words, sentence length and punctuation, to compare a text with an author's known writing. It can show that a document is unlike someone's usual style, but it cannot prove AI use on its own, and it needs substantial samples of verified writing: research has put the minimum at around 2,000 to 5,000 words for reliable attribution.

What does stylometry measure?

Stylometry treats writing style as something that can be counted. The features most often used are ones writers rarely notice they are choosing:

Patrick Juola, who carried out a widely reported 2013 analysis, explained the idea using the preposition people choose for where a fork goes on a table: "on", "to" or "at" the left. "There's a lot of different right answers," he said, "that people don't even notice they're making" (NPR, 2013). Small differences across the 50 or 100 most frequent words add up to a profile that can be compared with other documents.

The task of deciding whether two texts were written by the same person is called authorship verification. The PAN research workshops have run shared evaluations of it in several years since 2013, defining it as "deciding whether two texts have been written by the same author based on comparing the texts' writing styles" (PAN at CLEF 2023). A survey of the field is Juola, Authorship Attribution, in Foundations and Trends in Information Retrieval.

Where has stylometry worked?

The Federalist Papers. Twelve of the essays published in 1787 and 1788 to argue for the US Constitution were claimed by both Alexander Hamilton and James Madison. In a study first published in the Journal of the American Statistical Association in 1963 and expanded into a 1964 book, statisticians Frederick Mosteller and David Wallace compared the frequencies of common words in the essays of known authorship and concluded that Madison was very likely the author of the disputed papers (History of Information). Their work is also regarded as the first full-scale applied statistical analysis using Bayesian methods.

Robert Galbraith. In 2013 a Sunday Times reporter asked Juola to examine The Cuckoo's Calling, a detective novel published under the name Robert Galbraith. His tests of common words, word pairs, character sequences and word lengths pointed to J.K. Rowling as the most likely author among those compared. Juola was careful about what that showed: it was "either Rowling, or somebody who writes surprisingly like Rowling" (NPR, 2013). Rowling then confirmed she was the author.

Both cases share the conditions stylometry needs: a small, known set of candidate authors and plenty of verified writing from each.

How is stylometry different from an AI detector?

The two methods answer different questions. An AI detector, such as the free Walter Writes AI detector, compares a text with patterns that are common in machine-generated writing. Stylometry compares a text with the known writing of a specific person.

QuestionAI detectorStylometry
What is the text compared with?General patterns of machine and human writingVerified writing by the claimed author
What does a result suggest?The text resembles machine outputThe text is like, or unlike, this person's usual style
What does it need?The text aloneThe text plus substantial known writing by the author
What can mislead it?Short, edited or plain writing, and non-native EnglishShort samples, changes of genre or topic, editing by others, and deliberate disguise
What can it never show alone?Who wrote the text or whether AI use was allowedThat AI, rather than another person or an editor, caused a difference

The methods can support each other. A detector flag on a text that also differs sharply from the author's verified writing is stronger evidence than either signal alone, which is how the AFIP evidence-weight scale treats agreement between independent methods.

What are the limits of stylometry?

Stylometry is best used as one item of evidence alongside drafts, version history and file metadata. AFIP's research on document forensics covers the metadata side, and its methodology explains how AFIP weighs different kinds of evidence.

A worked comparison

AFIP is preparing a worked comparison using two public-domain texts of known authorship from the Federalist Papers: an essay accepted as Madison's and one accepted as Hamilton's. The comparison counts the frequencies of the same set of common function words in each essay and in a third essay, then shows which known author the third essay sits closer to and how the result changes as the sample is shortened. Results will be published here once the analysis has been run and checked.

For related guidance, see why AI detector false positives add up at scale, how to tell whether text was written by AI, the glossary entry on stylometry, or browse all AFIP verification guides.

Frequently asked questions

Can stylometry detect AI writing?

Not on its own. Stylometry can show that a text is unlike a person's known writing, but it cannot say why. An editor, a template, a rushed draft or an AI tool could each explain the difference. It is most useful when combined with other evidence such as drafts, version history and an AI detector result.

How much text does stylometry need?

More than most disputes provide. Research on novels first suggested at least 5,000 words per sample for reliable attribution, and later work found that around 2,000 words can be enough for many authors but not all. Short texts such as emails or single paragraphs give unstable results.

Is stylometry used in court?

Authorship evidence presented in legal proceedings is usually described as forensic linguistics, and whether it is admitted depends on the court and the jurisdiction. Outside court, stylometry is mainly used in research, literary attribution and investigations. Anyone considering it for a legal matter should take advice from a lawyer.

How did stylometry identify J.K. Rowling as Robert Galbraith?

In 2013 Patrick Juola compared The Cuckoo's Calling with novels by several authors using common word frequencies, word pairs, character sequences and word lengths. Rowling came out as the most likely author among those tested. Juola stressed that the result meant Rowling or someone who writes very like her, and Rowling then confirmed it.