{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"string-similarity"},"result":{"entity_type":"calculator","id":"string-similarity","calculator_id":"string-similarity","canonical_url":"https://tttkmbb.com/developer/string-similarity","name":"String Similarity Calculator","title":"String Similarity Calculator – Levenshtein, Jaro–Winkler, Dice, Hamming and LCS Between Two Strings","category":"developer","category_name":"Developer & IT","tool_name":"calculate_string_similarity","featured_mcp_tool":false,"description":"Compares two strings with the Levenshtein edit distance and similarity, Jaro and Jaro–Winkler similarity, the bigram Sørensen–Dice coefficient, the Hamming distance (equal lengths only) and the longest common subsequence length.","use_when":"You need a fuzzy-match score for names, deduplication, spell-check suggestions or typo tolerance, or want to compare several similarity metrics on the same pair.","do_not_use_when":"You need semantic similarity (embeddings), phonetic matching (Soundex/Metaphone) or strings longer than 2,000 characters.","inputs":[{"name":"text_a","label":"First string","type":"string","required":true,"description":"First string to compare.","example":"kitten"},{"name":"text_b","label":"Second string","type":"string","required":true,"description":"Second string to compare.","example":"sitting"},{"name":"case_sensitive","label":"Case sensitive","type":"boolean","required":false,"default":false,"description":"When false (default) both strings are lower-cased before comparison.","example":false}],"outputs":[{"name":"levenshtein_distance","label":"Levenshtein distance","type":"integer","decimals":4,"description":"Minimum number of single-character insertions, deletions or substitutions to turn text_a into text_b."},{"name":"levenshtein_similarity","label":"Levenshtein similarity","type":"number","decimals":4,"description":"1 − distance / max(length_a, length_b), from 0 to 1."},{"name":"jaro","label":"Jaro similarity","type":"number","decimals":4,"description":"Jaro similarity based on matching characters within a window and transpositions."},{"name":"jaro_winkler","label":"Jaro–Winkler similarity","type":"number","decimals":4,"description":"Jaro boosted for a common prefix of up to 4 characters with scaling factor 0.1."},{"name":"dice_coefficient","label":"Sørensen–Dice (bigrams)","type":"number","decimals":4,"description":"2 × shared bigrams / (bigrams_a + bigrams_b), counting repeated bigrams."},{"name":"hamming_distance","label":"Hamming distance","type":"integer","decimals":4,"description":"Number of positions with different characters; only defined for strings of equal length (omitted otherwise)."},{"name":"longest_common_subsequence","label":"Longest common subsequence","type":"integer","decimals":4,"description":"Length of the longest sequence of characters appearing in both strings in the same order (not necessarily contiguous)."},{"name":"length_a","label":"Length of A","type":"integer","decimals":4,"description":"Code points in text_a."},{"name":"length_b","label":"Length of B","type":"integer","decimals":4,"description":"Code points in text_b."}],"input_schema":{"type":"object","properties":{"text_a":{"description":"First string to compare.","type":"string","examples":["kitten"]},"text_b":{"description":"Second string to compare.","type":"string","examples":["sitting"]},"case_sensitive":{"description":"When false (default) both strings are lower-cased before comparison.","type":"boolean","default":false,"examples":[false]}},"additionalProperties":false,"required":["text_a","text_b"]},"output_schema":{"type":"object","properties":{"levenshtein_distance":{"description":"Minimum number of single-character insertions, deletions or substitutions to turn text_a into text_b.","type":"integer"},"levenshtein_similarity":{"description":"1 − distance / max(length_a, length_b), from 0 to 1.","type":"number"},"jaro":{"description":"Jaro similarity based on matching characters within a window and transpositions.","type":"number"},"jaro_winkler":{"description":"Jaro boosted for a common prefix of up to 4 characters with scaling factor 0.1.","type":"number"},"dice_coefficient":{"description":"2 × shared bigrams / (bigrams_a + bigrams_b), counting repeated bigrams.","type":"number"},"hamming_distance":{"description":"Number of positions with different characters; only defined for strings of equal length (omitted otherwise).","type":"integer"},"longest_common_subsequence":{"description":"Length of the longest sequence of characters appearing in both strings in the same order (not necessarily contiguous).","type":"integer"},"length_a":{"description":"Code points in text_a.","type":"integer"},"length_b":{"description":"Code points in text_b.","type":"integer"}}},"formula":"Levenshtein: dynamic programming over insert/delete/substitute cost 1; Jaro = (m/|a| + m/|b| + (m − t)/m) / 3 with m matches within floor(max(|a|,|b|)/2) − 1 and t = transpositions/2; Jaro–Winkler = jaro + ℓ·0.1·(1 − jaro), ℓ = common prefix length ≤ 4; Dice = 2·|bigrams_a ∩ bigrams_b| / (|bigrams_a| + |bigrams_b|)","method":"Strings are compared by Unicode code point (no normalisation; é as one code point and e + combining accent differ). The Winkler boost is applied for every Jaro value (no 0.7 threshold), matching the Wikipedia definition.","sources":[{"name":"Levenshtein distance (Wikipedia)","url":"https://en.wikipedia.org/wiki/Levenshtein_distance","type":"reference","retrieved_at":"2026-09-24"},{"name":"Jaro–Winkler distance (Wikipedia)","url":"https://en.wikipedia.org/wiki/Jaro%E2%80%93Winkler_distance","type":"reference","retrieved_at":"2026-09-24"},{"name":"Sørensen–Dice coefficient (Wikipedia)","url":"https://en.wikipedia.org/wiki/S%C3%B8rensen%E2%80%93Dice_coefficient","type":"reference","retrieved_at":"2026-09-24"}],"freshness":{"type":"static","max_age_seconds":null,"note":"Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output."},"examples":[{"name":"kitten vs sitting","inputs":{"text_a":"kitten","text_b":"sitting"},"expected":{"levenshtein_distance":3,"levenshtein_similarity":0.5714,"jaro":0.746,"jaro_winkler":0.746,"dice_coefficient":0.3636,"longest_common_subsequence":4},"url":"https://tttkmbb.com/api/v1/calculate/string-similarity?text_a=kitten&text_b=sitting"},{"name":"MARTHA vs MARHTA (Winkler's example)","inputs":{"text_a":"MARTHA","text_b":"MARHTA","case_sensitive":true},"expected":{"jaro":0.9444,"jaro_winkler":0.9611,"levenshtein_distance":2,"hamming_distance":2,"longest_common_subsequence":5},"url":"https://tttkmbb.com/api/v1/calculate/string-similarity?text_a=MARTHA&text_b=MARHTA&case_sensitive=true"}],"faq":[{"q":"Which metric should I use?","a":"Levenshtein for typos and edit-based matching, Jaro–Winkler for short names where the beginning matters, Dice for word-level similarity that tolerates reordering; a Jaro–Winkler above about 0.9 usually indicates the same name."},{"q":"Why is Hamming distance missing?","a":"It only exists for strings of equal length; for kitten (6) and sitting (7) it is undefined, so the output is omitted."},{"q":"Are the metrics symmetric?","a":"Yes, all reported metrics give the same value when text_a and text_b are swapped."}],"tags":["levenshtein distance","jaro winkler","string similarity","fuzzy match","edit distance","dice coefficient"],"related":[{"calculator_id":"text-hash","reason":"Exact-match fingerprints instead of fuzzy scores."},{"calculator_id":"percentage","reason":"Express a 0–1 similarity score as a percentage."}],"links":{"html":"https://tttkmbb.com/developer/string-similarity","markdown":"https://tttkmbb.com/developer/string-similarity.md","json":"https://tttkmbb.com/developer/string-similarity.json","api":"https://tttkmbb.com/api/v1/calculate/string-similarity","schema":"https://tttkmbb.com/api/v1/calculators/string-similarity","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-24"},"timestamp":"2026-09-24T03:45:03Z","next_actions":[{"tool":"run_calculator","calculator_id":"string-similarity","reason":"Run String Similarity Calculator with the inputs above."}],"links":{"markdown":"https://tttkmbb.com/developer/string-similarity.md"}}