The first part of the Book of Numbers discusses the census of the Israelites that Moses conducted after the erection of the Tabernacle. Several reasons are given for this census; among them:

1) Out of love for His people, G‑d counted us at important junctures of our history. The completion of the Tabernacle was one of these occasions. 2) To ensure that the Jews had sufficient numbers to merit the dwelling of the Divine presence upon them. 3) To ascertain how many warriors the Jews would have in their upcoming battles to conquer Canaan.

Nachmanides explains that rather than count the people directly, the method of counting was to collect a half-shekel coin from each person and then count the coins.

"And the number of the children of Israel shall be as the sand of the sea, which shall neither be measured nor counted." This method is described in the book of Exodus, in the context of an earlier census : "When you take the sum of the children of Israel according to their numbers, let each one give to G‑d an atonement for his soul when they are counted; then there will be no plague among them when they are counted. This they shall give, everyone who goes through the counting: half a shekel..."

To actually count Jews directly is forbidden, as the prophet says: "And the number of the children of Israel shall be as the sand of the sea, which shall neither be measured nor counted."

What is the reason for this prohibition? The commentaries say that counting Jews directly can bring a judgment on the individuals who, if not deemed worthy, may be punished.

In addition, the Panim Yafot explains that when the Jews are in a state of unity, they are connected to their Source and do not need added protection. When they are counted as individuals, they become "separated" and are subject to individual scrutiny.

For this reason, King Saul counted his army by means of requiring each soldier to submit one shard of pottery, which he then counted, and later on by using kid goats.

King David, on the other hand, forgot this prohibition and counted the Jews directly. This resulted in a plague which killed some 70,000 Jews.

Some say that King David certainly did not forget the prohibition, and he, too, counted the Jews indirectly; the problem was that he performed the count simply to satisfy his own curiosity, and not for a specific purpose. Counting Jews without a purpose is forbidden even if done indirectly.

Although the prohibition against counting Jews is not included in the Code of Jewish Law, it is discussed by the later Halachic authorities.

Some of the details of this law are: