How to predict pKa online for free

Draw a molecule and see how it ionizes at pH 7.4

13 min

Lidocaine in its protonated and neutral forms at either end of a protonation curve, with the ionizable amine nitrogen highlighted and pH 7.4 marked.

To predict pKa online for free, draw the molecule in SketchIQ, the free chemical structure drawer by ProteinIQ, or search for it by name, then click Predict pKa in the details panel. The drawer runs MolGpKa, a graph neural network, in your browser and lists a pKa for every acidic and basic site it recognizes. Type a pH and it also gives the net charge, the major form and logD at that pH.

For lidocaine, the local anesthetic, the result looks like this:

Text
Lidocaine, predicted in SketchIQ
Acidic N-H (amide)          13.9
Basic N (tertiary amine)     7.6
Basic N (amide)              5.2
At pH 7.4: net charge +1, logD 2.17
61% protonated, 38% neutral

The measured pKa of lidocaine's amine is 7.94, so the prediction is 0.34 units low. That is a typical error. MolGpKa was trained on pKa values that ACD/Labs software calculated for 1.6 million ChEMBL compounds, not on measurements,[1] and we tested it below on 27 drugs with measured values to show where it holds and where it breaks.

Why pKa matters for a drug

A pKa is the pH at which a site is half ionized. For an acid, the share in the charged form at a given pH follows from the Henderson-Hasselbalch equation:

fionized=11+10 pKa−pHf_{\text{ionized}} = \frac{1}{1 + 10^{\,\mathrm{p}K_a - \mathrm{pH}}}

For a base the exponent flips to pH−pKa\mathrm{pH} - \mathrm{p}K_a. Every pH unit away from the pKa multiplies the ratio of the two forms by ten, so a site two units from the pH is 99% in one form. Blood plasma sits at pH 7.4, so aspirin (pKa 3.5) circulates almost entirely as its carboxylate and propranolol (pKa 9.45) almost entirely as its ammonium ion.

pH minus pKaAcid ionizedBase protonated
-21%99%
-19%91%
050%50%
+191%9%
+299%1%
Table 1. How far the pH sits from the pKa decides the charge. Shares calculated from the Henderson-Hasselbalch equation.

That matters because charge pulls two properties in opposite directions. Ionized molecules dissolve in water far better, while the neutral form is the one that crosses lipid membranes. The balance shows up in logD, the octanol-water partition at a given pH, and through it in absorption, distribution, metabolism, toxicity and the choice of salt for a formulation.[4]

Most drugs have at least one site in play. In a set of 582 drugs with measured pKa values, Manallack found that 45.4% had a single basic group and 24.4% a single acid. Of the WHO essential medicines, 65.1% carried a group ionizable between pH 2 and 12.[3]

The brain is stricter still: among the CNS drugs in that set, only one acid had a pKa below 6.1 and no base had one above 10.5, because molecules that stay charged at pH 7.4 cross the blood-brain barrier poorly.[3]

How computational pKa prediction works

Software estimates pKa in three ways. Empirical programs such as ACD/Labs break a molecule into fragments, look up the pKa of the ionizable group and correct it with Hammett-type equations for its substituents. Quantum mechanical methods compute the free energy of losing a proton in solvent, which adapts to unfamiliar chemistry but is slow. Machine learning models learn the substituent effects from data.[3]

MolGpKa is the third kind. It first finds each ionizable site with a library of substructure patterns, then passes the whole molecular graph through a graph convolutional network with that site marked and every atom tagged with its distance from it, one network for acids and one for bases.[1][5]

Each value is a microscopic pKa: the pKa of that site in the neutral molecule, with every other site uncharged. Only the most acidic and most basic value of each training compound was used, so the model has seen far fewer second and third sites.[2]

That matters for molecules with several sites, because measured constants are macroscopic: once nicotine's pyrrolidine nitrogen takes a proton, the pyridine nitrogen finds it harder to take a second one. A per-site prediction for the neutral molecule cannot see that, and the drawer's forms and their shares treat each site on its own.

How accurate is pKa prediction?

The fairest test of a pKa model is on measured values it was not built from. Mayr and colleagues ran MolGpKa on two experimental sets alongside the commercial programs Epik and Marvin.[2] On 280 molecules measured at Novartis, the three programs had mean errors within 0.04 units of each other.

ModelNovartis set MAENovartis set RMSELiterature set MAELiterature set RMSE
MolGpKa0.871.270.491.00
Epik0.831.160.580.92
Marvin 20.10.861.170.570.87
pkasolver (pretrained on Epik predictions, fine-tuned on measured values)0.710.930.520.82
Table 2. Error of pKa predictors on measured values. MAE is the mean absolute error and RMSE the root mean square error, both in pKa units. Epik was scored on 254 of the 280 Novartis molecules. Source: Mayr et al. (2022).[2]

On the literature set of 123 simpler molecules, MolGpKa's MAE drops to 0.49, but its RMSE is 1.00, and Mayr and colleagues trace the wide uncertainty on that figure to a single molecule, N-methylethylamine, missed by 8.86 units.[2] That is the pattern to expect from any predictor: usually within half a unit, occasionally wrong by several.

We tested 27 drugs in SketchIQ

We ran the drawer's own code on 27 common drugs and compared each main site with the measured pKa values PubChem lists for it from ChEMBL, DrugBank and the Hazardous Substances Data Bank.[7] Where PubChem lists several values we took their median. Across the 27 main sites, the MAE was 0.49 and the RMSE 0.66 pKa units; 16 predictions fell within 0.5 units and 24 within 1.0. Acids (MAE 0.47) and bases (0.50) did equally well.

DrugSiteMeasuredValues listedPredictedError
AspirinCarboxylic acid3.504 (3.47 to 3.50)3.39-0.10
Salicylic acidCarboxylic acid2.934 (2.78 to 2.98)2.97+0.05
FurosemideCarboxylic acid3.656 (3.50 to 3.90)2.98-0.67
DiclofenacCarboxylic acid4.156 (3.99 to 4.30)4.09-0.06
NaproxenCarboxylic acid4.153 (4.15 to 4.18)4.42+0.27
IbuprofenCarboxylic acid5.064 (4.45 to 5.30)4.40-0.65
WarfarinEnol OH5.442 (5.00 to 5.87)4.48-0.96
SulfamethoxazoleSulfonamide NH5.7017.02+1.32
CiprofloxacinCarboxylic acid6.134 (6.09 to 6.25)6.79+0.67
PhenobarbitalBarbiturate NH7.3027.37+0.07
PhenytoinHydantoin NH8.3328.18-0.15
ParacetamolPhenol9.38110.10+0.72
CaffeineImidazole N0.7012.38+1.68
CimetidineImidazole N6.8026.70-0.10
LidocaineTertiary amine7.945 (7.86 to 8.01)7.60-0.34
NicotinePyrrolidine N8.113 (8.10 to 8.50)8.32+0.21
MorphineTertiary amine8.204 (8.18 to 8.21)8.03-0.17
CodeineTertiary amine8.203 (8.20 to 10.60)8.01-0.19
QuinineQuinuclidine N8.563 (8.55 to 9.70)9.28+0.72
HaloperidolPiperidine N8.656 (8.50 to 8.66)8.14-0.51
VerapamilTertiary amine8.923 (8.92 to 9.07)9.20+0.28
DiphenhydramineTertiary amine9.044 (8.98 to 9.10)8.28-0.76
AmitriptylineTertiary amine9.405 (8.20 to 9.49)9.33-0.07
ImipramineTertiary amine9.453 (9.40 to 9.51)9.48+0.03
PropranololSecondary amine9.453 (9.42 to 9.53)9.05-0.40
AtenololSecondary amine9.605 (9.54 to 9.60)9.12-0.48
MetforminBiguanide12.40210.86-1.54
CiprofloxacinPiperazine NH (secondary)8.682 (8.62 to 8.74)8.55-0.13
MorphinePhenol (secondary)9.8529.43-0.42
QuinineQuinoline N (secondary)5.0715.50+0.43
SulfamethoxazoleAniline NH2 (secondary)1.6014.13+2.53
NicotinePyridine N (secondary)3.041 (from pKb 10.96)6.03+2.99
Salicylic acidPhenol (secondary)13.6018.99-4.61
Table 3. SketchIQ pKa predictions against measured values. Measured values are medians of the values PubChem lists from ChEMBL, DrugBank and HSDB, with the count and range of those values. Predicted values to two decimals; the drawer shows one. Error is predicted minus measured. Secondary sites, below the main ones, are not counted in the averages. Sources: PubChem (2026), ProteinIQ analysis.[7]

The misses have reasons. Caffeine and metformin sit at the extremes of the pKa scale, where training compounds are scarce. Caffeine still comes out neutral at pH 7.4, as it should, but metformin comes out with a charge of +2: the drawer scores its two basic nitrogens separately, although they share one conjugated biguanide that takes a single proton at that pH.

Salicylic acid's phenol is held by a hydrogen bond to the neighboring carboxylate, which pushes its measured pKa to 13.6; the model puts it at 9.0. Nicotine's pyridine is off by 3 units because 3.04 is the macroscopic second constant, measured after the pyrrolidine is already protonated.

Read these numbers as optimistic. Drugs this well known are almost certainly in ChEMBL, so MolGpKa probably saw them in training, with calculated rather than measured labels. For a new scaffold from your own project, the Novartis figure of 0.87 MAE is the better guide, and measuring the pKa remains the answer when a decision depends on it.

How to predict pKa in SketchIQ

SketchIQ, a free ChemDraw alternative, needs no account, and the pKa prediction runs on your own computer: once the model has downloaded, no server is involved in it.

  1. Open SketchIQ.
  2. Draw the structure, or type a name, CAS number, PubChem CID, InChIKey or SMILES into the search box and pick a match.
  3. In the details panel, find the pKa, predicted row under the properties and click Predict. The first prediction downloads the 12 MB model; after that the drawer predicts every new structure on its own in that browser.
  4. Read the sites. Each row is labelled Acidic or Basic with the element that loses or gains the proton, followed by its pKa. Hover a row to see how much of that site is ionized at the current pH.
  5. Change the At pH box to any value from 0 to 14. Net charge, logD and the major form update; when several forms coexist, the drawer lists up to four with their share and charge instead. A small plot below shows logD from pH 0 to 14.
Figure 1. Lidocaine in SketchIQ after clicking Predict pKa. At pH 7.4 the drawer splits it into a protonated form (61%) and a neutral form (38%).

The step people get wrong is the starting structure. The drawer neutralizes charged structures before predicting, so glycine drawn as [NH3+]CC(=O)[O-] works, but it asks you to draw the neutral form when a zwitterion could be neutralized more than one way. For a salt such as lidocaine hydrochloride it predicts the largest fragment and says so under the results.

The model covers carbon, hydrogen, nitrogen, oxygen, sulfur, phosphorus and the halogens, up to 80 heavy atoms; boron and silicon compounds are declined.

The logD row combines the predicted forms with the drawer's calculated logP (cLogP). It counts the neutral form and any zwitterions and assumes charged forms stay in water. Ibuprofen, for example, goes from a cLogP of 3.07 to a logD of 0.07 at pH 7.4.

Other free ways to predict pKa

The MolGpKa web server from the model's authors takes a SMILES string and needs no login.[6] It runs the same networks as SketchIQ, so expect the same values, but there is no drawing canvas and no charge or logD at a chosen pH.

Chemicalize, Chemaxon's web app, has offered Marvin's pKa calculator for years. Certara has stopped renewing its subscriptions and will retire it on June 30, 2027, moving users to the paid Marvin Cloud.[8]

For batches, MolGpKa's own Python code is MIT licensed.[5] Its dependencies are old (PyTorch 2.1 with PyTorch Geometric 2.4 worked for us), and it is run from the repository's src folder:

Bash
cd MolGpKa/src
python -c "
from rdkit import Chem
from predict_pka import predict
base, acid = predict(Chem.MolFromSmiles('CCN(CC)CC(=O)NC1=C(C=CC=C1C)C'))
print('base:', base)
print('acid:', acid)
"
Text
base: {8: 5.1962066, 2: 7.5992785}
acid: {29: 13.872205}

The keys are atom indices in the molecule with hydrogens added, so acid sites point at the hydrogen that leaves. These are the same three lidocaine values the drawer shows.

Common mistakes when reading predicted pKa

ProblemSymptomFix
Taking every listed site at face valueParacetamol shows a basic N at 4.6 and lidocaine one at 5.2, both on an amide nitrogenAmide nitrogens are not meaningfully basic in water; ignore those rows
Reading per-site values as stepwise constantsCiprofloxacin comes out with both piperazine nitrogens protonated and a net charge of +1 at pH 7.4With measured pKa values of 6.1 and 8.7, ciprofloxacin is mostly a zwitterion with no net charge at pH 7.4. Treat the second site of a diamine, diacid or zwitterion as too high
Trusting the decimal near pH 7.4Lidocaine predicted at 7.60 is 38% neutral at pH 7.4; at its measured 7.94 it would be 22%When the pKa is within a unit of the pH you care about, an error of 0.3 changes the answer; measure it
Drawing an ambiguous zwitterion or a mixtureThe drawer asks for the neutral form, or predicts only the largest fragmentDraw the neutral parent molecule on its own
Expecting internal hydrogen bonds to countSalicylic acid's phenol predicted at 9.0 against a measured 13.6Be wary of sites held by an internal hydrogen bond

After you have the pKa

The ionization state is what the next tool needs. For docking, Dimorphite-DL enumerates the protonation states of a SMILES over a pH range, and you can take a drawn molecule to a docking result with SMILES to PDBQT and AutoDock Vina.

ADMET-AI predicts absorption, distribution and toxicity endpoints, Molecular descriptors adds TPSA and logP for many molecules at once, and Lipinski's rule of five puts those numbers in context. For ionizable residues in a protein rather than a small molecule, PROPKA predicts pKa from the 3D structure.

FAQ

What is a good pKa for a drug?

There is no single target. Among drugs with one basic group, most have a pKa above 6.5 and the values peak near 9; drugs with one acid split between carboxylic acids at low values and a second group, many of them barbiturates, around 8. Drugs meant for the brain avoid acids below about 6 and bases above 10.5, which stay charged at pH 7.4.[3]

What is the difference between pKa and pH?

pH describes the solution and pKa describes a site on the molecule. When the pH equals the pKa, that site is half ionized; each unit of difference shifts the ratio tenfold.

What is the difference between logP and logD?

logP is the partition of the neutral molecule between octanol and water. logD at a given pH includes all forms present, so for an ionizable drug it falls as the charged share rises. SketchIQ shows both: cLogP among the properties and logD in the pKa section.

Is MolGpKa trained on experimental pKa values?

No. It was trained on ACD/Labs predictions for 1.6 million ChEMBL compounds.[1] Its error on measured values is close to that of Epik and Marvin.[2]

Can I predict the pKa of amino acids in a protein?

Not with a small-molecule model. Residue pKa values depend on the protein's 3D environment; use PROPKA on a structure file instead.

Can I draw the molecule in another program first?

Yes. Paste its SMILES string into SketchIQ's search box, or open a MOL, SDF or ChemDraw CDX file in the drawer, then click Predict pKa.