Skip to main content

String Similarity & Fuzzy Matching

Compare strings with Levenshtein, Jaro–Winkler, Dice and more, or rank fuzzy matches

Input

0 characters

0 characters

Up to 2000 characters per string.

Normalization

All steps are off by default and are shown above the results when active.

Advanced
Compare by
Jaccard sets

Results

Normalization:none, raw input compared
Enter two strings
Every algorithm runs as you type. Load an example to see typical results.

Details

About Levenshtein

What it measures
The fewest single-character insertions, deletions and substitutions that turn A into B.
Range
0 to the length of the longer string; 0 means identical.
Best for
Typos, spell checking and short identifiers.
Note
The normalized similarity is 1 − distance ÷ the longer length.

How to use

  1. 1.Choose Compare two or Rank candidates, or load an example.
  2. 2.Type the two strings, or a query and one candidate per line.
  3. 3.Turn on the normalization steps you want; the active policy is shown above the results.
  4. 4.Select an algorithm in the table, or choose one under Rank by, to read what it measures.
  5. 5.In rank mode, copy or download the ranking as CSV.

What String Similarity & Fuzzy Matching does

Compare two strings with nine distance and similarity algorithms at once, or rank a list of candidates against a query with the algorithm you choose. Distances (Levenshtein, Damerau–Levenshtein, optimal string alignment, Hamming) count edits and are never shown as percentages; each one gets a separately labelled normalized similarity. Similarities (Jaro, Jaro–Winkler, Dice, Jaccard, longest common subsequence) are scores from 0 to 1. Compare mode also shows one optimal edit script, so you can see which characters were matched, substituted, inserted or deleted.

How the results are calculated
  • •Strings are compared by Unicode code points, so an emoji counts once. Switch to graphemes under Advanced to treat e + combining accent or an emoji family as one character.
  • •Damerau–Levenshtein is the unrestricted variant (CA → ABC is 2); optimal string alignment, the restricted variant many libraries use, is listed separately (3).
  • •Jaro–Winkler uses scaling factor 0.1 and a prefix of up to 4 characters, and adds the bonus only when Jaro is at least 0.7.
  • •Dice counts shared bigrams; Jaccard uses bigram sets by default or word sets. Strings shorter than 2 characters have no bigrams.
  • •Hamming needs equal lengths and is reported as unavailable otherwise; strings are never padded.
  • •Rankings sort distances from smallest and similarities from largest; ties keep the input order.
Limits and privacy

Compare mode accepts up to 2,000 characters per string; rank mode accepts up to 5,000 candidates of 256 characters each, and longer candidates are skipped and counted. Lists with more than 500 candidates are ranked in a background worker, and a newer edit cancels the previous run. Normalization runs only when you turn it on. Everything runs in your browser; the strings are not uploaded, stored or sent to analytics.

Frequently asked questions
What is the difference between a distance and a similarity?
A distance such as Levenshtein counts edits, so 0 means identical and larger is less similar. A similarity such as Jaro–Winkler is a score from 0 to 1 where 1 means identical. Distances are never shown as percentages here; each one gets a separately labelled normalized similarity, 1 minus the distance divided by the longer length.
Which algorithm should I use for fuzzy matching names?
Jaro–Winkler suits short strings such as names because it rewards a shared beginning. Levenshtein or Damerau–Levenshtein suit typos, Dice and Jaccard suit longer phrases where characters move, and Hamming suits fixed-length codes. Rank a few real candidates with each metric to see which ordering fits your data.
Are my strings uploaded or stored?
No. Every algorithm runs in your browser, large rankings in a background worker on the same page. The strings and candidate lists are never uploaded, stored or sent to analytics.

CodingTool is officially live on