pH Calculator

Calculate pH from molarity for acids and bases with visual scale

A pH calculator determines the acidity or alkalinity of a solution from its molarity. It applies the formula pH = -log[H+] for strong acids, pOH = -log[OH-] for strong bases, and the Ka or Kb equilibrium equations for weak acids and bases — instantly giving you pH, pOH, hydrogen ion concentration, and hydroxide ion concentration.

Solution Parameters

Auto-filled from compound selection. Override for custom Ka/Kb.

Common Substances pH Reference

Substance pH Range Classification
Battery acid0Very strong acid
Stomach acid (HCl)1–2Strong acid
Lemon juice2–3Acid
Vinegar2.5–3.5Acid
Orange juice3.5–4Weak acid
Black coffee5Mild acid
Rainwater (CO2)5.6Slightly acidic
Pure water7Neutral
Seawater8Slightly basic
Baking soda8.3Mild base
Milk of magnesia10.5Base
Bleach12–13Strong base
Drain cleaner (NaOH)13–14Very strong base

How to Use the pH Calculator

This pH calculator computes the pH, pOH, hydrogen ion concentration [H+], and hydroxide ion concentration [OH-] for acids and bases from their molarity. It handles both strong electrolytes (which fully dissociate) and weak electrolytes (which partially dissociate, requiring Ka or Kb equilibrium calculations).

Step 1: Select Acid or Base

Click the Acid or Base button to switch between the two modes. This updates the compound dropdown to show only acids or only bases, and changes whether the calculator uses Ka (acids) or Kb (bases) for weak electrolyte calculations.

Step 2: Choose Your Compound

Select a compound from the dropdown. Common strong acids include hydrochloric acid (HCl), sulfuric acid (H2SO4), and nitric acid (HNO3). Common weak acids include acetic acid (CH3COOH), citric acid, and carbonic acid. For bases, sodium hydroxide (NaOH) and potassium hydroxide (KOH) are strong, while ammonia (NH3) is weak. Selecting a compound auto-fills the Ka or Kb value. You can override this with a custom value if needed.

Step 3: Enter the Molarity

Type the molar concentration of the solution in mol/L. For example, a 0.1 M solution of HCl has 0.1 moles of HCl dissolved per liter of solution. The calculator accepts any positive value, but note that concentrations above about 1 M approach the limits of the simple pH formulas, which assume dilute solutions.

Step 4: Read the Results

After clicking Calculate, you will see pH, pOH, [H+], and [OH-] displayed as stat cards. The visual pH scale shows a colored gradient from red (highly acidic) through green (neutral) to purple (highly basic), with a marker positioned at your calculated pH. A badge below the scale classifies the solution as strongly acidic, moderately acidic, neutral, moderately basic, or strongly basic.

Understanding the Formulas

For strong acids: [H+] = molarity, pH = -log[H+]. For weak acids: [H+] = sqrt(Ka × C) using the simplified equilibrium approximation (valid when Ka is much smaller than C). For strong bases: [OH-] = molarity, pOH = -log[OH-], pH = 14 - pOH. For weak bases: [OH-] = sqrt(Kb × C), then pOH and pH are derived. At 25°C, pH + pOH = 14 always holds.

Frequently Asked Questions

Is this pH calculator free to use?

Yes, this pH calculator is completely free with no ads, no signup, and no limits. All calculations run locally in your browser using chemistry equations. No data is ever sent to a server.

Is my data safe when using this tool?

Absolutely. Every calculation happens entirely in your web browser. No information you enter is transmitted anywhere. Your data stays completely private on your device.

What is pH and what does the scale mean?

pH stands for 'potential of hydrogen' and measures how acidic or basic a solution is on a scale from 0 to 14. A pH below 7 is acidic (more H+ ions), pH 7 is neutral (pure water), and pH above 7 is basic or alkaline. Each step on the scale represents a 10-fold change in hydrogen ion concentration.

How is pH calculated from molarity?

For strong acids, pH = -log[H+] where [H+] equals the molarity. For strong bases, pOH = -log[OH-] and pH = 14 - pOH. For weak acids, the calculator uses the Ka equilibrium equation: [H+] = sqrt(Ka × C) to find the hydrogen ion concentration before applying the log formula.

What is the difference between strong and weak acids?

Strong acids (like HCl, H2SO4, HNO3) fully dissociate in water, so their H+ concentration equals their molarity. Weak acids (like acetic acid CH3COOH) only partially dissociate, producing fewer H+ ions — resulting in a higher (less acidic) pH than a strong acid at the same concentration.

What is Ka and where do I find it?

Ka is the acid dissociation constant — a measure of how readily an acid releases H+ ions. Larger Ka values mean stronger acids. Common weak acid Ka values are pre-filled in this calculator's dropdown menu. You can also enter a custom Ka value for any acid not listed.

Does this calculator work for bases too?

Yes. Select a base (NaOH, KOH, NH3, etc.) from the dropdown and enter its molarity. For strong bases, the calculator finds [OH-], computes pOH, then derives pH = 14 - pOH. For weak bases, it uses the Kb equilibrium equation to find [OH-] first.

What common substances appear on the pH reference table?

The reference table includes battery acid (pH 0), stomach acid (pH 1-2), lemon juice (pH 2-3), vinegar (pH 2.5-3.5), black coffee (pH 5), rainwater (pH 5.6), pure water (pH 7), baking soda (pH 8.3), seawater (pH 8), bleach (pH 12-13), and drain cleaner (pH 14).