For a general reversible reaction xA+yB⇌lC+mD, the equilibrium constant is the ratio, at a fixed temperature, of the product of the active masses of the products (each raised to its own stoichiometric coefficient) to the product of the active masses of the reactants (likewise raised to their coefficients):
KC=[A]x[B]y[C]l[D]m
When every species in the reaction is gaseous, the same equilibrium can equally be described using partial pressures instead of concentrations:
KP=pAxpBypClpDm
KC (or KP) is a genuine constant at a given temperature -- it does not change if the starting concentrations are changed (doubling the initial concentrations of A and B in A+B⇌C changes the equilibrium composition the system settles into, but not the numerical value of KC itself, since KC depends only on temperature). It changes only if the temperature changes (the relationship is made quantitative by the Van't Hoff equation).
This expression is applied directly to compute KC from a set of measured equilibrium concentrations -- for example, for 2A(g)⇌2B(g)+C2(g) with [A]=1×10−4, [B]=2.0×10−3, [C2]=1.5×10−4 M at 400 K, KC=[A]2[B]2[C2]=(1×10−4)2(2.0×10−3)2(1.5×10−4)=0.06. The same expression also lets a balanced equation be reconstructed purely from a stated KC formula, by reading off which species (and what power) sit in the numerator (products) and denominator (reactants) -- for instance KC=[NO]4[H2O]6[NH3]4[O2]5 corresponds to the balanced equilibrium 4NO(g)+6H2O(g)⇌4NH3(g)+5O2(g).
Equilibrium-constant algebra of this kind extends naturally to a heterogeneous solubility-type equilibrium too -- for Fe(OH)3(s)⇌Fe3+(aq)+3OH−(aq), the constant [Fe3+][OH−]3 stays fixed at a given temperature, so if [OH−] is deliberately lowered to one-quarter of its previous value, [Fe3+] must rise by a factor of 43=64 to keep the product constant.