MolBasis
logplogdpkaqsprlipophilicity5 min read

logP versus logD as QSPR targets and which one to model

logP describes the neutral molecule and logD all its forms at a stated pH. They differ by pKa and pH, and a dataset that mixes them teaches a model neither.

Updated November 28, 2026

logP is the partition coefficient of the neutral molecule, and logD is the distribution coefficient of all of its forms, neutral and ionised, at a stated pH. For a molecule with no ionisable group they are the same number. For an acid or a base they differ by an amount set by pKa and pH, which can reach several log units, so a QSPR model has to know which of the two its dataset holds before anyone fits anything.

Two definitions that agree only for neutral molecules

logP is log10 of the ratio of the neutral species' concentration in water-saturated octanol to its concentration in water. logD at a given pH is log10 of the ratio of total concentration in octanol to total concentration in water, where total means all ionisation states together. The logP primer gives the measurement background for both.

If ions do not partition into octanol at all, the relation between the two is exact. For a monoprotic acid, logD = logP − log(1 + 10^(pH − pKa)). For a monoprotic base, logD = logP − log(1 + 10^(pKa − pH)), with pKa that of the conjugate acid. Ion pairs do partition a little, so in practice logD flattens out a few log units below logP rather than falling without limit.

A worked example with a base

Take a base with pKa 9.0 and logP 3.0, measured at pH 7.4. The exponent is 9.0 − 7.4 = 1.6, so 10^1.6 = 39.8, the correction is log(40.8) = 1.61, and logD at 7.4 is 3.0 − 1.61 = 1.39. At pH 5.0 the exponent is 4.0, the correction is log(10001) = 4.00, and logD is −1.0. Move the pH by 2.4 units and the value moves by 2.4 units. The same compound can therefore appear in the literature as 3.0, 1.4 or −1.0, all of them correct.

import math

def logd(logp, pka, ph, acid):
    expo = (ph - pka) if acid else (pka - ph)
    return logp - math.log10(1.0 + 10 ** expo)

print(round(logd(3.0, 9.0, 7.4, acid=False), 2))  # 1.39
print(round(logd(3.0, 9.0, 5.0, acid=False), 2))  # -1.0

Why a mixed dataset teaches a model the wrong chemistry

Suppose a compilation contains logP for most compounds and logD at 7.4 for the subset that came from a pharmaceutical source. The label noise is not random. It is concentrated on acids and bases, and it always points in one direction, downward. A model fitted on the mixture learns that carboxylic acids and amines lower lipophilicity by more than they do, and it learns it with confidence, because the pattern is consistent. The structure of the molecule and the value of the label disagree in a way that the model attributes to the structure.

The same compound can also appear twice with values two log units apart, which looks like a measurement conflict. The guide on duplicates and conflicting measurements shows how to detect these pairs and what to do with them. The guide on pKa and property prediction covers the descriptor side, where a charged structure produces different numbers from the neutral one.

Which one to model

Model logP when the goal is to understand or predict the physics of the neutral molecule. Descriptors from a quantum-chemical calculation on the neutral structure, such as the polar solvation energy and the surface charge moments that mfsig computes, describe the neutral molecule and nothing else. Model logD at a stated pH when the goal is a pharmacokinetic or environmental quantity at that pH, and then either give the model a pKa or fraction-ionised input, or build it as a logP model plus a pKa model and verify each part separately. The second route has the advantage that an error can be traced to one half.

Three habits keep the two apart.

  1. Store the pH with every lipophilicity value, and store a flag for the species measured.
  2. Treat a value with no pH as logP only if the compound has no ionisable group, otherwise mark it uncertain.
  3. Report which quantity the model predicts in the first sentence of the model card.

What the MolBasis logP kernels target

MolBasis publishes three logP kernels, fitted on the Sangster compilation, the Llinas solubility challenge set and an aqueous cosolvent set. Their pages at /kernels/sangster-logp, /kernels/llinas-logp and /kernels/aqueous-logp each state the held-out Pearson r on a 25 % scaffold-blind split and the number of held-out molecules behind it. All three target the neutral-species logP, and the descriptors were computed on the neutral structure as given in the SMILES. The kernels have no pKa input and cannot describe a logD. There is no external validation set, no comparison with another method on the same molecules, and the coefficients are not published. The guide on reporting a QSPR result honestly lists what a report should say about its target, and the quantity modelled is the first item on it.

Key points

  • logP describes the neutral molecule and logD describes all species at a stated pH. They coincide only for non-ionisable compounds.
  • For a base with pKa 9.0 and logP 3.0, logD is 1.39 at pH 7.4 and −1.0 at pH 5.0.
  • A dataset that mixes logP and logD puts systematic, one-directional noise on acids and bases, and a model learns it as chemistry.
  • Model logP for physics and descriptors, logD for pharmacology, and in the second case give the model a pKa input or build it in two parts.
  • The MolBasis logP kernels target neutral-species logP and have no pKa input.

Questions people ask

What is the difference between logP and logD?
logP is the base-10 logarithm of the octanol-water partition coefficient of the neutral form of a molecule. logD is the same ratio for all ionisation states together at a stated pH. They are equal for molecules with no ionisable group and differ by log(1 + 10^(pH − pKa)) for a monoprotic acid.
How do you convert logP to logD at pH 7.4?
For an acid, logD = logP − log(1 + 10^(pH − pKa)). For a base, logD = logP − log(1 + 10^(pKa − pH)) with pKa that of the conjugate acid. A base with pKa 9.0 and logP 3.0 has logD of about 1.39 at pH 7.4 and −1.0 at pH 5.0, assuming ions do not partition.
Should a QSPR model predict logP or logD?
Predict logP when the goal is the physics of the neutral molecule, which is what quantum-chemical descriptors on a neutral structure describe. Predict logD at a stated pH for pharmacokinetic or environmental use, and then give the model a pKa input or build it as a logP model plus a pKa model so that errors can be traced to one part.

Further reading

In practice: Each property here has a kernel page that states the equation shown, its held-out result on the scaffold-blind split and the number of molecules it rests on. The guides explain the property; the kernel page carries the figures and their caveats.

See the kernels themselves

Every kernel is shown with its held-out result, the number of molecules it rests on and what it cannot be trusted for.