To evaluate the effect of dietary rapeseed meal (RM) supplementation on cecal trimethylamine and bacteria in laying hens with different flavin-containing monooxygenase 3 (FMO3) genotypes, a 3 × 2 2-factorial arrangement was employed using FMO3 genotypes (AA, AT, and TT) and dietary RM (0 and 14% of diet) as the main effects. At 50 wk of age, 36 hens of AT genotype and 36 hens of TT genotype were randomly allotted to one of the 2 dietary treatments, and each dietary treatment consisted of 3 replicates with 6 birds each. A total of 12 hens with AA genotype were allotted to one of the 2 dietary treatments that consisted of 3 replicates with 2 hens. Hens were fed 0% RM in a corn-soybean (SM) diet for one wk before the 6-week feeding trial period. Dietary RM supplementation increased trimethylamine (TMA) concentrations in both egg yolks (P < 0.0001) and cecal chyme (P < 0.0001). Dietary RM supplementation increased bacterial abundance and diversity (P < 0.0001). Weighted UniFrac, Nonmetric Multidimensional Scaling, and analysis of similarity (R-ANOSIM = 0.1516; P-value = 0.014) indicated distinct clustering was dependent on diets rather than FMO3 genotypes. Twenty-four phyla (most dominant, Bacteroides, Firmicutes, and Proteobacteria) and 229 genera were identified in the cecal samples. Compared with the SM diets, RM diets increased the proportion of Firmicutes (P = 0.004), Proteobacteria (P = 0.006), and Firmicutes:Bacteroides (P = 0.001), and some low-abundance phyla (P < 0.01), whereas the abundance of Bacteroides was lower (P = 0.0002). The abundance of 42 genera varied with dietary types. Six phyla and 35 genera were positively correlated with TMA concentration in the cecal chyme. In conclusion, the major TMA-producing bacteria in cecal were from Firmicutes and Proteobacteria phyla. The major TMA-producing bacterial genera could be from the genera that positively correlated with TMA concentration.