- Home
- Built-in Tools
- Stylometry Analyzer
Stylometry Analyzer
Last updated:
Compare two writing samples to assess authorship likelihood. Analyzes vocabulary richness, sentence structure, punctuation habits, function word distributions, readability, and 40+ stylometric features. Every computation runs in your browser — no text is transmitted anywhere.
Function words (the, and, but, of, etc.) are the strongest authorship indicators — writers use them unconsciously and consistently across topics.
Shared bigrams and trigrams — phrase-level habits that persist across texts by the same author.
Can you tell whether two texts were written by the same person? Stylometry compares writing samples statistically rather than by subject matter. This analyzer extracts 40+ features from each text — type-token ratio, hapax legomena, Yule's K, Flesch-Kincaid and Gunning Fog readability, punctuation rates — and takes the cosine similarity of the 50 most common English function words, the method behind the Mosteller-Wallace study of the disputed Federalist Papers. In tests where writers are not hiding, attribution methods have picked the right author from more than fifty candidates with over 90% accuracy. When writers deliberately disguise or imitate a style, accuracy can fall to random guessing Afroz et al., IEEE S&P (2012).
What is stylometry?
Stylometry is the statistical analysis of writing style. Every author develops unconscious linguistic habits — characteristic patterns in vocabulary choice, sentence construction, punctuation use, and function word frequency that persist across topics and time. These patterns form a "writing fingerprint" that is remarkably difficult to disguise and can be used to attribute anonymous texts to known authors.
How It Works
The analyzer extracts 40+ stylometric features from each writing sample and computes a weighted similarity score. Features are grouped into categories: vocabulary richness metrics (type-token ratio, hapax legomena ratio, Yule's K), sentence structure (mean length, variance, complexity markers), function word distribution (the 50 most common English function words), punctuation patterns (comma rate, semicolon preference, exclamation frequency), and readability indices (Flesch-Kincaid, Gunning Fog, Coleman-Liau). Each feature category contributes to the overall similarity score based on its discriminative power in authorship attribution research.
Function Words — The Strongest Signal
Research in computational linguistics has consistently shown that function word frequency is the single most reliable indicator of authorship. Function words — articles, prepositions, conjunctions, pronouns, auxiliary verbs — are used unconsciously and at stable rates regardless of topic. An author who uses "however" at twice the average rate will do so whether writing about politics or cooking. This analyzer computes the cosine similarity of function word frequency vectors between the two samples, a technique derived from the landmark Mosteller-Wallace study of the disputed Federalist Papers.
Minimum Sample Size
Stylometric analysis becomes more reliable with longer samples. Below 100 words, results are essentially meaningless. At 300-500 words, basic patterns emerge. At 1,000+ words, vocabulary and function word distributions stabilize. For high-confidence attribution, 2,500+ words per sample is recommended. The analyzer displays a confidence indicator based on sample length.
- Type-Token Ratio (TTR)
- The ratio of unique words to total words. Higher TTR indicates a richer vocabulary. Corrected TTR normalizes for text length.
- Hapax Legomena
- Words that appear exactly once in a text. The ratio of hapax legomena to total words is a measure of vocabulary diversity.
- Yule's K
- A vocabulary richness metric that is relatively independent of text length. Lower values indicate more diverse vocabulary.
- Flesch-Kincaid Grade
- Estimates the U.S. grade level needed to understand the text, based on average sentence length and syllable count.
- Gunning Fog Index
- A readability formula that estimates years of education needed to understand a text on first reading.
- Cosine Similarity
- A measure of similarity between two vectors, used here to compare function word frequency distributions. 1.0 = identical, 0.0 = completely different.
✍️ Stylometry — Frequently Asked Questions
What is stylometry?
Stylometry is the statistical analysis of writing style — word choice, sentence length, punctuation, and function-word frequency — used to attribute or compare authorship. This page runs a stylometric comparison in your browser to gauge whether two texts share an author.
How is stylometry used in cyber security and with AI?
Investigators use it to link anonymous posts, ransom notes, or sockpuppet accounts to a known author, and increasingly to flag AI-generated text whose style differs from a person's baseline. The analyzer here surfaces the same features those workflows rely on.
What is a stylometry analysis tool?
Stylometry measures an author’s linguistic fingerprint — word choice, sentence structure, and punctuation patterns — to test whether two texts share an author. This tool runs that comparison in your browser.
How reliable is stylometric analysis?
It depends on the conditions. A 2012 security study notes that attribution methods have reached over 90% accuracy across more than fifty candidate authors when writers are not hiding their style. The same study found accuracy fell to random guessing when authors deliberately obfuscated their style or imitated another writer Afroz et al., IEEE S&P (2012). This tool provides an indicative similarity score, not a forensic certainty. It is most useful for generating investigative leads — flagging potential common authorship that can then be corroborated with other evidence. A high score suggests common authorship is plausible; a low score suggests different authors are likely.
Can an author deliberately disguise their style?
Partially. Conscious features like vocabulary and sentence length can be altered with effort. But function word usage, punctuation micro-patterns, and contraction habits are deeply ingrained and very difficult to consistently disguise across long texts. In one study, deliberate disguise defeated standard attribution, but the disguise itself was detectable: a large feature set told regular from deceptive documents with 96.6% accuracy (F-measure) Afroz et al., IEEE S&P (2012). This analyzer does not test for disguise, so treat a low score on a suspected disguised text with caution.
What kind of text works best?
Natural, unconstrained prose works best — blog posts, forum comments, personal emails, essays, articles. Avoid: quoted material from other sources, heavily edited or collaborative texts, poetry or fiction (which may involve deliberate style shifts), extremely short texts (under 200 words), and machine-generated or heavily template-driven content. Both samples should ideally be from similar genres, though the function word analysis is fairly genre-independent.
Does this tool store or transmit my text?
No. All analysis runs entirely in your browser using client-side JavaScript. Your text never leaves your device. No data is stored in cookies or localStorage. When you close the page, everything is gone. This makes it safe for analyzing sensitive or confidential texts.
How is the overall similarity score calculated?
The score is a weighted average of normalized similarities across feature categories: function word cosine similarity (30% weight — the strongest authorship signal), vocabulary metrics (20%), sentence structure (15%), punctuation patterns (15%), readability indices (10%), and n-gram overlap (10%). Each feature's contribution is displayed in the breakdown table so you can see which dimensions drive the score.