Gallstones form when the chemistry of bile tips out of balance, allowing dissolved substances to solidify inside the gallbladder. The most common type, cholesterol gallstones, begins with the liver pumping too much cholesterol into bile, overwhelming the system that normally keeps it dissolved. That cholesterol-heavy bile pools in a sluggish gallbladder, where mucus acts as a scaffold for tiny crystals to appear, clump together, and eventually harden into stones. The process is slower and more layered than most people realize, involving the liver, the gallbladder wall, gut bacteria, and genetics all working (or failing) in concert.
What Bile Is and Why It Matters
Bile is a fluid the liver produces continuously, storing it in the gallbladder between meals. Its main job is digesting dietary fat, but bile also serves as the body’s primary route for excreting excess cholesterol. Bile is a carefully balanced mixture of bile salts, phospholipids (mainly a fat called lecithin), and cholesterol. Bile salts and lecithin together act as detergents, keeping cholesterol dissolved in tiny packets called micelles and vesicles. As long as the ratio of cholesterol to its solubilizers stays within a safe range, everything stays liquid. The moment cholesterol exceeds what the bile salts and lecithin can hold in solution, the bile becomes “supersaturated,” and cholesterol is free to come out of solution as solid crystals.
Cholesterol Supersaturation and Liver Transport
The single most important trigger for cholesterol gallstones is the liver secreting more cholesterol into bile than it should. Research consistently identifies this hepatic cholesterol hypersecretion as the first step in gallstone formation.1Annals of Hepatology. From lipid secretion to cholesterol crystallization in bile. Relevance in cholesterol gallstone disease A set of dedicated protein pumps on the liver cell membrane controls what gets pushed into bile. One family of transporters, called ABCG5 and ABCG8, specifically handles cholesterol export. When these transporters are overactive, they flood bile with cholesterol. But they depend on a companion transporter (ABCB4) that secretes phospholipids into bile to help keep the cholesterol dissolved.2Journal of Lipid Research. Biliary lipids and cholesterol gallstone disease If cholesterol secretion outpaces phospholipid secretion, the balance breaks and bile becomes supersaturated.
Supersaturation alone does not instantly create stones. Supersaturated bile can remain liquid for days in laboratory conditions. What changes things is the environment inside the gallbladder, which provides the conditions for crystals to actually appear.
How the Gallbladder Sets the Stage
A healthy gallbladder contracts vigorously after you eat, squeezing bile into the small intestine and then refilling. When the gallbladder fails to empty properly, bile sits around for longer. That extended residence time gives cholesterol more opportunity to come out of solution and form crystals. Animal studies show this “hypomotility” appears very early in gallstone disease, sometimes within days of the bile becoming cholesterol-heavy, and worsens as stones develop.3Laboratory Investigation. Cholesterol gallstone disease: focusing on the role of gallbladder
One reason the gallbladder slows down involves fat accumulating in its wall tissue. Research in mice found that a specific fatty acid transporter (FATP2) drives fat uptake into the gallbladder muscle, impairing its ability to contract. Blocking that transporter protected against gallstones even when bile was supersaturated with cholesterol, suggesting that gallbladder stasis is not just a bystander but an active contributor.4PubMed Central. Prevention of gallbladder hypomotility via FATP2 inhibition protects from lithogenic diet-induced cholelithiasis A shortage of the gut hormone CCK, which normally signals the gallbladder to squeeze, also leads to longer bile residence times and faster crystal formation.5PubMed Central. Effect of gallbladder hypomotility on cholesterol crystallization and growth in CCK-deficient mice
Mucus, Nucleation, and the Birth of Crystals
Even in a sluggish gallbladder full of supersaturated bile, cholesterol crystals need a push to form. That push comes from mucus. The gallbladder lining secretes a mucus gel, and when the bile becomes cholesterol-heavy, the lining responds by ramping up mucus production dramatically. This gel acts as a “nucleating agent,” providing a sticky matrix where the first microscopic cholesterol crystals can appear. In laboratory experiments, purified human gallbladder mucin added to supersaturated bile triggered crystal formation within 18 hours, while the same bile left alone stayed crystal-free for days.6PubMed Central. Role of gallbladder mucus hypersecretion in the evolution of cholesterol gallstones
The resulting mix of cholesterol crystals, bilirubin granules, and mucus gel is what clinicians call biliary sludge. It can be thought of as the embryonic stage of gallstone disease.7PubMed. Nature and composition of biliary sludge Sludge does not always progress to stones. Studies tracking patients with sludge found that roughly 40% see it disappear on its own, about 40% have a pattern of it coming and going, and around 20% go on to develop actual gallstones.8PubMed Central. Similarities and differences between biliary sludge and microlithiasis: Their clinical and pathophysiological significances Why some people clear the sludge while others do not depends on the interplay of all the factors discussed here.
How Crystals Grow Into Stones
Once the first crystals appear, they need to grow and aggregate to become a visible gallstone. Recent imaging work using atomic force microscopy has captured this process in real time. Cholesterol monohydrate crystals grow layer by layer: new crystal layers form around defects on the crystal surface called dislocations, and individual cholesterol molecules attach by first landing on the crystal face and then migrating along the surface to the advancing edge of a step. Interestingly, the crystals develop features called “macrosteps” that actually slow their own growth, creating a kind of self-braking mechanism.9PubMed Central. Direct observation of cholesterol monohydrate crystallization Despite this self-inhibition, in a gallbladder where supersaturated bile keeps arriving and stasis keeps it there, the crystals have plenty of time to keep growing. Over weeks to months, aggregated crystals coalesce into macroscopic stones.
Pigment Stones Follow a Different Path
Not all gallstones are made of cholesterol. About 20% of gallstones in Western countries are pigment stones, composed primarily of bilirubin rather than cholesterol. They come in two distinct types, each with its own biology.
Black Pigment Stones
Black pigment stones form inside the gallbladder itself and involve a non-bacterial chemical process. Bilirubin, a breakdown product of hemoglobin, normally circulates in bile after the liver attaches sugar molecules to make it water-soluble (conjugated bilirubin). But some of that conjugation gets reversed, either through natural hydrolysis at bile’s pH or through the action of an enzyme called beta-glucuronidase released by the biliary tract lining. The freed unconjugated bilirubin then binds calcium ions to form highly insoluble calcium bilirubinate, which precipitates and gradually cross-links into a dense polymer network.10PubMed. The etiology of pigment gallstones Conditions that flood the system with bilirubin, such as chronic hemolysis (where red blood cells break down faster than normal) or Gilbert’s syndrome, increase the risk of black stones substantially.11PubMed. Pigment gallstone disease
Brown Pigment Stones
Brown pigment stones are a different story. They usually form in the bile ducts rather than the gallbladder, and bacteria are almost always involved. In one study, 98% of brown pigment stones were associated with infected bile, and the stones were found in the common duct 96% of the time.12PubMed Central. The role of bacteria in pigment gallstone disease The bacteria produce beta-glucuronidase, which strips bilirubin of its sugar attachments, and phospholipase, which breaks down lecithin into fatty acids. The freed bilirubin precipitates with calcium, and the freed fatty acids form calcium soaps like calcium palmitate. The result is a soft, earthy stone quite different from the hard, black pigment stones or the waxy cholesterol stones. A separate study confirmed that most infected pigment stones contained bacteria producing both slime and beta-glucuronidase, enzymes that facilitate the entire stone-forming cascade.13PubMed. Pathogenesis of pigment gallstones in Western societies: the central role of bacteria
Genetics and the Cholesterol Pump
Gallstone disease runs in families, and research has zeroed in on the genes behind the cholesterol transporters discussed earlier. The ABCG5/ABCG8 gene region is the best-studied genetic locus for gallstone risk. A specific variant in ABCG8 (called D19H) increases cholesterol transport activity by more than threefold compared to the normal version. In studies across German, Chilean, and Chinese populations, this variant consistently predicted higher gallstone risk, providing a direct molecular link between genetics and the cholesterol hypersecretion that starts the whole process.14PubMed. Genetic and functional identification of the likely causative variant for cholesterol gallstone disease at the ABCG5/8 lithogenic locus
Taiwanese population studies have confirmed the association from a different angle. Carriers of specific variants in the ABCG8 gene had roughly 70% higher odds of developing gallstones compared to non-carriers.15PubMed Central. Risk of gallstones based on ABCG8 rs11887534 single nucleotide polymorphism among Taiwanese men and women Multiple variants across the ABCG5/G8 region also showed a trend of association with family history of gallstone disease, reinforcing the heritable component.16PubMed Central. Differential Effects of ABCG5/G8 Gene Region Variants on Lipid Profile, Blood Pressure Status, and Gallstone Disease History in Taiwan These genetic findings help explain why some people on identical diets develop stones while others never do.
How Hormones and Body Fat Alter Bile Chemistry
Estrogen is one of the strongest hormonal drivers of gallstone formation. Both human and animal studies have demonstrated that estrogen increases the liver’s secretion of cholesterol into bile, directly pushing bile toward supersaturation.17PubMed Central. New insights into the molecular mechanisms underlying effects of estrogen on cholesterol gallstone formation This is why gallstones are more common in women than men, especially during pregnancy and with the use of oral estrogen-containing medications. Progesterone compounds the problem by slowing gallbladder emptying, giving the now-cholesterol-rich bile more time to crystallize.
Obesity feeds into the same pathway through a different door. Central abdominal fat is associated with insulin resistance, which ramps up the liver’s cholesterol secretion into bile.18PubMed Central. Obesity and Gallstones People with obesity have roughly a fivefold higher risk of gallstone formation compared to the general population. Paradoxically, losing that weight rapidly also raises risk: the incidence of new gallstones after bariatric surgery ranges from about 10% to 38%.19PubMed Central. Prevention of Gallstones After Bariatric Surgery using Ursodeoxycholic Acid: A Narrative Review of Literatures During rapid weight loss, the body mobilizes large amounts of stored cholesterol, which the liver dumps into bile. At the same time, reduced food intake means fewer gallbladder contractions, worsening stasis. Additional mechanisms after bariatric surgery specifically include potential nerve damage during the operation, shifts in gut hormone levels, and changes to the gut microbiome.20PubMed Central. Gallstones after bariatric surgery: mechanisms and prophylaxis
The Gut Microbiome Connection
The bacteria living in your intestines play a surprisingly active role in gallstone formation by altering how bile acids are processed. Normally, bile acids cycle between the liver and the intestine in a loop called the enterohepatic circulation. Gut bacteria modify bile acids during this cycle, and the specific modifications matter. A gallstone-prone microbiome enriched in certain bacterial groups (such as Desulfovibrionales) can shift bile acid profiles toward more hydrophobic forms. Those hydrophobic bile acids increase intestinal cholesterol absorption, which overloads the liver with cholesterol and increases biliary cholesterol secretion, feeding the supersaturation that starts stone formation.21Nature Communications. Gut microbiota promotes cholesterol gallstone formation by modulating bile acid composition and biliary cholesterol secretion
A multiomics study further proposed that the mechanism works through two parallel routes: dominant bacterial groups activate lipid synthesis pathways, while enzymes secreted by these bacteria alter the direction of bile acid transformation, accumulating hydrophobic bile acids. Meanwhile, the depletion of beneficial bacteria under certain conditions impairs the gut’s metabolic buffering capacity and barrier function.22PubMed Central. Gut Microbiome Dysbiosis Promotes Gallstone Formation via Bile Acid Metabolic Disorder: A Multiomics Study Disturbances in the enterohepatic circulation of bile acids, whether from transporter problems or microbial shifts, are increasingly recognized as a distinct pathway to gallstone disease.23PubMed Central. The mechanism of enterohepatic circulation in the formation of gallstone disease
Medications That Promote Stone Formation
Several drugs can tip bile chemistry toward gallstone formation, each through a different mechanism. Exogenous estrogens increase hepatic cholesterol secretion into bile, as noted for the body’s own estrogen. Among cholesterol-lowering medications, fibrate drugs (like clofibrate and fenofibrate) inhibit an enzyme that converts cholesterol into cholesterol esters, making bile more lithogenic. In population studies, fibrate use carried a relative risk of about 1.7 for gallstone formation.24Digestive Diseases and Sciences. Role of Fibrates and HMG-CoA Reductase Inhibitors in Gallstone Formation Statin drugs, by contrast, did not appear to increase risk in the same study.
Octreotide, a hormone analog used to treat conditions like acromegaly and certain tumors, causes gallstones in roughly half of patients within a year of therapy. Its mechanism involves directly suppressing gallbladder contractions, reducing bile secretion, and altering bile composition, a combination that recreates the stasis-plus-supersaturation conditions that favor stone growth.25PubMed. Octreotide-associated biliary tract dysfunction and gallstone formation: pathophysiology and management The antibiotic ceftriaxone causes a different problem entirely: it is excreted in bile and its calcium salt precipitates directly, creating a type of sludge that mimics gallstones on imaging but usually resolves once the drug is stopped.26PubMed. Drug-induced gallbladder disease. Incidence, aetiology and management
What Stones Actually Do Once Formed
Many gallstones sit quietly in the gallbladder for years, causing no symptoms at all. Problems arise when a stone gets pushed into the cystic duct, the narrow tube connecting the gallbladder to the main bile duct. The gallbladder contracts against the obstruction, causing the sharp, cramping pain known as biliary colic. If the stone stays stuck, the ongoing contraction and pressure lead to inflammation, swelling, and reduced blood supply to the gallbladder wall, a condition called acute calculous cholecystitis.27Academic Pathology. Educational Case: Gallstones, Cholelithiasis, and Cholecystitis A stone that passes further downstream can block the common bile duct (causing jaundice) or the pancreatic duct (triggering pancreatitis). The biological process of stone formation is slow and silent; the consequences tend to be sudden.
Diet, Coffee, and What Might Slow the Process
Because the formation cascade starts with cholesterol supersaturation, dietary patterns that influence cholesterol metabolism matter. Diets high in refined sugars, fructose, and saturated fat tend to promote gallstone formation, while diets rich in fiber, monounsaturated fats (like olive oil), omega-3 fatty acids from fish, and vegetable protein appear protective.28PubMed Central. The Role of Diet in the Pathogenesis of Cholesterol Gallstones Vitamin C supplementation and moderate alcohol consumption also show protective associations in population studies.
Coffee deserves a special mention. In a large study of women, drinking four or more cups of caffeinated coffee daily was linked to about a 28% lower risk of requiring gallbladder removal compared to non-drinkers. Increasing total caffeine intake showed a similar dose-response trend. Decaffeinated coffee, however, showed no protective effect, pointing to caffeine itself as the active factor.29PubMed. Coffee intake is associated with lower risk of symptomatic gallstone disease in women Caffeine stimulates gallbladder contraction, which may keep bile moving and reduce the stasis that allows crystals to form.
Gallstones in Children
Gallstone disease is overwhelmingly associated with middle-aged adults, but it does occur in children and adolescents. The causes in younger patients often differ from the classic adult profile. Hemolytic anemias like sickle cell disease are a major contributor, leading to pigment stones rather than cholesterol stones. Other pediatric risk factors include prolonged parenteral nutrition (which bypasses the gut and leaves the gallbladder idle), certain infections, and medications. Genetic predisposition and obesity are increasingly recognized as contributors in younger populations as well.30PubMed Central. The Etiology of Cholelithiasis in Children and Adolescents-A Literature Review The biological machinery is the same — supersaturation, stasis, nucleation — but the reasons those conditions arise in a child tend to be different from those in a 50-year-old with metabolic syndrome.