how do the moles cancel from R in the nernst equation
The moles don’t cancel out of RRR because RRR is the gas constant, not a term with moles in it. In the Nernst equation, the cancellation happens because the nnn from the reaction stoichiometry comes from ΔG=−nFE\Delta G=-nFEΔG=−nFE, while RTlnQRT\ln QRTlnQ contains RRR as a universal constant; when you divide through by nFnFnF, you get E=E∘−RTnFlnQE=E^\circ -\frac{RT}{nF}\ln QE=E∘−nFRTlnQ.
Why this feels confusing
A common mix-up is thinking the nnn in the denominator is “moles” in the everyday sense. In the Nernst equation, nnn means the number of electrons transferred in the balanced redox reaction, not a variable that cancels with RRR.
Where the equation comes from
Start with the thermodynamic relation ΔG=ΔG∘+RTlnQ\Delta G=\Delta G^\circ +RT\ln QΔG=ΔG∘+RTlnQ, and the electrochemistry relation ΔG=−nFE\Delta G=-nFEΔG=−nFE. Using ΔG∘=−nFE∘\Delta G^\circ =-nFE^\circ ΔG∘=−nFE∘, then substituting and rearranging gives the Nernst equation, which is why RRR stays in the formula and nnn appears separately.
Practical takeaway
So the short answer is: nothing cancels from RRR, because RRR is just the gas constant. The quantity that matters for the redox reaction is nnn, the electrons transferred, and that is what ends up in the denominator with FFF.
Would you like a quick derivation with one concrete redox example?