Current methods for separating critical materials from feedstock solutions remain chemistry- and energy-intensive. We demonstrate the rapid extraction of a pure magnesium phase from seawater via precipitation with sodium hydroxide in a flow-gel device. Our approach is scalable, suitable for high-throughput extraction, and does not rely on specialty chemicals.