Henderson–Hasselbalch equation
The Henderson–Hasselbalch equation, when applied to the carbonic acid-bicarbonate buffer system in the extracellular fluids, states that:
  
    
      
        
          p
          H
        
        =
        
          p
        
        
          K
          
            
              a
            
             
            
              
                H
              
              
                2
              
            
            
              
                C
                O
              
              
                3
              
            
          
        
        +
        
          log
          
            10
          
        
        ⁡
        
          (
          
            
              
                [
                
                  
                    H
                    C
                    O
                  
                  
                    3
                  
                  
                    −
                  
                
                ]
              
              
                [
                
                  
                    H
                  
                  
                    2
                  
                
                
                  
                    C
                    O
                  
                  
                    3
                  
                
                ]
              
            
          
          )
        
        ,
      
    
    {\displaystyle \mathrm {pH} =\mathrm {p} K_{\mathrm {a} ~\mathrm {H} _{2}\mathrm {CO} _{3}}+\log _{10}\left({\frac {[\mathrm {HCO} _{3}^{-}]}{[\mathrm {H} _{2}\mathrm {CO} _{3}]}}\right),}
  
where:

pH is the negative logarithm (or cologarithm) of molar concentration of hydrogen ions in the extracellular fluid.
Metabolic component: The third line of defense is slow, best measured by the base excess, and mostly depends on the renal system which can add or remove bicarbonate ions (HCO−3) to or from the ECF. Bicarbonate ions are derived from metabolic carbon dioxide which is enzymatically converted to carbonic acid in the renal tubular cells. There, carbonic acid spontaneously dissociates into hydrogen ions and bicarbonate ions. When the pH in the ECF falls, hydrogen ions are excreted into urine, while bicarbonate ions are secreted into blood plasma, causing the plasma pH to rise. The converse happens if the pH in the ECF tends to rise: bicarbonate ions are then excreted into the urine and hydrogen ions into the blood plasma.The second and third lines of defense operate by making changes to the buffers, each of which consists of two components: a weak acid and its conjugate base. It is the ratio concentration of the weak acid to its conjugate base that determines the pH of the solution. Thus, by manipulating firstly the concentration of the weak acid, and secondly that of its conjugate base, the pH of the extracellular fluid (ECF) can be adjusted very accurately to the correct value. The bicarbonate buffer, consisting of a mixture of carbonic acid (H2CO3) and a bicarbonate (HCO−3) salt in solution, is the most abundant buffer in the extracellular fluid, and it is also the buffer whose acid-to-base ratio can be changed very easily and rapidly.