Skip to content
ChemSolver

pH Calculator

Calculate pH, pOH, [H⁺], and [OH⁻] from strong or weak acid/base concentrations, mass and volume, or a conjugate buffer pair—complete with ICE tables, 5% rule checks, and water autoionization where needed.

Loading pH calculator…

pH, pOH, and Acid–Base Equilibrium Formulas

These standard aqueous chemistry formulas convert hydrogen and hydroxide ion concentrations into pH and pOH. At 25°C, Kw ≈ 1.0 × 10⁻¹⁴; at other temperatures, pKw changes.

TaskFormulaWhen to use it
pH from hydrogen ionspH = −log₁₀[H⁺]At 25°C, dilute-solution approximation
pOH from hydroxide ionspOH = −log₁₀[OH⁻]Concentrations in mol/L
Hydrogen ion from pH[H⁺] = 10⁻ᵖᴴInverse logarithm
Hydroxide ion from pOH[OH⁻] = 10⁻ᵖᴼᴴInverse logarithm
Water ion productKw = [H⁺][OH⁻] = 1.0 × 10⁻¹⁴Approximate value at 25°C
pH and pOHpH + pOH = pKw = 14.0025°C only
Acid strengthpKa = −log₁₀KaKa = 10^(−pKa)
Weak acid ICE approximationKa = x² / (C − x)Neglects water ions; check the 5% rule
Henderson–HasselbalchpH = pKa + log₁₀([A⁻]/[HA])Conjugate buffer, approximate

Strictly, pH is defined by hydrogen-ion activity. Concentration formulas are widely used in introductory chemistry for sufficiently dilute idealized solutions, but not as a guarantee of measured pH in concentrated electrolytes.

Which pH Formula or Calculator Mode Should You Use?

Start with what the problem actually provides. Ion concentration, initial acid/base molarity, Ka or Kb, and buffer composition answer different questions and require different equations.

What you knowUse this modelEquation and limitation
You know pH, pOH, [H⁺], or [OH⁻]pH / pOH / Ion Conversion

pH = −log₁₀[H⁺]; pH + pOH = 14 at 25°C

Converts quantities; does not identify which chemical produced them.

You know the dissolved molarity of HCl, NaOH, or another fully dissociated electrolyteAcid / Base Solution — strong

Ion equivalents = concentration × dissociation count

Complete dissociation and solubility are assumptions; H₂SO₄ uses a separate second-dissociation model.

You know the concentration and Ka/Kb of a simple weak acid or weak baseAcid / Base Solution — weak

Ka = x²/(C−x) in the classical ICE approximation

The result solver includes water autoionization; the 5% shortcut is only a checked approximation.

You know the pKa and ratio of a conjugate acid/base buffer pairBuffer pH

pH = pKa + log₁₀([A⁻]/[HA])

The pair must actually be a buffer. It is not an arbitrary acid–base mixing or titration calculator.

A salt such as sodium acetate or ammonium chloride may change water’s pH through hydrolysis. A mixed acid/base solution may require reaction stoichiometry, material balance, and multiple equilibria. These are not automatically the same as entering an arbitrary formula in a single-acid calculator.

How to Calculate pH from Molarity

A concentration alone does not identify the equilibrium. First choose the correct compound and whether it behaves as a fully dissociated strong acid/base, a weak acid/base, or a multi-stage acid.

  1. 1. Identify the acid/base model

    Choose the actual dissolved chemical or explicitly select a custom acid/base model. A molecular formula alone cannot determine the right dissociation chemistry.

  2. 2. Calculate initial molarity

    Use C = n/V. If mass is given, n = mass / molar mass; V is the final solution volume in liters.

  3. 3. Solve the relevant equilibrium

    Strong acids/bases give ion equivalents by full dissociation; weak electrolytes require Ka/Kb and charge balance; buffers use a conjugate pair.

  4. 4. Convert the ion concentration

    pH = −log₁₀[H⁺]. For bases, first obtain pOH = −log₁₀[OH⁻], then pH = 14 − pOH at 25°C.

Strong vs. Weak Acids and Bases

Strong does not mean concentrated. Strong acids and bases are treated as fully dissociated in the appropriate introductory model; weak acids and bases establish an equilibrium described by Ka or Kb.

Common strong acids

HCl, HBr, HI, HNO₃, HClO₄, and HClO₃ are standard introductory strong-acid examples. H₂SO₄ is strong in its first dissociation, but its second ionization must be modeled separately when accurate equilibrium matters.

Common strong bases

NaOH, KOH, and LiOH provide one hydroxide equivalent per dissolved formula unit. Ca(OH)₂, Sr(OH)₂, and Ba(OH)₂ can provide two; concentrations above solubility limits are not physically attainable just because a calculation produces a number.

Common Ka and Kb reference values at about 25°C

Approximate teaching values vary slightly with source, temperature, and ionic strength. Each value can be adjusted in the calculator to match your textbook problem.

CompoundConstantApproximate valueTry it
Acetic acid (CH₃COOH)Ka1.8 × 10⁻⁵Load in calculator
Formic acid (HCOOH)Ka1.8 × 10⁻⁴Load in calculator
Hydrofluoric acid (HF)Ka6.8 × 10⁻⁴Load in calculator
Hydrocyanic acid (HCN)Ka6.2 × 10⁻¹⁰Load in calculator
Benzoic acidKa6.3 × 10⁻⁵Load in calculator
Lactic acidKa1.4 × 10⁻⁴Load in calculator
Ammonium ion (NH₄⁺)Ka5.6 × 10⁻¹⁰Load in calculator
Ammonia (NH₃)Kb1.8 × 10⁻⁵Load in calculator
MethylamineKb4.4 × 10⁻⁴Load in calculator
PyridineKb1.7 × 10⁻⁹Load in calculator

Hazardous acids and bases are included solely to explain chemistry. This table is not an instruction for chemical handling or solution preparation.

Weak Acid pH from Ka: ICE Table and the 5% Rule

For a monoprotic weak acid HA of analytical concentration C, the usual classroom ICE table represents HA ⇌ H⁺ + A⁻, with initial HA = C and a dissociated amount x.

ICEHAA⁻H⁺ from HA
InitialC00
Change−x+x+x
EquilibriumC − xxx

Ka = x² / (C − x)

The quadratic equation avoids assuming that x is negligible. The shortcut x ≈ √(KaC) should only be used after checking the ionization fraction (the commonly taught 5% rule). The calculator’s primary weak-acid result includes Kw through charge balance; the classroom ICE table separately describes dissociation and clearly labels the water-ion approximation.

For example, 0.0010 M HF with Ka = 6.8 × 10⁻⁴ dissociates by roughly 55%, giving pH ≈ 3.258. The shortcut significantly overestimates [H⁺] here. For an ordinary 0.10 M acetic-acid exercise with Ka = 1.8 × 10⁻⁵, ionization is about 1.33%, so the shortcut is reasonable.

Quick pH Examples and Answers

Start with these eight quick numerical answers covering strong acids, bases, grams-to-molarity, weak equilibria, ultra-dilute solutions, and buffers. For full step-by-step derivations, see the worked solutions immediately below.

0.010 M HCl — strong acid

pH ≈ 2.00

Complete dissociation gives [H⁺] ≈ 0.010 M. pH = −log₁₀(0.010) = 2.00; pOH = 12.00.

Load HCl example →

0.40 g NaOH in 500 mL — mass to pH

pH ≈ 12.30

M(NaOH) ≈ 40.00 g/mol; moles ≈ 0.0100; C ≈ 0.0200 M; pOH ≈ 1.699; pH ≈ 12.301. Use final solution volume.

Load NaOH mass example →

0.10 M acetic acid, Ka = 1.8 × 10⁻⁵

pH ≈ 2.875

Ka = x² / (0.10 − x) gives x ≈ 0.001333 M. Ionization is ≈ 1.33%, so the 5% square-root approximation is reasonable here.

Load acetic acid example →

0.0010 M HF, Ka = 6.8 × 10⁻⁴

pH ≈ 3.258

The full equilibrium gives a dissociated amount of ≈ 5.52 × 10⁻⁴ M, or ≈ 55.2% ionization. The square-root approximation fails the 5% test.

Load HF example →

0.050 M NH₃, Kb = 1.8 × 10⁻⁵

pH ≈ 10.973

The weak-base equilibrium yields [OH⁻] ≈ 9.397 × 10⁻⁴ M, pOH ≈ 3.027, and pH ≈ 10.973 at 25°C.

Load NH₃ example →

10⁻⁸ M HCl — ultra-dilute acid

pH ≈ 6.978

Charge balance with Kw gives [H⁺] ≈ 1.05125 × 10⁻⁷ M. Ignoring water would give pH 8, incorrectly describing added acid as a basic solution.

Load ultra-dilute HCl example →

0.10 M H₂SO₄, Ka₂ = 0.012

pH ≈ 0.959

The first ionization gives 0.10 M H⁺; the second HSO₄⁻ equilibrium adds about 0.00985 M H⁺. It does not add a second full 0.10 M.

Load H₂SO₄ example →

Acetate buffer, pKa = 4.74, [A⁻]/[HA] = 2

pH ≈ 5.041

Henderson–Hasselbalch: pH = 4.74 + log₁₀(2) = 5.041. Both weak acid and conjugate base must be present.

Load acetate buffer example →

Fully Worked pH Problems with Calculations

The quick examples above show answers at a glance. These five expanded solutions show every important equation, unit conversion, and check, including when a convenient approximation fails.

Weak acid: 0.100 M acetic acid, Ka = 1.8 × 10⁻⁵

pH ≈ 2.875

Open acetic acid in calculator →

A small Ka means that only part of the acid dissociates. Set up an acid dissociation equilibrium before taking a logarithm.

  1. 1. Write the reaction

    CH₃COOH ⇌ H⁺ + CH₃COO⁻

    The initial analytical acid concentration is C = 0.100 M.

  2. 2. Fill the classical ICE table

    [HA] = 0.100 − x; [A⁻] = x; [H⁺] from HA = x

    The symbol x is the amount of acid dissociated. This classical table neglects ions initially contributed by water.

  3. 3. Solve rather than assuming x is zero

    1.8 × 10⁻⁵ = x² / (0.100 − x); x ≈ 0.00133267 M

    The quadratic solution avoids prematurely approximating C − x as C.

  4. 4. Calculate pH and check the shortcut

    pH ≈ −log₁₀(0.00133267) = 2.875; (x / C) × 100 ≈ 1.33%

    The less-than-5% ionization supports the square-root approximation for this example. The calculator’s primary model also checks the water contribution.

What this teaches: At the same 0.100 M initial concentration, completely dissociated HCl would have pH ≈ 1.00, not 2.875. Initial molarity is not the same as equilibrium [H⁺] for a weak acid.

When the 5% rule fails: 0.0010 M HF

pH ≈ 3.258

Open HF example in calculator →

A moderately large Ka relative to a small initial concentration makes the small-x shortcut unreliable.

  1. 1. Identify inputs

    C = 0.0010 M; Ka = 6.8 × 10⁻⁴

    Use a monoprotic weak-acid model; do not treat HF as fully dissociated.

  2. 2. Calculate the quadratic equilibrium

    6.8 × 10⁻⁴ = x² / (0.0010 − x)

    Solve the equation while retaining x in the denominator.

  3. 3. Find the dissociated amount and pH

    x ≈ 5.51964 × 10⁻⁴ M; pH ≈ 3.258

    Water autoionization is negligible for this particular concentration, but is accounted for in the calculator.

  4. 4. Test the square-root shortcut

    x/C ≈ 55.2%; √(KaC) ≈ 8.246 × 10⁻⁴ M → pH ≈ 3.084

    55.2% greatly exceeds 5%. The shortcut is not valid and produces a noticeably different pH.

What this teaches: The 5% test is a check on a specific algebraic approximation. It does not mark the full equilibrium equation as invalid. HF is highly hazardous; this is only a numerical teaching exercise.

Weak base: 0.050 M ammonia, Kb = 1.8 × 10⁻⁵

pH ≈ 10.973

Open NH₃ example in calculator →

A weak base creates OH⁻ in water. Solve its base equilibrium first, then convert pOH into pH.

  1. 1. Write the reaction

    NH₃ + H₂O ⇌ NH₄⁺ + OH⁻

    The analytical concentration of NH₃ is C = 0.050 M.

  2. 2. Set up the ICE model

    [NH₃] = 0.050 − x; [NH₄⁺] = x; [OH⁻] from NH₃ = x

    The classical base equilibrium has Kb = x² / (0.050 − x).

  3. 3. Solve the equilibrium

    [OH⁻] ≈ 9.39726 × 10⁻⁴ M

    The ionization fraction is about 1.88%, with water’s contribution negligible at these conditions.

  4. 4. Convert to pOH, then pH

    pOH ≈ 3.027; pH = 14.000 − 3.027 ≈ 10.973

    The subtraction from 14 is the 25°C convention and must not be reused unchanged at arbitrary temperatures.

What this teaches: Do not substitute Kb into an acid Ka expression and call −log₁₀[OH⁻] pH. That intermediate logarithm is pOH.

Reverse calculation: find ion concentrations from pH 3.45

[H⁺] ≈ 3.548 × 10⁻⁴ M

Open pH 3.45 conversion →

An inverse pH question needs no acid identity as long as only the logarithmic conversion is requested.

  1. 1. Write the inverse formula

    [H⁺] = 10⁻ᵖᴴ

    Use base-10 exponentiation, not natural logarithms.

  2. 2. Substitute the reported pH

    [H⁺] = 10⁻³·⁴⁵ ≈ 3.548 × 10⁻⁴ M

    This is the concentration equivalent under the ideal dilute-solution approximation.

  3. 3. Find pOH

    pOH = 14.00 − 3.45 = 10.55

    At 25°C, use pH + pOH = 14.00.

  4. 4. Find the hydroxide concentration

    [OH⁻] = 10⁻¹⁰·⁵⁵ ≈ 2.818 × 10⁻¹¹ M

    Cross-check that [H⁺][OH⁻] ≈ 10⁻¹⁴.

What this teaches: The logarithmic conversion does not tell you whether the solution was made from an acid, a salt, a buffer, or a mixture.

Mass and final volume: 0.40 g NaOH in 500 mL

pH ≈ 12.301

Open NaOH mass example →

If you know reagent mass rather than molarity, convert mass to moles before using the strong-base model.

  1. 1. Find the molar mass

    M(NaOH) ≈ 40.00 g/mol

    Use the known formula for sodium hydroxide; formula-weight calculation alone does not identify dissociation behavior.

  2. 2. Convert mass to amount

    n ≈ 0.40 g / 40.00 g·mol⁻¹ = 0.0100 mol

    This assumes a pure, completely dissolved solute.

  3. 3. Calculate molarity using final volume

    C ≈ 0.0100 mol / 0.500 L = 0.0200 M

    Use 0.500 L of final solution, not simply 0.500 L of added water.

  4. 4. Find pOH then pH

    pOH ≈ −log₁₀(0.0200) = 1.699; pH ≈ 12.301

    One dissolved NaOH formula unit supplies one OH⁻ in this ideal model.

What this teaches: Mass-to-pH examples depend on reagent purity and solubility. The calculator cannot determine a safe real-world preparation procedure.

Buffer pH with the Henderson–Hasselbalch Equation

A buffer contains appreciable quantities of a weak acid and its conjugate base. Use pH = pKa + log₁₀([A⁻]/[HA]) when a conjugate-pair approximation is appropriate.

pH = pKa + log₁₀([A⁻]/[HA])

With pKa = 4.74, [A⁻] = 0.20 M, and [HA] = 0.10 M, the base/acid ratio is 2 and pH ≈ 5.041. Ratios from 0.1 to 10 span the usual effective buffer region around pKa ± 1. Outside that range, the equation still returns a value, but effective buffering or the approximation’s assumptions may no longer hold.

How the Base-to-Acid Ratio Changes Buffer pH

The Henderson–Hasselbalch equation depends on a ratio, not either concentration by itself. With pKa = 4.74, the following values show how the estimated pH changes as the conjugate base [A⁻] becomes more or less abundant than weak acid [HA].

[A⁻] / [HA]Estimated pHInterpretation
0.13.740Acid-rich end of usual effective range
0.54.439More acid than conjugate base
14.740Equal conjugate concentrations; pH = pKa
25.041Twice as much conjugate base as acid
105.740Base-rich end of usual effective range

pKa predicts the midpoint, not a fixed pH

When the conjugate acid and base have equal concentrations, log₁₀(1) = 0, so pH ≈ pKa. Increasing the base/acid ratio tenfold raises the estimated pH by one unit. A ratio outside 0.1–10 still yields a mathematical result, though buffering capacity drops sharply.

Buffer pH is not buffer capacity

Two buffers can have the same pKa and the same [A⁻]/[HA] ratio while containing very different total amounts of buffer components. Henderson–Hasselbalch may predict similar pH, but the more dilute sample generally neutralizes less added acid or base before a substantial pH shift.

Adding a strong acid or strong base to a buffer changes the amounts of HA and A⁻. Calculate the neutralization stoichiometry first; simply entering the initial ratio does not model a completed titration or added reagent.

pH Scale: Acidic, Neutral, and Basic Solutions

The familiar 0–14 scale is a useful teaching aid at 25°C, but it is not a hard mathematical limit. At a different temperature, neutral water may not have pH 7; at high concentrations, ion activities matter.

Below 7

Acidic at 25°C

[H⁺] exceeds [OH⁻].

About 7

Neutral at 25°C

[H⁺] and [OH⁻] are equal.

Above 7

Basic at 25°C

[OH⁻] exceeds [H⁺].

Dilution, Significant Figures and Accuracy in pH Calculations

A mathematically precise output is not automatically a laboratory-accurate measurement. Concentration, logarithmic rounding, and the selected chemical model all affect how the result should be interpreted.

Does a 10× dilution change pH by one unit?

For an ordinary ideal strong monoprotic acid sufficiently far from water’s contribution, diluting 0.010 M HCl to 0.0010 M changes pH from about 2.00 to 3.00. This shortcut does not apply generally to buffers or weak electrolytes. Near 10⁻⁷ M strong acid, include water autoionization.

Find the diluted molarity →

How many decimal places should pH have?

In elementary logarithmic significant-figure rules, the number of decimal places in pH corresponds to the significant figures of the hydrogen-ion concentration. For [H⁺] = 1.0 × 10⁻³ M (two significant figures), report pH = 3.00 (two decimal places), if the input precision justifies it. The calculator displays guard digits for learning, not a measured uncertainty.

Check significant figures →

Why does pH use activity rather than just [H⁺]?

Thermodynamic pH uses hydrogen-ion activity. The classroom equation pH ≈ −log₁₀([H⁺] expressed relative to the standard concentration) is most useful in dilute idealized solutions. At high ionic strength, concentration-based pH can differ from a measured result and should not be labeled exact.

When is a different calculator needed?

Hydrolyzing salts, polyprotic acids other than the supported sulfuric-acid example, acid/base mixtures, and titration curves may require extra equilibria or reaction stoichiometry. This tool does not infer all possible species from a formula or predict pH at temperatures other than 25°C.

Explore aqueous reactions →

Textbook references

These examples use standard introductory aqueous acid–base relationships. The calculator’s ideal concentration models are for study and are not laboratory measurements.

Special Cases and Common pH Calculation Mistakes

The important limitations are not cosmetic. Ultra-dilute electrolytes, multi-stage acids, activity corrections, and an inappropriate choice of equation can change the direction or value of a pH answer.

Mistaking acid strength for concentration

Strong acid means extensive dissociation; a diluted strong acid can have a higher pH than a concentrated weak acid. Compare actual hydrogen-ion concentrations.

Assuming an arbitrary formula determines pH

Molar mass and chemical formula do not tell you whether a solute fully dissolves, ionizes, buffers, hydrolyzes, or reacts. Select the correct model.

Using pH + pOH = 14 at any temperature

The constant 14.00 uses pKw at 25°C. Neutral means equal hydrogen and hydroxide activities, not universally pH 7.

Ignoring water in ultra-dilute solutions

For 10⁻⁸ M HCl, include Kw to avoid an impossible basic prediction from adding a strong acid to pure water.

Applying the 5% shortcut without checking

For 0.0010 M HF, ionization is about 55%; the square-root shortcut is not acceptable. Solve the quadratic or charge balance.

Treating the 0–14 scale as an absolute limit

The illustrated classroom pH scale does not capture every possible concentration-derived value; non-ideal solutions require activity corrections.

Treating all sulfuric-acid protons as fully released

HSO₄⁻ has a finite Ka₂. Calculate the second dissociation separately when the problem requires it.

Calling any acid/base mixture a buffer

The Henderson–Hasselbalch approximation requires a conjugate weak acid/base pair in appreciable quantities; strong neutralization may need stoichiometry first.

pH Calculator Frequently Asked Questions

Quick answers for pH from molarity, pOH, strong and weak acids, Ka/pKa, ICE tables, buffers, ion concentrations, and temperature.

How do you calculate pH from hydrogen ion concentration?

At 25°C, the classroom concentration formula is pH = −log₁₀[H⁺], with concentration in mol/L. A 0.010 M solution of fully dissociated HCl has a pH of about 2.00. Strictly, thermodynamic pH is defined using hydrogen-ion activity.

What is the relationship between pH and pOH?

At 25°C, pH + pOH = 14.00 in the concentration approximation because Kw is about 1.0 × 10⁻¹⁴. At other temperatures, the sum equals pKw, not always 14.

How can I calculate the pH of a weak acid from Ka or pKa?

Use Ka = 10^(−pKa) if pKa is given. With initial concentration C, the classical ICE approximation uses Ka = x² / (C − x). This calculator also accounts for water autoionization when solving the equilibrium, so it remains well behaved for very dilute solutions.

What is the 5% rule for weak acids?

The square-root shortcut x ≈ √(KaC) assumes x is much smaller than initial concentration C. A common classroom check is x/C no greater than about 5%. If it fails, use the quadratic equation or a full charge-balance solution.

Why is the pH of 10⁻⁸ M HCl about 6.98 instead of 8?

A strong acid contributes hydrogen ions, but in an extremely dilute solution water contributes comparable ions through autoionization. Including Kw gives [H⁺] ≈ 1.051 × 10⁻⁷ M and pH ≈ 6.978, which is slightly acidic, not basic.

Can pH be below 0 or above 14?

Yes. The textbook 0–14 chart is an illustrative range, not a mathematical limit. Concentrated solutions can have pH outside it, though activity coefficients and non-ideal behavior make ideal concentration estimates less reliable.

How do I calculate pH from grams and mL?

Convert grams to moles using the chemical’s formula weight, then divide by final solution volume in liters. Choose the correct acid/base model and dissociation constant. A chemical formula and mass alone do not determine acid strength or pH.

Can I calculate a weak base pH from Kb?

For a simple weak base B, use Kb and the initial molarity to solve the equilibrium B + H₂O ⇌ BH⁺ + OH⁻. Convert total hydroxide concentration to pOH and use pH = 14 − pOH at 25°C.

How do I calculate the pH of a buffer?

For a weak acid HA and its conjugate base A⁻, Henderson–Hasselbalch estimates pH = pKa + log₁₀([A⁻]/[HA]). Both components must be present. The usual pKa ± 1 buffer interval is practical guidance, not a hard calculation boundary.

Is H₂SO₄ a diprotic strong acid with twice the concentration of H⁺?

Its first ionization is typically treated as complete in introductory problems, but HSO₄⁻ has a finite second dissociation constant. At 0.10 M and Ka₂ = 0.012, the ideal pH is about 0.959, not −log₁₀(0.20).

Does neutral water always have pH 7?

Pure water has equal hydrogen and hydroxide activities at neutrality, but Kw changes with temperature. Neutral pH is about 7 at 25°C; at other temperatures, a neutral sample need not have pH 7.

Does a tenfold dilution always change pH by one unit?

For an ideal fully dissociated monoprotic strong acid, away from the water self-ionization limit, dividing concentration by ten raises pH by about one unit. This rule does not generally hold for weak acids, buffers, or extremely dilute solutions.

How many decimal places should I report for pH?

In standard classroom logarithm rules, the number of pH decimal places matches the number of significant figures in the hydrogen-ion concentration. For example, [H⁺] = 1.0 × 10⁻³ M has two significant figures and gives pH 3.00. The calculator’s extra digits are for checking the math, not measured precision.

What is the difference between pKa and pH?

pKa is a property of an acid dissociation equilibrium (pKa = −log₁₀Ka), whereas pH describes hydrogen-ion activity in a particular solution. For an ideal weak acid/conjugate base buffer where their concentrations are equal, pH is approximately pKa.

Can two buffers have the same pH but different buffer capacities?

Yes. Two solutions with the same weak-acid pKa and conjugate-base/acid ratio may have similar pH but different total buffer concentrations. The more concentrated buffer can generally neutralize more added acid or base without a large pH shift; this tool does not calculate buffer capacity.

Does this tool calculate pH of salts, titrations, or arbitrary acid-base mixtures?

Not automatically. Salts may hydrolyze, and mixtures and titrations may require reaction stoichiometry, solubility, and simultaneous equilibrium equations. Select a supported simple acid/base model or a prepared conjugate buffer pair; do not infer a full chemical system from a formula alone.

Can I calculate the pH of any chemical from its formula?

No. A formula does not tell you whether the material fully dissolves, which acid/base equilibria apply, or whether multiple species or reactions occur. Select a supported compound or supply an explicit model and equilibrium constant.