---
title: "jaccard function in Strata | Oplema"
description: "Measure how similar two strings are with Jaccard similarity, from 0 for no overlap to 1 for identical. For example, jaccard('duck', 'luck') returns 0.6."
url: "https://oplema.com/docs/strata/functions/jaccard"
updated: "2026-11-04"
---

# jaccard

Score how similar two strings are by the characters they share, from 0 to 1. Uppercase and lowercase letters count as different.

## Try an expression

In [Formula](https://oplema.com/docs/strata/prep/formula), enter the expression and set Output type to **DOUBLE**.

### Expression

```
jaccard('duck', 'luck')
```

### Result

```
0.6
```

To use your own data, replace the example values with column names. Keep format strings and other options as written.

Try it live in Formula

Result
| id | result |
| --- | --- |
| 1 | 0.6 |

## Arguments and types

```
jaccard(s1, s2)
```

**s1**

Text

**s2**

Text

Supported signatures (1)

```
jaccard(s1: VARCHAR, s2: VARCHAR) → DOUBLE
```

The result type can depend on the input types. See DuckDB for the full argument rules.

## Things to know

If the first argument is missing, the result is NULL.

## Related functions

[jaro\_similarity

The Jaro similarity between two strings. Characters of different cases (e.g., a and A) are considered different. Returns a number between 0 and 1. For similarity < score\_cutoff, 0 is returned instead. score\_cutoff defaults to 0.

](https://oplema.com/docs/strata/functions/jaro-similarity)[jaro\_winkler\_similarity

The Jaro-Winkler similarity between two strings. Characters of different cases (e.g., a and A) are considered different. Returns a number between 0 and 1. For similarity < score\_cutoff, 0 is returned instead. score\_cutoff defaults to 0.

](https://oplema.com/docs/strata/functions/jaro-winkler-similarity)[hamming

Calculate the Hamming distance between two strings: the number of positions where their characters differ. Both strings must have the same length, and uppercase and lowercase letters count as different.

](https://oplema.com/docs/strata/functions/hamming)[damerau\_levenshtein

Count the edits needed to turn one string into another, like levenshtein, but swapping two neighboring characters counts as one edit. Uppercase and lowercase letters count as different.

](https://oplema.com/docs/strata/functions/damerau-levenshtein)

[Browse text](https://oplema.com/docs/strata/functions#text) [DuckDB documentation](https://duckdb.org/docs/current/sql/functions/text.html#jaccards1-s2)

Function metadata from DuckDB, used under the [MIT license](https://github.com/duckdb/duckdb/blob/v1.5.4/LICENSE).
