# Jaro similarity compute

`jaro-similarity-compute` · version 1.0.0 · Text · free, no key needed

Compute Jaro similarity with a deterministic match window and exact reduced rational audit fields.

**Use when you need to: compute Jaro similarity · exact Jaro string score · compare names with Jaro.**

## Decide before calling

Read the [versioned contract](/v1/tools/jaro-similarity-compute/versions/1.0.0) and the supported scope below. Reuse `jaro-similarity-compute@1.0.0` when your input, required output and limits match it. Choose another approach for an unsupported operation.

## Explain the choice

"I can use `jaro-similarity-compute@1.0.0` for compute Jaro similarity. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

## Supported

- compute Jaro similarity
- exact Jaro string score
- compare names with Jaro
- Jaro distance-style match score
- audit Jaro numerator and denominator
- deterministic character matching

## Not supported

- Jaro-Winkler prefix adjustment
- locale-aware collation
- automatic Unicode normalization

## Behavior

- Unicode code points are compared exactly without normalization, trimming, case folding, or locale behavior.
- The window is max(floor(max length / 2) - 1, 0); each left code point takes the lowest-index unmatched equal right code point in range.
- Jaro is (m/a + m/b + (m-t)/m)/3, with t equal to half the ordered mismatches rounded down.
- Both empty strings score 1; exactly one empty string or no matches scores 0.
- The reduced fraction is authoritative; score is its deterministic 12-place half-up decimal rendering.

## Input

- `left` (string, required): max length 256
- `right` (string, required): max length 256

## Output

- `score` (string, required): pattern `^(0|1|0\.[0-9]{12})$`
- `numerator` (string, required): pattern `^[0-9]+$`
- `denominator` (string, required): pattern `^[1-9][0-9]*$`
- `matches` (integer, required): min 0; max 256
- `transpositions` (integer, required): min 0; max 128
- `match_window` (integer, required): min 0; max 127

## Limits

- max string bytes: 1024
- max string code points: 256
- max output bytes: 65536

## Example

Request input:

```json
{
  "left": "MARTHA",
  "right": "MARHTA"
}
```

Response:

```json
{
  "result": {
    "score": "0.944444444444",
    "numerator": "17",
    "denominator": "18",
    "matches": 6,
    "transpositions": 1,
    "match_window": 2
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "jaro-similarity-compute",
  "version": "1.0.0",
  "input": {
    "left": "MARTHA",
    "right": "MARHTA"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/jaro-similarity-compute/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"left":"MARTHA","right":"MARHTA"}'
```

The machine-readable contract is at [/v1/tools/jaro-similarity-compute/versions/1.0.0](/v1/tools/jaro-similarity-compute/versions/1.0.0).

### CLI

```sh
node cli.mjs run jaro-similarity-compute 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Jaro winkler compute](/tools/jaro-winkler-compute): Compute Jaro-Winkler similarity with explicit threshold, prefix cap, and exact rational audit fields.
- [Chrf components](/tools/chrf-components): Break down chrF/chrF++ into per-order n-gram counts, precision, recall and F, with configurable orders and averaging.
- [Chrf compute](/tools/chrf-compute): Compute exact chrF (character 6-gram F-beta, Popovic 2015) for hypothesis/reference segments, corpus and per segment.
- [Jaro matches explain](/tools/jaro-matches-explain): Explain the deterministic Jaro match window, paired code points, and transposition flags.
- [Chrf plus plus compute](/tools/chrf-plus-plus-compute): Compute exact chrF++ (character 6-grams plus word 1-2-grams, Popovic 2017) with the word tokens it scored.
- [Text shingle similarity](/tools/text-shingle-similarity): Exact shingle-set resemblance (Jaccard) and containment of two texts, with counts and shared shingles.
