logP vs logD, lipophilicity with and without ionisation
logP describes the neutral molecule only. logD counts every charge state at a stated pH, so for acids and bases logD at pH 7.4 is often far below logP.
logP is the octanol-water partition coefficient of the neutral form of a molecule, on a log10 scale. logD is the same ratio measured with every species present at a stated pH, charged forms included. For a molecule that cannot ionise, the two numbers are equal at any pH. For an acid or a base, logD at pH 7.4 can sit several units below logP, and that gap changes what you should expect for solubility, permeability and clearance.
What logP measures
Shake a compound between 1-octanol and water until it reaches equilibrium. The ratio of its concentration in octanol to its concentration in water is the partition coefficient P. Chemists report log10 P because values span many orders of magnitude. A logP of 3 means a thousand times more compound in the octanol layer than in the water layer.
The definition applies to one species, the neutral molecule. Octanol stands in for the lipid interior of a membrane, and the neutral form is the species that crosses membranes most easily. logP is therefore a property of a structure and does not depend on pH. It is the number most calculators return, including the Wildman and Crippen method that RDKit implements as MolLogP. That method sums contributions from classified atom types, fitted to measured logP values of neutral molecules.
What logD adds
Most drugs carry an acidic or a basic group. At a given pH, part of the compound is neutral and part is charged. The charged species stays almost entirely in the water layer. logD, the distribution coefficient, takes the total concentration of all species in octanol and divides it by the total in the aqueous buffer. It always comes with a pH, written as a suffix, as in logD7.4.
Three cases cover most molecules:
- A neutral compound, such as caffeine across the physiological range, has logD equal to logP at every pH.
- An acid loses apparent lipophilicity as the pH rises above its pKa, because more of it becomes an anion.
- A base loses apparent lipophilicity as the pH falls below its pKa, because more of it becomes a cation.
Zwitterions carry both groups and show a logD maximum near the pH where the neutral or zwitterionic form dominates. The guide to pKa and ionisation explains how to read those charge states.
The equation that links logP and logD
If only the neutral form partitions into octanol, the Henderson-Hasselbalch relation gives logD directly. For a monoprotic acid:
logD = logP - log10(1 + 10^(pH - pKa))
For a monoprotic base, where pKa refers to the protonated form:
logD = logP - log10(1 + 10^(pKa - pH))
Beyond the pKa, each pH unit lowers logD by about one unit. At a pH equal to the pKa, half the compound is neutral and logD is logP minus 0.30. The equation breaks down far from the pKa. There, ion pairs with buffer counter-ions begin to enter octanol, and measured logD levels off instead of falling forever. Treat very negative calculated values with suspicion.
How to calculate logD for ibuprofen
Ibuprofen is a carboxylic acid. Carboxylic acids usually have pKa values between about 4 and 5, so take 4.5 as an illustrative value. RDKit gives a calculated logP of 3.07 for the neutral structure. The snippet below combines the two.
import math
from rdkit import Chem
from rdkit.Chem import Crippen
mol = Chem.MolFromSmiles("CC(C)Cc1ccc(cc1)C(C)C(=O)O")
logp = Crippen.MolLogP(mol) # 3.07 for neutral ibuprofen
pka = 4.5 # illustrative value for a carboxylic acid
def logd_acid(logp, pka, ph):
return logp - math.log10(1 + 10 ** (ph - pka))
for ph in (1.5, 6.5, 7.4):
print(ph, round(logd_acid(logp, pka, ph), 2))
# 1.5 3.07
# 6.5 1.07
# 7.4 0.17
In the acidic stomach, ibuprofen is almost entirely neutral and logD equals logP. At pH 6.5, a value found in the small intestine, logD has dropped by two units. In plasma at pH 7.4, about 0.13 % of the molecule is neutral and logD is close to zero. The same molecule behaves like a lipophilic compound in one compartment and a polar one in another.
Common mistakes with calculated logP
- Calculating
MolLogPon the charged SMILES. RDKit returns 1.74 for the ibuprofen carboxylate, which is neither its logP nor its logD7.4. Atom-contribution methods were fitted on neutral molecules. - Comparing values from different calculators as if they shared one scale. Methods disagree, sometimes by more than a unit for the same drug, so rank a series with one method throughout.
- Reading logP as the lipophilicity a cell sees. For ionisable series, logD at the relevant pH is the number that tracks permeability, protein binding and metabolic clearance.
- Ignoring pKa uncertainty. When the pKa sits two or more units from the working pH, an error of one unit in pKa moves logD by about one unit.
Physics-based methods offer another route. COSMO-RS computes partition coefficients from σ-profiles, the surface-charge distributions of molecules, and a guide to COSMO-RS explains the approach. σ-profiles for individual molecules are made by MFsig.
Why the distinction changes decisions
Lipophilicity pushes aqueous solubility down and membrane permeability up. It also tracks plasma protein binding, metabolic turnover and off-target promiscuity. For a neutral series, logP captures most of this. For an acidic or basic series, two analogues with the same logP can differ by a unit in logD7.4 when their pKa values differ, and they will behave differently in assays. The guide to aqueous solubility in drug discovery shows how ionisation also raises solubility.
Molecule Analysis shows an RDKit property profile for any compound entered by name, PubChem CID or SMILES. Pair its calculated values with a measured or predicted pKa before you reason about behaviour at a given pH.
Key points
- logP describes the neutral species only and does not depend on pH.
- logD counts all species at a stated pH and equals logP only for compounds that do not ionise.
- For a monoprotic acid or base, logD falls by about one unit per pH unit beyond the pKa, until ion-pair partitioning takes over.
- Never run an atom-contribution logP on a charged structure and call the result logD.
- For ionisable series, compare compounds by logD at the pH that matters, with one calculation method throughout.
Questions people ask
- What is the difference between logP and logD?
- logP is the log of the octanol to water concentration ratio for the neutral species only. logD uses the total concentration of all species, neutral and ionised, at a stated pH. For a molecule that cannot ionise the two values are equal, while for acids and bases logD is lower whenever a charged form is present.
- How do you calculate logD from logP and pKa?
- For a monoprotic acid, logD equals logP minus log10 of the quantity 1 plus 10 raised to pH minus pKa. For a monoprotic base the exponent becomes pKa minus pH. The formula assumes only the neutral form enters octanol, so it overstates the drop far from the pKa, where ion pairs start to partition.
- Is RDKit MolLogP a logD?
- No. RDKit MolLogP is the Wildman-Crippen atom-contribution estimate of logP for the structure you give it. Running it on a charged SMILES does not produce a logD. To estimate logD you combine a neutral logP with a pKa through the ionisation equation, or you measure it.
- Which pH is used for logD?
- pH 7.4 is the usual reference because it matches blood plasma, and the value is written logD7.4. Teams that study oral absorption also report logD at the slightly acidic pH of the small intestine, because the charge state of acids and bases changes along the gut.
Further reading
- Wikipedia, Partition coefficient
- Wildman and Crippen, Prediction of physicochemical parameters by atomic contributions (1999)
- RDKit, rdkit.Chem.Crippen module documentation
In practice: The ADMET dashboard computes the RDKit property profile and the Lipinski flags for any compound; the numbers in these guides are the ones it shows.