Text Similarity Checker

Paste two or more texts to compute cosine similarity scores instantly — great for prompt deduplication, RAG chunk comparison, and paraphrase detection.

Presets:
Text 10 chars
Text 20 chars

Similarity computed using TF-IDF cosine similarity on tokenized words — lexical matching, not neural semantic embeddings.

Fill all text panels above to see similarity scores.

Frequently Asked Questions

What is cosine similarity, and how is it calculated here?

Cosine similarity measures how similar two texts are by treating each text as a vector of word frequencies and computing the cosine of the angle between those vectors. A score of 100% means the texts are identical in vocabulary; 0% means they share no words (after filtering common stop words). This tool uses TF-IDF-weighted word vectors — a standard technique for measuring lexical similarity that runs instantly in your browser without any model download.

What is the difference between lexical and semantic similarity?

Lexical similarity measures word overlap — "The cat sat on the mat" and "The mat was sat on by the cat" score very high because they share the same words. Semantic similarity measures meaning — "dog" and "puppy" would score high even though the words differ. This tool computes lexical (TF-IDF) similarity, which is fast, transparent, and excellent for deduplication and prompt variation comparison. For true semantic similarity, use a neural embedding model such as OpenAI's text-embedding-3-small via the AI Playground.

Is my text sent to any server?

No. All tokenization, vectorisation, and similarity computation runs locally in your browser using plain JavaScript. Your text never leaves your device and is not sent to any server or third party.

What is a good similarity score for prompt deduplication?

For prompt deduplication in RAG pipelines, a score of 90% or higher typically indicates near-identical prompts or chunks that can be merged. 70–89% indicates strong overlap worth reviewing. Scores below 50% usually represent genuinely distinct content. These thresholds depend on your domain — technical documentation with repeated terminology will naturally score higher than conversational prompts.

Can I compare more than two texts at once?

Yes. Click "+ Add text" to add up to 5 text panels. When three or more panels are filled, the tool displays a full similarity matrix showing every pairwise score — useful for comparing multiple prompt variants or RAG document chunks at once.

Why does "I love eating pizza" and "Pizza is my favorite food" score below 100%?

Because those sentences share some content words ("pizza") but not all. Lexical similarity is proportional to shared vocabulary. A semantic embedding model would rate these as highly similar since they convey the same meaning — but that requires a neural model. Use this tool to catch near-duplicates and gross overlaps; use an embedding API for nuanced semantic comparison.

What are stop words, and how do they affect the score?

Stop words are very common words (like "the", "is", "a", "in") that carry little semantic weight. This tool filters them out before computing similarity so that two completely different texts that both contain "the cat" don't artificially inflate their similarity score. Only meaningful content words contribute to the final score.