MolDraw › Chemistry tools › Molecular Similarity and Substructure Search

Molecular Similarity and Substructure Search

In short: Paste or draw two molecules to get their Tanimoto and Dice similarity, a verdict and the largest common substructure. Or search one or many molecules for a SMILES or SMARTS pattern and see the matched atoms highlighted.

Use it to check how close an analogue is to a lead compound, rank a list of molecules against a reference, or find which molecules contain a carboxylic acid, an aromatic halide or a hydrogen bond donor. Scores use a 512-bit substructure-fragment fingerprint, the same one as the Compare molecules plugin in the MolDraw editor.

Quick answer: Aspirin (CC(=O)Oc1ccccc1C(=O)O) and salicylic acid (OC(=O)c1ccccc1O) set 74 and 41 fingerprint bits and share all 41, so Tanimoto = 41 / (74 + 41 − 41) = 0.554 (moderately similar) and Dice = 82 / 115 = 0.713. The SMARTS [CX3](=O)[OX2H1] finds one carboxylic acid in each.
Drawing fills:

Loading editor…

Example pairs:

Loading…

Loading…

Rank a list against Molecule A

Paste one SMILES per line, optionally followed by a name. Every molecule is scored against Molecule A and sorted from most to least similar.

How to use the similarity and substructure tool

  1. Similarity: type or paste SMILES for Molecule A and Molecule B and press Compare. To draw instead, pick Molecule A or Molecule B above the editor and draw.
  2. Read the Tanimoto and Dice scores, the verdict and the bar. The shaded atoms in both drawings are the largest common substructure.
  3. Rank a list: paste many SMILES under Rank a list against Molecule A and press Rank list. Save the table with Download CSV.
  4. Substructure search: open the Substructure search tab, type a query or pick one from the cheat sheet, paste the targets and press Search. Each match is shaded in its own colour.

How Tanimoto similarity works

A fingerprint is a list of bits. This tool uses a 512-bit fingerprint in which each bit is one small fragment from a fixed dictionary of common substructures, such as a carbonyl next to an oxygen or an aromatic ring carbon next to a nitrogen. A bit is on (1) when the molecule contains that fragment.

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

Here a is the number of bits on in A, b in B, and c in both. T = 1 means identical fingerprints; T = 0 means no shared bit. Tanimoto is symmetric: comparing A with B gives the same number as B with A.

Worked count example

Aspirin sets a = 74 bits and salicylic acid b = 41. All 41 salicylic acid bits are also on in aspirin, so c = 41. T = 41 / (74 + 41 − 41) = 41 / 74 = 0.554. D = 2 × 41 / (74 + 41) = 82 / 115 = 0.713. The score is only moderate because aspirin has many extra bits from its acetyl ester.

Verdict scale used here

TanimotoVerdictWhat it usually means
0.85 to 1.00Very similarClose analogues, or identical (1.00)
0.70 to 0.85SimilarShared core, one or two different groups
0.50 to 0.70Moderately similarSome shared fragments, different scaffold or substituents
0.30 to 0.50Weakly similarOnly a ring or a functional group in common
below 0.30DissimilarLittle in common

Cut-offs depend on the fingerprint. The same pair can score quite differently with a circular fingerprint such as ECFP4. Compare scores from the same method only.

SMARTS basics and cheat sheet

SMARTS is a pattern language built on SMILES. A plain SMILES is already a valid query. Square brackets add conditions to one atom:

GroupSMARTSMatchesDoes not match
Carboxylic acid[CX3](=O)[OX2H1]acetic acid, aspirinmethyl acetate, acetate anion
Carboxylate anion[CX3](=O)[O-]sodium acetateacetic acid
Ester[#6][CX3](=O)[OX2][#6]ethyl acetate, aspirinacetic acid
Amide[NX3][CX3]=Oparacetamol, peptide bondsacetic acid
Primary amine (alkyl)[NX3;H2][CX4]ethylamine, amphetamineacetamide, aniline
Secondary amine (alkyl)[NX3;H1]([CX4])[CX4]diethylamineethylamine
Aromatic amine (aniline)[NX3;H2]canilineethylamine
Alcohol[CX4][OX2H]ethanolphenol
Phenolc[OX2H]phenol, paracetamolethanol
Aldehyde[CX3H1](=O)[#6]acetaldehyde, vanillinacetone
Ketone[#6][CX3](=O)[#6]acetoneacetaldehyde
Aromatic halidec[F,Cl,Br,I]chlorobenzene, diclofenacchloroethane
Alkyl halide[CX4][F,Cl,Br,I]chloroethanechlorobenzene
Nitro group[N+](=O)[O-]nitrobenzeneacetonitrile
Nitrile[CX2]#[NX1]acetonitrileethylamine
Sulfonamide[SX4](=O)(=O)[NX3]sulfanilamide, celecoxibdimethyl sulfone
Thiol[SX2H]ethanethiol, cysteinedimethyl sulfide
Benzene ringc1ccccc1toluenepyridine
Any 6-membered aromatic ringa1aaaaa1pyridine, benzenecyclohexane
Lipinski H-bond donor[#7,#8;!H0]each OH and NH (count the matches)diethyl ether
Lipinski H-bond acceptor[#7,#8]every N and O atompropane
Atom in a 5-membered ring[r5]cyclopentane, furancyclohexane
Carbon not in a ring[C;R0]propanecyclohexane

Not supported yet: recursive SMARTS written with $( ) and dot-separated queries. Stereo marks such as @ in a query are ignored.

Worked examples

Paracetamol vs phenacetin

Phenacetin has an ethoxy group where paracetamol has OH. Same acetanilide core.

Tanimoto 0.846, Dice 0.917: similar

Morphine vs codeine

Codeine is morphine with the phenol OH methylated. One extra ether.

Tanimoto 0.944: very similar

Ibuprofen vs naproxen

Both are 2-arylpropionic acids, but naproxen has a methoxynaphthalene instead of an isobutylbenzene.

Tanimoto 0.711: similar

Benzene vs cyclohexane

Both are C6 rings, but aromatic and aliphatic bonds give different fragments.

Tanimoto 0.000: dissimilar

Which NSAIDs are carboxylic acids?

Query [CX3](=O)[OX2H1] on the 9 example drugs.

6 of 9 match: ibuprofen, naproxen, ketoprofen, flurbiprofen, diclofenac, aspirin

Lipinski donors in paracetamol

Query [#7,#8;!H0] finds the amide N–H and the phenol O–H.

2 matches: HBD = 2

Common mistakes

Comparing analogues in your own drawings? Open MolDraw, the free online structure editor, and use the Compare molecules plugin to score and align analogues next to your sketch.

Open MolDraw editor

Frequently asked questions

What is Tanimoto similarity?

Tanimoto similarity compares two molecular fingerprints. It is c / (a + b − c), where a and b are the bits set in each molecule and c is the bits set in both. It runs from 0 (nothing shared) to 1 (identical fingerprints).

What Tanimoto value means two molecules are similar?

On this tool's 512-bit fragment fingerprint, 0.85 or more is very similar, 0.70 to 0.85 is similar, 0.50 to 0.70 is moderately similar and below 0.30 is dissimilar. Cut-offs depend on the fingerprint, so compare scores from the same method only.

What is the difference between Tanimoto and Dice similarity?

Both use the same bit counts. Dice is 2c / (a + b), so it gives more weight to shared bits and is always equal to or higher than Tanimoto. For a = 74, b = 41 and c = 41, Tanimoto is 0.554 and Dice is 0.713.

Why do two enantiomers get a Tanimoto score of 1?

The fingerprint records which atoms and bonds are connected, not their 3D arrangement. L-alanine and D-alanine have the same fragments, so the score is 1.000. The tool tells you when two inputs differ only in stereochemistry.

What is SMARTS?

SMARTS is a pattern language based on SMILES for describing substructures. For example, [CX3](=O)[OX2H1] means a carbon with three connections, double bonded to O and single bonded to an OH, which is a carboxylic acid.

Can I use a SMILES string as a substructure query?

Yes. A SMILES query matches any molecule that contains those atoms and bonds. Hydrogens are not required, so C(=O)O matches both acids and esters. Use [OH] or [OX2H1] when the hydrogen matters.

How do I count Lipinski hydrogen bond donors with SMARTS?

Search with [#7,#8;!H0]. It matches every nitrogen or oxygen that carries at least one hydrogen, and the number of matches is the donor count. Paracetamol gives 2: the amide NH and the phenol OH.

Is the similarity and substructure search tool free?

Yes. It is free, needs no sign-up and runs in your web browser. Your molecules are not uploaded.

Related chemistry tools

Last updated: