Is the hypoxaemia from the lung (raised gradient: V/Q mismatch, shunt, diffusion) or from hypoventilation alone (normal gradient)?
The calculator on this page needs JavaScript. The formula and its source are above.