Bacillithiol (BSH), the alpha-anomeric glycoside of L-cysteinyl-D-glucosamine with L-malic acid, is a major low-molecular-weight thiol in Bacillus subtilis and related bacteria. Here, we identify genes required for BSH biosynthesis and provide evidence that the synthetic pathway has similarities to that established for the related thiol (mycothiol) in the Actinobacteria. Consistent with a key role for BSH in detoxification of electrophiles, the BshA glycosyltransferase and BshB1 deacetylase are encoded in an operon with methylglyoxal synthase. BshB1 is partially redundant in function with BshB2, a deacetylase of the LmbE family. Phylogenomic profiling identified a conserved unknown function protein (COG4365) as a candidate cysteine-adding enzyme (BshC) that co-occurs in genomes also encoding BshA, BshB1, and BshB2. Additional evolutionarily linked proteins include a thioredoxin reductase homolog and two thiol:disulfide oxidoreductases of the DUF1094 (CxC motif) family. Mutants lacking BshA, BshC, or both BshB1 and BshB2 are devoid of BSH. BSH is at least partially redundant in function with other low-molecular-weight thiols: redox proteomics indicates that protein thiols are largely reduced even in the absence of BSH. At the transcriptional level, the induction of genes controlled by two thiol-based regulators (OhrR, Spx) occurs normally. However, BSH null cells are significantly altered in acid and salt resistance, sporulation, and resistance to electrophiles and thiol reactive compounds. Moreover, cells lacking BSH are highly sensitive to fosfomycin, an epoxide-containing antibiotic detoxified by FosB, a prototype for bacillithiol-S-transferase enzymes.