Electronics based on hydrogels can have inherent similarities to biological tissue and are of potential use in biomedical applications. Ideally, such hydrogel electronics should offer customizable three-dimensional circuits, but making complex three-dimensional circuits encapsulated within a hydrogel matrix is challenging with existing materials and manufacturing methods. Here we report the three-dimensional printing of hydrogel electronics using a curable hydrogel-based supporting matrix and a stretchable silver–hydrogel ink. The supporting matrix has a yield stress fluid behaviour, so the shear force generated by a moving printer nozzle creates a temporary fluid-like state, allowing the accurate placement in the matrix of silver–hydrogel ink circuits and electronic components. After printing, the entire matrix and embedded circuitry can be cured at 60 °C to form soft (Young’s modulus of less than 5 kPa) and stretchable (elongation of around 18) monolithic hydrogel electronics, whereas the conductive ink exhibits a high conductivity of around 1.4 × 103 S cm−1. We use our three-dimensional printing approach to create strain sensors, inductors and biological electrodes. Using a conductive silver–hydrogel ink, three-dimensional circuits can be printed into a supporting hydrogel matrix that has a temporary, fluid-like state before curing to make fully encapsulated hydrogel electronics.