Sex reversal and sex ratio bias are common in mollusks, and temperature is one of the most important environmental factors influencing gonadal development and differentiation. Here, we obtained the full-lengh cDNAs of Hsdmrt1 and Hsfoxl2 and found that they were predominantly expressed in the gonads. Furthermore, Hsdmrt1 and Hsfoxl2 showed a sexually dimorphic expression pattern, with Hsdmrt1 biased toward males and Hsfolx2 favoring females. The expression of Hsfoxl2 was inhibited by Hsdmrt1. The sex ratios of 1–3-year-old mussels H. schlegelii were assessed, and the sex ratio bias was from male to female, accompanied by a significant decrease in log10 (Hsdmrt1/Hsfoxl2). And log10(Hsdmrt1/Hsfoxl2) value outside the interval [-2,1] was considered a stable sexual state. The sex reversal in H. schlegelii was reproduced by simulating temperatures, in which male mussels at 27 °C underwent sex reversal to become females; females at 19°C underwent sex reversal to males, and the log10(Hsdmrt1/Hsfoxl2) value was altered to be in the [-2,1] interval. These results support the hypothesis that an imbalance in the expression of either gene leads to a sex reversal and that this may be regulated by temperature. This study deepens our understanding of the mechanisms of sex reversal and gonadal development in bivalves.