When the extracellular fluids tend towards acidity, the renal tubular cells secrete the H+ ions into the tubular fluid from where they exit the body via the urine. The HCO−3 ions are simultaneously secreted into the blood plasma, thus raising the bicarbonate ion concentration in the plasma, lowering the carbonic acid/bicarbonate ion ratio, and consequently raising the pH of the plasma. The converse happens when the plasma pH rises above normal: bicarbonate ions are excreted into the urine, and hydrogen ions into the plasma. These combine with the bicarbonate ions in the plasma to form carbonic acid (H+ + HCO−3 
  
    
      
        ⇌
      
    
    {\displaystyle \rightleftharpoons }
   H2CO3), thus raising the carbonic acid:bicarbonate ratio in the extracellular fluids, and returning its pH to normal.In general, metabolism produces more waste acids than bases. Urine produced is generally acidic and is partially neutralized by the ammonia (NH3) that is excreted into the urine when glutamate and glutamine (carriers of excess, no longer needed, amino groups) are deaminated by the distal renal tubular epithelial cells. Thus some of the "acid content" of the urine resides in the resulting ammonium ion (NH4+) content of the urine, though this has no effect on pH homeostasis of the extracellular fluids.
[H2CO3] is the molar concentration of carbonic acid in the extracellular fluid.However, since the carbonic acid concentration is directly proportional to the partial pressure of carbon dioxide (
  
    
      
        
          P
          
            
              
                
                  C
                  O
                
              
              
                2
              
            
          
        
      
    
    {\displaystyle P_{{\mathrm {CO} }_{2}}}
  ) in the extracellular fluid, the equation can be rewritten as follows:
  
    
      
        
          p
          H
        
        =
        6.1
        +
        
          log
          
            10
          
        
        ⁡
        
          (
          
            
              
                [
                
                  
                    H
                    C
                    O
                  
                  
                    3
                  
                  
                    −
                  
                
                ]
              
              
                0.0307
                ×
                
                  P
                  
                    
                      
                        C
                        O
                      
                      
                        2
                      
                    
                  
                
              
            
          
          )
        
        ,
      
    
    {\displaystyle \mathrm {pH} =6.1+\log _{10}\left({\frac {[\mathrm {HCO} _{3}^{-}]}{0.0307\times P_{\mathrm {CO} _{2}}}}\right),}
  
where:

pH is the negative logarithm of molar concentration of hydrogen ions in the extracellular fluid.