Dendrite growth in lithium-based batteries is hazardous as it could cause internal shorts and raise safety concerns. Here, the authors design a bifunctional separator in lithium-ion batteries, which serves as a sensing terminal and is able to detect early dendrite growth inside the batteries.