The kidneys are two bean-shaped organs located near the middle of the back, just below the rib cage. They are the main organs of the urinary system, responsible for filtering waste and toxins out of the bloodstream and producing urine to excrete them from the body. The kidneys also play an important role in maintaining electrolyte balance, regulating blood pressure, and producing hormones that regulate red blood cell production, among other functions.