Tanimoto Similarity and SMARTS Substructure Search Explained, with a Free Tool

Published: 19 Oct 2026 · Author: Scidart Academy · Reading time: ~7 min
Two drug molecules side by side with a Tanimoto similarity meter below them
Tanimoto similarity scores how many fingerprint bits two molecules share.

Short answer: Tanimoto similarity compares the fingerprints of two molecules: T = c / (a + b − c), where a and b are the bits set in each molecule and c the bits set in both. It runs from 0 to 1. Open the molecular similarity and substructure search tool, enter two SMILES and press Compare. Aspirin and salicylic acid score 0.554 (moderately similar). For pattern search, use SMARTS such as [CX3](=O)[OX2H1] for a carboxylic acid.

Key terms in one line each

FingerprintA list of bits. Each bit is on (1) when the molecule contains a certain structural fragment.
Tanimoto coefficientc / (a + b − c). Shared bits divided by all bits set in either molecule. Range 0 to 1.
Dice coefficient2c / (a + b). Gives shared bits double weight. Always at least as high as Tanimoto.
SubstructureA group of connected atoms and bonds inside a larger molecule, such as a benzene ring or a COOH group.
SMARTSA pattern language based on SMILES for describing substructures with conditions on atoms and bonds.
Common substructureThe largest set of connected atoms and bonds found in both molecules.

How molecular fingerprints work

A computer cannot compare two drawings directly, so each molecule is turned into a fingerprint. There are three common kinds:

  • Fragment dictionary fingerprints have one bit per predefined fragment, such as a carbonyl next to an oxygen. MACCS keys (166 bits) work this way.
  • Path fingerprints hash every linear path of atoms up to a set length into a bit.
  • Circular fingerprints (ECFP, Morgan) hash the environment around each atom out to a radius of 2 or 3 bonds.

The MolDraw tool uses a 512-bit fragment dictionary fingerprint, the same one as the Compare molecules plugin. Aspirin sets 74 of the 512 bits. Salicylic acid sets 41. Bigger molecules usually set more bits.

Fingerprints record which atoms are bonded to which. They do not record wedges or 3D shape. That is why L-alanine and D-alanine score 1.000.

The Tanimoto formula with a worked count

Let a be the number of bits on in molecule A, b in molecule B, and c in both.

  • Tanimoto: T = c / (a + b − c)
  • Dice: D = 2c / (a + b) = 2T / (1 + T)

Worked example, aspirin vs salicylic acid:

  1. Aspirin, CC(=O)Oc1ccccc1C(=O)O: a = 74 bits.
  2. Salicylic acid, OC(=O)c1ccccc1O: b = 41 bits.
  3. Bits on in both: c = 41. Every salicylic acid bit is also in aspirin.
  4. Union = a + b − c = 74 + 41 − 41 = 74.
  5. T = 41 / 74 = 0.554. D = 82 / 115 = 0.713.

Salicylic acid is a substructure of aspirin, yet the score is only moderate. The 33 extra bits from aspirin's acetyl ester count against it. Tanimoto penalises size differences, which is useful when you want close analogues of the same size.

Tanimoto is symmetric: A vs B gives the same value as B vs A. Identical fingerprints give exactly 1.

What a Tanimoto score means

0.85 to 1.00Very similar. Close analogues, or the same molecule at 1.00.
0.70 to 0.85Similar. Shared core with one or two different groups.
0.50 to 0.70Moderately similar. Some shared fragments, different scaffold or substituents.
0.30 to 0.50Weakly similar. Only a ring or a functional group in common.
Below 0.30Dissimilar.

These cut-offs fit the 512-bit fragment fingerprint used here. With a circular fingerprint such as ECFP4, scores for the same pair are often lower, and 0.4 can already mean a related compound. Never mix scores from two fingerprints in one table.

SMARTS basics for substructure search

A plain SMILES is already a query: c1ccccc1 finds every benzene ring. Square brackets add conditions to one atom.

#7Atomic number 7: any nitrogen, aromatic or not.
c / CAromatic carbon / aliphatic carbon.
H1, !H0Exactly one hydrogen / at least one hydrogen.
X3, D2Three connections in total (H included) / two heavy-atom neighbours.
R, R0, r5In a ring / not in a ring / in a 5-membered ring.
, ; !Or / and / not. [F,Cl,Br,I] is any halogen.
- = # : ~Single, double, triple, aromatic and any bond.

Common patterns:

  • Carboxylic acid: [CX3](=O)[OX2H1]
  • Ester: [#6][CX3](=O)[OX2][#6]
  • Primary alkyl amine: [NX3;H2][CX4]
  • Aromatic halide: c[F,Cl,Br,I]
  • Lipinski H-bond donor: [#7,#8;!H0]. Lipinski H-bond acceptor: [#7,#8]

The tool does not support recursive SMARTS written with $( ) or dot-separated queries yet. Rewrite such conditions with neighbour atoms.

How to use the MolDraw similarity and substructure tool

  1. Open the molecular similarity and substructure search page. The Similarity tab is open.
  2. Type SMILES into Molecule A (SMILES) and Molecule B (SMILES) and press Compare. To draw instead, choose Molecule A or Molecule B next to Drawing fills and draw in the editor. Press an example such as Morphine vs codeine to try it.
  3. Read the Tanimoto and Dice scores, the verdict and the coloured bar. The table shows a, b and c, so you can check the arithmetic. Shaded atoms are the largest common substructure.
  4. To rank many molecules, paste one SMILES per line (a name after the SMILES is optional) under Rank a list against Molecule A and press Rank list. Save the table with Download CSV.
  5. For pattern search, open Substructure search. Type a query or press a cheat sheet button, paste your targets and press Search. Tick Show only molecules that match to hide the rest.

Worked examples

Example 1: paracetamol vs phenacetin

Phenacetin (CCOc1ccc(NC(C)=O)cc1) has an ethoxy group where paracetamol has OH. Tanimoto = 0.846, Dice = 0.917. Verdict: similar, just below the very similar line. The shared core is the whole acetanilide unit.

Example 2: ranking NSAIDs against ibuprofen

Press Example: NSAIDs vs ibuprofen. Naproxen ranks first (0.711), then ketoprofen (0.691) and flurbiprofen (0.681). All three are 2-arylpropionic acids. Diclofenac scores 0.336, and caffeine is last at 0.106.

Example 3: which drugs are carboxylic acids?

Query [CX3](=O)[OX2H1] on the 9 example drugs: 6 of 9 match. Paracetamol, celecoxib and caffeine do not. Each acid group is shaded in the drawing.

Example 4: Lipinski donors in paracetamol

Query [#7,#8;!H0] on CC(=O)Nc1ccc(O)cc1 gives 2 matches: the amide N–H and the phenol O–H. The acceptor query [#7,#8] gives 3: N, the C=O oxygen and the OH oxygen.

Example 5: enantiomers

L-alanine vs D-alanine gives Tanimoto 1.000. The tool adds a note that the two differ only in stereochemistry.

Summary table

Aspirin vs salicylic acidT = 0.554, D = 0.713, moderately similar
Paracetamol vs phenacetinT = 0.846, similar
Morphine vs codeineT = 0.944, very similar
Ibuprofen vs naproxenT = 0.711, similar
Benzene vs cyclohexaneT = 0.000, dissimilar
Carboxylic acid SMARTS[CX3](=O)[OX2H1]
Donor and acceptor SMARTS[#7,#8;!H0] and [#7,#8]

Common mistakes

  • Comparing scores from different fingerprints. A 0.6 on one fingerprint is not a 0.6 on another.
  • Expecting stereoisomers to differ. 2D fingerprints ignore stereo.
  • Reading similarity as activity. One changed atom can switch a drug off.
  • Leaving out hydrogens in a query. C(=O)O also matches esters. Use [OX2H1] for an acid OH.
  • Mixing up c and C. C1CCCCC1 is cyclohexane and does not match benzene.
  • Forgetting salts and charges. A carboxylate [O-] does not match an OH query.

Questions and answers

What is a good Tanimoto similarity score?

On the 512-bit fragment fingerprint used in the MolDraw tool, 0.85 or more means very similar, 0.70 to 0.85 similar, 0.50 to 0.70 moderately similar, 0.30 to 0.50 weakly similar and below 0.30 dissimilar. The cut-offs change with the fingerprint, so only compare scores from one method.

How do you calculate the Tanimoto coefficient?

Count the bits set in molecule A (a), in molecule B (b) and in both (c). Tanimoto = c / (a + b − c). For aspirin (a = 74) and salicylic acid (b = 41) with c = 41, Tanimoto = 41 / 74 = 0.554.

Is Tanimoto similarity the same as Dice similarity?

No. Both use the same counts, but Dice = 2c / (a + b). Dice is always equal to or higher than Tanimoto, and the two are linked by Dice = 2T / (1 + T). A Tanimoto of 0.554 is a Dice of 0.713.

Why does the tool give 1.000 for two different molecules?

The fingerprint stores connectivity, not 3D shape. Enantiomers, diastereomers and E/Z isomers have the same fragments, so they score 1.000. The tool shows a note when two inputs differ only in stereochemistry.

What is the difference between SMILES and SMARTS?

SMILES describes one molecule. SMARTS describes a pattern that many molecules can contain. Every SMILES is a valid SMARTS, but SMARTS adds conditions such as H1 (one hydrogen), X3 (three connections), R (in a ring) and logic with comma (or), semicolon (and) and exclamation mark (not).

How do I find all carboxylic acids in a list of molecules?

Open the Substructure search tab, press Carboxylic acid in the cheat sheet to load [CX3](=O)[OX2H1], paste your SMILES list and press Search. In the example set of 9 drugs, 6 match: ibuprofen, naproxen, ketoprofen, flurbiprofen, diclofenac and aspirin.

Can I count hydrogen bond donors with SMARTS?

Yes. The pattern [#7,#8;!H0] matches each nitrogen or oxygen that carries at least one hydrogen, which is the Lipinski donor count. Paracetamol gives 2 matches and the acceptor pattern [#7,#8] gives 3.

Does a high similarity mean two molecules have the same activity?

Not always. Similar molecules often share activity, which is why similarity search is used to find analogues. But a single change, such as one methyl group or one stereocentre, can remove the activity. Treat the score as a guide, not proof.

Related tools

Related guides

Last updated: