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.

A
Sample A (Known Author)
0 words · 0 sentences
B
Sample B (Unknown / Comparison)
0 words · 0 sentences
Similarity Score
Different
Same author
📖 Vocabulary Profile
📐 Sentence Structure
🔤 Function Word Fingerprint

Function words (the, and, but, of, etc.) are the strongest authorship indicators — writers use them unconsciously and consistently across topics.

✏️ Punctuation & Formatting
📊 Readability & Complexity
🔗 Characteristic Phrases

Shared bigrams and trigrams — phrase-level habits that persist across texts by the same author.

🧬 Feature-by-Feature Similarity

Stylometry Analyzer — Forensic Authorship Attribution

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

How reliable is stylometric analysis?

Academic studies achieve 85-95% accuracy for authorship attribution when using sufficient sample sizes (2,500+ words) from a closed set of candidate authors. 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. Studies show that deliberate obfuscation is detectable in itself — the resulting text often shows unnatural statistical properties. The analyzer examines multiple independent feature categories, making comprehensive disguise extremely difficult.

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.