Immunoglobulins are the effector molecules of the adaptive humoral immune system. In a genome-wide association study of 19,219 individuals, we found 38 new variants and replicated 5 known variants associating with IgA, IgG or IgM levels or with composite immunoglobulin traits, accounted for by 32 loci. Variants at these loci also affect the risk of autoimmune diseases and blood malignancies and influence blood cell development. Notable associations include a rare variant at RUNX3 decreasing IgA levels by shifting isoform proportions (rs188468174[C>T]: P = 8.3 × 10-55, β = -0.90 s.d.), a rare in-frame deletion in FCGR2B abolishing IgG binding to the encoded receptor (p.Asn106del: P = 4.2 × 10-8, β = 1.03 s.d.), four IGH locus variants influencing class switching, and ten new associations with the HLA region. Our results provide new insight into the regulation of humoral immunity.