There’s a prohibition to count Jewish people. For the background see [[#Background of the issue]] below.
# There’s a prohibition to count Jewish people. <Ref>The source in Torah for the prohibition is found in Shemot 30:12 which says that each person counted must give an atonement in order to prevent a plague. Gemara Brachot 62b relates that when David HaMelech made a mistake to count the Jews a plague actually did affect the people. Gemara Yoma 22b rules that it's forbidden to count Jews even for a mitzvah purpose based on Shmuel 1, 15:4 which says that Shaul counted the people by means of lambs, giving one to each person and then collecting them again. Most achronim (Magan Avraham 156:2, Pri Chadash 55:1, Kaf HaChaim 13:10, S"A HaRav 156:15) hold that the prohibition still applies nowadays and are supported by the Rambam Temidin UMussafin 4:4. The Aynayim LeMishpat (Brachot 62b) says that there’s no prohibition nowadays based on Rabbenu Chananel in Brachot; however, the Sh”t Tzitz Eliezer 7:3 (Chapter 1 section 2) strongly disagrees with that explanation of the Gemara. All achronim agree that there’s still a prohibition in effect nowadays including the Magan Avraham 156:2, Gra (Aderet Eliyahu Parshat Ki Tisa). </ref> According to most authorities this prohibition is a biblical command. <Ref>Tzitz Eliezer 7:3(8:1) and Shevet HaLevi 1:34 write that there's a biblical prohibition to count Jews. However, Magen Giborim (Elef LeMagen 55:21) writes that there's no lo taaseh (biblical) but nonetheless it is forbidden. </ref># Counting Jewish people with Hebrew letters starting aleph, bet, gimmel and so on is forbidden. <ref> The Kaf HaChaim 55:11, Rav Mordechai Eliyahu in his comments to Kitzur S”A 15:3, and Yalkut Yosef 55:2 write clearly that counting aleph, bet, gimmel is forbidden. </ref>
===By means of something else===
===For a mitzvah===
# The prohibition applies even when counting for a mitzvah. <ref>Gemara Yoma 22b, Rambam Pirush Mishnayot Yoma 22b, Magan Avraham 156:2, Tzitz Eliezer 7:3(8:2) </ref>
# The minhag is to allow counting for a mitzvah using the פסוק of Hoshiyah Et Amecha…הושיעה את עמך וברך את נחלתך ורעם ונשאם עד העולם in order to count for a minyan. However, some say that it's only permitted if one only counts in one's head.<Ref>Kitzur S"A 15:3 writes that Minhag Yisrael to quote for a mitzvah purpose using the pasuk of Hoshiyah Et Amecha. Kesot HaShulchan 15:8 quotes the Kitzur S”A. Piskei Teshuvot 156:24 adds that it's also acceptable to use the pasuk VeAni BeRov Chasdecha quoting the Sefer HaOrah LeRashi vol 1 siman 56. Rav Modechai Eliyahu's comments on Kitzur S"A 15:3 writes that even using this pasuk one shouldn't point but count in one's head. Yalkut Yosef ([[Pesukei DeZimrah]] 55:2) holds that it's permitted for a mitzvah if one either counts in one's head or if one counts using the pasuk of Hoshiya. Revivot Efraim 4:44(132) quotes an achron who has a safek about this issue. Minchat Asher Parshat Bamidbar (Siman 1:4) tries to explain the Kitzur S"A saying that perhaps when using the pasuk it's not considered counting since one doesn't know which word in the pasuk corresponds to which number other than that the whole pasuk is 10 words. [He prefers this explanation over saying that there's some segulah unique to this pasuk that protects those counted thereby permitting it. Regarding whether this pasuk is unique, see Podeh Et Avraham (Mem #19) who writes that one may use pasuk of VeShinantem and Lekat Kemach HaChadash 55:8 who writes that counting with bracha of Hamotzei is incorrect.]Sh"t Divrei Zev 10:13 writes that it's permitted to count Jews for a minyan. However, Yalkut Yosef ([[Pesukei DeZimrah]], pg 351) argues based on the Sefer Itim (pg 352) who says it is a problem. See Yabia Omer YD 2:16(9). [See Orchot Rabbenu vol 3 pg 89, Or Torah 5766 Elul 136. Shelat Rav pg 167.]</ref>
# Many poskim permit counting in one’s thought (by looking and counting in one’s head without making any motions) for a mitzvah or any need. <Ref>Yalkut Yosef (Piskei DeZimrah 55 note 2, Sherit Yosef vol 2 pg 93) permits counting for a minyan in one’s mind. Sh"t Tzitz Eliezer 7:3:(7:39), Minchat Asher (Bamidbar 1) in name of the Kaf HaChaim Sofer and Kaf HaChaim Palagi permit. However, Etz Yosef (Yoma 22b; quoted by Piskei Teshuvot 156:24) is strict. </ref>
# Numbering Jewish graves is prohibited, however it’s permissible to number each section assuming that there are a different number of graves in each section. <Ref>Sh”t Igrot Moshe Y”D 2:117(2) </ref>
# It’s a problem of counting Jewish people when people or children standing in a line each recite their number. <Ref> Shevet HaLevi 1:34 </ref>
# Counting Jewish names on a list is a dispute. <Ref>Chatan Sofer (Y”D 106) in name of his father the חתם סופר who says that it’s forbidden Deoritta. </ref>
# Some hold that participating in the Israeli consenus is permissible. <Ref>Sh”t Shevet HaLevi O”C 9:35, Sh”t Mishpatei Uziel 4:2, Sh"t Seridei Esh 2:48, Menachem Kasher (Sh"t Divrei Menachem 1:36), Rabbi Unterman quoted in Techumin (vol 4 pg 335) </ref> while others forbid. <Ref> Rabbi Goren (HaTzofeh Sivan 5743), Rav Chaim Kanievsky (HaTzofeh vol 15 pg 8 col 1; Nachal Eitan 6:10(7)), Sh"t Tzitz Eliezer 7:3, and the Edah Charedit (HaEdah Behalotcha 5733). For further discussion of census see Shevet Halevi 6:20, 9:35, Teshuvot VeHanhagot 3:387, Tzitz Eliezer 7:3. </ref>
# It's forbidden to count part of Bnei Yisrael just like it is to count all of Bnei Yisrael. <ref>Tzitz Eliezer 7:3(8:5)</ref>
# Just like there is a prohibition on the one counting there's also a prohibition on the one being counted.<ref>Tzitz Eliezer 7:3(8:11)</ref>
==Background of the issue==
The first source which introduces the prohibition of counting Jewish people is from the פסוק in Ki Tisa כי תשא את ראש בני ישראל לפקדיהם ונתנו איש כפר נפשו ליהוה בפקד אתם ולא יהיה בהם נגף בפקד אתם: Rashi writes that the פסוק implies that the count incurs the Ayin Hara rather they should give half shekels in order to be counted and in this way they’ll be spared from a plague. According to this understanding of the פסוק there’s a general prohibition to count Jews directly and there’s also a danger of incurring a plague.
Nonetheless, there is an explicit Gemara Brachot 62 which says that after David sinned, Hashem said that he would make David falter even on something so simple every schoolchild would know and so it happened that David counted the Jews and there was a plague. Interestingly that Gemara quotes the פסוק in Ki Tisa and comments that it was something that everyone knew, seemingly implying that it’s a bona fide prohibition. Based on this understanding of the פסוק in Ki Tisa there’s a question as to why the Rishonim who listed all 613 מצות didn’t count this one. Some drew from this that actually the entire prohibition was Derabbanan (Rashbetz) while others answered that it wasn’t counted because it wasn’t explicit in the Torah and it’s only a negative command implied from a positive one which isn’t usually counted amongst the 613 (Divrei Emet).