The Sages prohibited swimming on Shabbat, because one might come to build or mend a raft. One who lifts his feet from the ground and floats in the water is considered swimming. However, if he does not lift his feet, then he is considered bathing, which is permitted (Beitza 36b; Shabbat 40b; SA 339:2). Technically, one may swim in a pool located in a fenced-off area and where the water is confined by the walls of the pool, as in such a case we are not concerned that one might build a raft or carry water outside the eruv. Nevertheless, since nowadays swimming has become one of the most common weekday leisure activities, it is prohibited as a weekday activity (uvdin de-ĥol). Furthermore, there is a concern that after swimming, people will wring out their bathing suits. Moreover, it is improper for one to waste free time on Shabbat with leisure activities instead of dedicating it to Torah study.
One may immerse in a mikveh on Shabbat to remove impurity. Even though the Sages prohibit immersing implements (tevilat kelim) on Shabbat, this is because it resembles fixing the implement, since as a result of the immersion the implement may be used. A person, however, may immerse on Shabbat to purify himself since he may anyway bathe in cold water and thus it does not resemble an act of fixing or improving something (Beitza 18a; SA 326:8). While it is true that, for several reasons, the Ashkenazic custom is to avoid bathing in cold water on Shabbat, when it is done for the purpose of a mitzva, the custom is not to be stringent (Rema, YD 197:2). Therefore, men who are accustomed to immerse as an act of piety may do so on Shabbat as well.
The poskim disagree whether the rabbinic ban on bathing on Shabbat applies to immersion in a mikveh. Some maintain that the Sages did not include immersion for the sake of a mitzva in their decree, and thus one may immerse in hot water as long as it was heated in a permissible fashion (Korban Netanel). Others maintain that the enactment applies to this immersion as well, and thus one may not even immerse in hot water on Shabbat (Noda Bi-Yehuda). Many are customarily lenient and immerse in hot water. Those who wish to be stringent should make sure that the water is lukewarm, lower than body temperature, as most poskim agree that one may bathe on Shabbat. Thus, one may certainly immerse for the sake of a mitzva.
. Even though technically one may wash one’s whole body in cold water, the Ashkenazic custom is to be stringent out of concern that one might wring out his hair upon leaving the water, that one might carry water four amot in a reshut ha-rabim, or that one might come to swim (Terumat Ha-deshen §255; Maharil Ĥadashot §139; MA 326:8; MB ad loc. 21). However, even those who are stringent regarding Shabbat agree that on Yom Tov one may bathe the entire body in cool or cold water. One who does so must be careful not to wring out his hair with his hands. He must dry off with a towel instead (SSK 14:11). Some write that even when using a towel, one must be careful to be gentle in drying off (Ben Ish Ĥai, Year 2, Pekudei 8). I did not include the Ashkenazic custom prohibiting bathing in cold water in the main text, because it rarely arises, and it applies only to those few individuals who normally bathe for pleasure in cold water. In contrast, if there is an element of anguish involved, we are lenient about washing in either cold or hot water. Nevertheless, it is clear that Ashkenazic custom forbids swimming in a pool. While it is true that Sephardic custom follows the letter of the law and permits both bathing in cold water and swimming in an enclosed pool in a reshut ha-yaĥid, nevertheless, it seems that swimming in a pool should be prohibited even for Sephardim. This is because people generally swim in swimsuits, and there is a serious concern that they might wring them out. Furthermore, in the past the entire leniency of swimming in a pool was relevant only to uncommon cases of individuals who had a small pool in their yard and would float around in it for a short while. In contrast, pools built today are meant to be used for extended periods. Because swimming in a pool is a normal leisure activity, it is considered a weekday activity. If swimming on Shabbat were permitted, people would waste time that they could use for Torah learning, and they would miss out on that key aspect of Shabbat. Yalkut Yosef 326:11 (in vol. 4, p. 69) states similarly. See also the laws regarding running and exercising, below 22:7-8.
. Terumat Ha-deshen §255 rules that according to the Ashkenazic custom, which does not allow bathing in cold water, a woman who could have immersed before Shabbat may not immerse on Shabbat. Accordingly, the Vilna Gaon writes that a man who had a nocturnal emission may not immerse on Shabbat. Nevertheless, the overwhelming majority of Ashkenazic poskim permit any immersion on Shabbat. Rema YD 197:2, AHS ad loc. 8, and Taharat Yisrael 14 rule accordingly with regard to women’s immersion. Those who permit men’s immersion include Olat Shabbat 326:15; Eliya Rabba ad loc. 5; Tosefet Shabbat 12; and Igrot Moshe OĤ 4:74.
The Sages did not prohibit immersion in hot water on Shabbat, according to Korban Netanel, Shabbat 2:100 and Ĥesed Le-Avraham §30 (as cited in SHT 326:5). Many Aĥaronim attest to the practice of women immersing on Friday night in hot water (Divrei Ĥayim 2:26; R. Yehuda Ayash in Responsa Bnei Yehuda 2:32; Responsa Divrei Yosef §64). In contrast, others maintain that immersion in hot water is included in the rabbinic prohibition (Noda Bi-Yehuda, 2: 24; Ĥakham Tzvi §11; Beit Meir, beginning of §326; Ĥayei Adam 70:1; and R. Akiva Eger 1:17). SHT 326:5 states that one may be lenient only under pressing circumstance. However, in practice many are lenient and permit women to immerse in hot water. Thus state Orĥot Shabbat 2:21, n. 30; Menuĥat Ahava 2:10, n. 173; and Badei Ha-shulĥan 197:17. Livyat Ĥen §79 states (following Ĥakham Tzvi) that le-khatĥila a woman should immerse during bein ha-shmashot (dusk), since rabbinic prohibitions on Shabbat do not apply to mitzvot that are undertaken during bein ha-shmashot. If she is unable to immerse during bein ha-shmashot, she may immerse in hot water on Shabbat. It seems to me that those who wish to be stringent should preferably immerse in lukewarm water, since there are three opinions regarding the nature of the prohibition of washing in hot water (mentioned in the previous section):
1) According to Beit Me’ir and R. Akiva Eger, even water that has been heated slightly to remove its chill is prohibited.
2) According to Ĥakham Tzvi §11, Ĥatam Sofer OĤ §146, and Tehila Le-David 326:3, the prohibition applies to lukewarm water, but water that has been heated merely to remove its chill is permitted.
3) According to Noda Bi-Yehuda 2:24, Ĥayei Adam 70:1, Zera Emet 1:71, and AHS 326:3, the prohibition pertains only to hot water, but lukewarm water is permitted.
Thus, even according to the opinion that one may not immerse in hot water, according to Noda Bi-Yehuda and those who follow his approach one may immerse in lukewarm water. If the heat of the water is slightly cooler than body temperature, it may be that Ĥakham Tzvi and those who follow his approach would agree that this is not forbidden. Therefore, one who wishes to be stringent should heat the water to body temperature or lower. The subsequent immersion thereby complies with the overwhelming majority of poskim, and at the same time does not cause suffering.