Skip to main content

String Similarity Calculator

Compare two strings with exact numeric similarity metrics: Levenshtein edit distance (with an insert/delete/substitute operation breakdown and a visual DP matrix), Jaro and Jaro-Winkler similarity, Hamming distance, and bigram cosine similarity.

Input

Treat "Word" and "word" as equal in every metric below.

Output

Similarity Metrics
MetricValue
No data yet
Levenshtein Edit Operations (A → B)
OperationCount
No data yet
Levenshtein Distance Matrix
 
Was this helpful?

Guides

Compare two strings using five well-known string-distance and string-similarity algorithms at once: Levenshtein edit distance, Jaro and Jaro-Winkler similarity, Hamming distance, and cosine similarity over character bigrams. Where a plain text-diff tool shows you what changed, this tool tells you how much — as exact, reproducible numbers.

How to use it

Type or paste String A and String B, then read the results instantly — the tool recalculates on every keystroke. Turn on Ignore case to treat "Word" and "word" as equal across every metric.

What each metric means

  • Levenshtein Distance — the minimum number of single-character insertions, deletions, and substitutions needed to turn String A into String B. The Levenshtein Similarity row expresses the same distance as a percentage (1 − distance ÷ longer string's length).
  • Levenshtein Edit Operations — a breakdown of exactly how many insertions, deletions, and substitutions make up that minimal edit script, plus how many characters matched unchanged.
  • Levenshtein Distance Matrix — the full dynamic-programming table the algorithm builds internally, row- and column-labeled with the actual characters compared. Read a cell as "the edit distance between the prefixes ending at this row and column." Skipped for strings longer than 25 characters, where the grid stops being readable.
  • Jaro Similarity — rewards strings that share characters close together in position, tolerant of small transpositions (used in record linkage and duplicate-detection systems).
  • Jaro-Winkler Similarity — Jaro similarity boosted for strings sharing a common prefix (up to 4 characters), which makes it a common choice for matching names and short identifiers where the start of the string tends to be more reliable.
  • Hamming Distance — the number of differing characters at the same position, defined only when both strings are the same length; shown as "N/A" otherwise.
  • Cosine Similarity (bigrams) — treats each string as a vector of overlapping 2-character sequences and measures the angle between them, a metric common in fuzzy text matching and near-duplicate detection.

Why do the algorithms disagree?

They're built for different jobs. Levenshtein and Hamming count raw character-level edits, so a single inserted letter near the start of a long string can look like a big change. Jaro-Winkler and bigram cosine similarity weigh shared structure more than position, so they're often more forgiving of typos, reordering, and length differences — which is why fuzzy-matching and spell-check systems tend to favor them over plain edit distance.

Is this the same as a text diff?

Not quite. Use this tool when you need a precise number — deduplicating records, tuning a fuzzy-matching threshold, grading how close a typed answer is to the correct one. For a side-by-side view of exactly which words or lines changed between two blocks of text, use the Text Compare tool instead, or the Text Similarity Checker for a general character/word-overlap score on longer passages.

Privacy

Everything runs in your browser — the strings you enter are never sent to a server.

levenshteinjaro-winklerhamming distancecosine similarityedit distancefuzzy matchingstring distancerecord linkagespell check

More ways to use this tool

REST API

curl -X POST https://api.iotools.cloud/v1/tool/string-similarity-calculator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "stringA": "kitten",
    "stringB": "sitting",
    "caseInsensitive": ""
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `string-similarity-calculator` tool (String Similarity Calculator) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

Embed widget

<iframe
  src="https://iotools.cloud/embed/string-similarity-calculator/"
  width="100%" height="520" frameborder="0" scrolling="no" loading="lazy"
  title="String Similarity Calculator — iotools.cloud"
  sandbox="allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox"
  allow="clipboard-write"
  style="width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden"></iframe>
<script src="https://iotools.cloud/embed.js" async></script>

Drop this into your own page — free, no key required, just a link back.

Cost per callFrom 5 credits

Also available with

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.