A magnetic ink has been developed that can be used to make self-healing batteries, electrochemical sensors and wearable, textile-based electrical circuits.