Heparin, a mammalian polysaccharide, is a widely used anticoagulant medicine to treat thrombotic disorders. It is also known to improve outcomes in sepsis, a leading cause of mortality resulted from infection-induced immune dysfunction. Whereas it is relatively clear how heparin exerts its anticoagulant effect, the immunomodulatory mechanisms enabled by heparin remain enigmatic. Here, we show that heparin prevented caspase-11-dependent immune responses and lethality in sepsis independent of its anticoagulant properties. Heparin or a chemically modified form of heparin without anticoagulant function inhibited the alarmin HMGB1-lipopolysaccharide (LPS) interaction and prevented the macrophage glycocalyx degradation by heparanase. These events blocked the cytosolic delivery of LPS in macrophages and the activation of caspase-11, a cytosolic LPS receptor that mediates lethality in sepsis. Survival was higher in septic patients treated with heparin than those without heparin treatment. The identification of this previously unrecognized heparin function establishes a link between innate immune responses and coagulation.