Seasonal influenza vaccines offer little protection against pandemic influenza virus strains. It is difficult to create effective prepandemic vaccines because it is uncertain which influenza virus subtype will cause the next pandemic. In this work, we developed a nucleoside-modified messenger RNA (mRNA)-lipid nanoparticle vaccine encoding hemagglutinin antigens from all 20 known influenza A virus subtypes and influenza B virus lineages. This multivalent vaccine elicited high levels of cross-reactive and subtype-specific antibodies in mice and ferrets that reacted to all 20 encoded antigens. Vaccination protected mice and ferrets challenged with matched and mismatched viral strains, and this protection was at least partially dependent on antibodies. Our studies indicate that mRNA vaccines can provide protection against antigenically variable viruses by simultaneously inducing antibodies against multiple antigens.