Pills are the cornerstone of medicine, but they are difficult to swallow. Although liquid formulations are easier to ingest, they lack the ability to use excipients for local treatment and cannot serve as controlled release devices. Here, we describe a drug formulation based on liquid in-situ forming tough (LIFT) hydrogel, which combines the advantages of solid and liquid formulations. The LIFT hydrogel was directly formed in the stomach by ingesting the cross-linking agent solution of calcium and dithiol cross-linking agent in turn, then alginate and four arm polyethylene glycol maleimide drug containing polymer solution. We have proved that LIFT hydrogel is firmly formed in the stomach of rats and pigs in vivo, and it is mechanically tough and biocompatible, and can be safely cleared 24 hours later. The LIFT hydrogel delivers the total drug dose equivalent to the unpacked drug in a controlled manner, and protects the encapsulated therapeutic enzymes and bacteria from gastric acid mediated inactivation. In general, LIFT hydrogel can expand the opportunity for patients with dysphagia to obtain advanced treatment.