בס"ד

Weekly Torah Portions and Special Sabbaths

by Dr. Irv Bromberg, University of Toronto, Canada email icon

[Click here to go back to the Hebrew Calendar Studies home page]

Join the Group.io logo Calendars LISTSERV


This page discusses rules for determining the regular weekly Torah portions (parshiot, or in the singular parshah), according to the rules followed by Orthodox Jews, intended to assist programmers who wish to implement an algorithm. My goal is to present the simplest possible rules in a comprehensive, unambiguous, top-down structured, strictly logical manner. Although a human with insight and experience might be able to determine the weekly Torah portion in fewer steps, especially by using table lookups, a computer program that follows these rules could arrive at the same answer in a fraction of a millisecond, for any date in the past, present or future.

This algorithm determines which Torah portions are combined, both in the diaspora and in Israel, for all 14 unique types of years on either the traditional Hebrew calendar or the Rectified Hebrew calendar (the rules are identical for both). The following table shows the "character" of each year type, indicated by 3 or 4 symbols, along with their exact frequencies in the full 689472-year repetition cycle of the traditional Hebrew calendar:

The 4-digit Hebrew year number to the left of each "=" sign is an example of the year type that is to the right of the "=" sign, and the small number (in parentheses) was the first year of that type after the Hebrew calendar epoch. Below that is the total count of that year type and its exact frequency and approximate percentage in the full calendar cycle. The omitted weekdays (1, 4, 6) are disallowed as the first day of Rosh HaShanah. Blank cells are length and weekday combinations that never occur. Hebrew calendar days begin at local sunset. After civil midnight the corresponding English weekday names are: 1 = Sunday, 2 = Monday, ... 7 = Saturday.

Start Rosh
HaShanah
on
435456 = 12/19 ≈ 63.2% Common Years (Non-Leap) 254016 = 7/19 ≈ 36.8% Leap Years Totals
by Weekday
Deficient 353 days
= 50+3/7 weeks
Normal 354 days
= 50+4/7 weeks
Perfect 355 days
= 50+5/7 weeks
Deficient 383 days
= 54+5/7 weeks
Normal 384 days
= 54+6/7 weeks
Perfect 385 days
= 55 weeks
2 = Yom Sheini 5773 (15) = 2D3
39369 = 13123/229824
≈ 5.7%
5780 (1) = 2P5
81335 = 81335/689472
≈ 11.8%
5793 (8) = 2D5*
40000 = 625/10773
≈ 5.8%
5779 (14) = 2P7*
32576 = 509/10773
≈ 4.7%
193280 = 3020/10773
≈ 28.0%
3 = Yom Shlishi 5786 (4) = 3N5
43081 = 43081/689472
≈ 6.2%
5782 (27) = 3N7*
36288 = 1/19
≈ 5.3%
79369 = 79369/689472
≈ 11.5%
5 = Yom Chamishi 5772 (7) = 5N7
124416 = 24/133
≈ 18.0%
5832 (23) = 5P1
22839 = 7613/229824
≈ 3.3%
5812 (3) = 5D1*
26677 = 3811/98496
≈ 3.9%
5771 (6) = 5P3*
45899 = 6557/98496
≈ 6.7%
219831 = 73277/229824
≈ 31.9%
7 = Yom Shabbat 5781 (26) = 7D1
29853 = 3317/76608
≈ 4.3%
5791 (2) = 7P3
94563 = 79/576
≈ 13.7%
5801 (19) = 7D3*
40000 = 625/10773
≈ 5.8%
5858 (25) = 7P5*
32576 = 509/10773
≈ 4.7%
196992 = 2/7
≈ 28.6%
Totals
by Year Length
69222 = 11537/114912
≈ 10.0%
167497 = 167497/689472
≈ 24.3%
198737 = 28391/98496
≈ 28.8%
106677 = 1317/8512
≈ 15.5%
36288 = 1/19
≈ 5.3%
111051 = 1371/8512
≈ 16.1%
689472 = 100%

The following table summarizes the number of Torah portions that are combined in Israel and in the diaspora for each of the 14 calendar year types. All year types in which Passover starts on Yom Chamishi or on Shabbat have one more combined Torah portion in the diaspora than in Israel. Only deficient leap years in which Passover starts on Yom Rishon have zero combined portions in both Israel and the diaspora. Leap years in which Passover starts on Shabbat have zero combined portions in Israel, but one combined portion in the diaspora. Seven is the maximum possible number of combined portions, occurring only in the diaspora in common years in which Passover starts on Yom Chamishi. In Israel six is the maximum possible number of combined portions, occurring in common years in which Passover starts on Yom Shlishi or on Yom Chamishi.

Start Passover
(15 Nisan) on
Year Length Common Years (Non-Leap) Leap Years
Example = Character Combined in Israel Combined in Diaspora Example = Character Combined in Israel Combined in Diaspora
1 = Yom Rishon Deficient 5781 (26) = 7D1 5 5 5812 (3) = 5D1* 0 0
Perfect 5832 (23) = 5P1 4 4
3 = Yom Shlishi Deficient 5773 (15) = 2D3 6 6 5801 (19) = 7D3* 2 2
Perfect 5791 (2) = 7P3 6 6 5771 (6) = 5P3* 1 1
5 = Yom Chamishi Deficient 5793 (8) = 2D5* 2 3
Normal 5786 (4) = 3N5 6 7
Perfect 5780 (1) = 2P5 6 7 5858 (25) = 7P5* 2 3
7 = Yom Shabbat Normal 5772 (7) = 5N7 4 5 5782 (27) = 3N7* 0 1
Perfect 5779 (14) = 2P7* 0 1

Those who observe only single High Holy Days yet live outside Israel can use the algorithm described herein either by modifying it to always use the rules for Israel, or by defining all locales as if they are inside Israel. This algorithm doesn't support the triennial Torah portion cycles that are followed by many Reform and some Conservative congregations, because the variants that they follow are too divergent to accommodate, and in recent history their rules have been subject to inconsistent changes.

I have specifically avoided using a direct "brute force" table lookup strategy (based on tables listing all parshiot for all Saturdays of all 14 year types of the traditional Hebrew calendar, including separate tables for the diaspora and for Israel), as is commonly found in printed works and probably many computer programs, even though such an algorithm would execute faster, because that approach is incompatible with calendar variants that allow any month to have 29 or 30 days, and because compiling all of the necessary lookup tables is a tedious and error-prone task. On the other hand, one who implements a computer program based on the algorithm and rules given herein will be able to automatically generate such tables (see also the heading "Verification" at the end of this web page), which might be useful for publishing error-free manual lookup charts.

Even though the algorithm allows some flexibility with regard to the underlying calendar structure, its logic nevertheless depends on the presence of the full standard set of High Holy Days throughout the year, otherwise it will run out of Torah portions near the end of the year! Computer programs that suppress High Holy Days in the remote past, for example for dates prior to the Revelation at Sinai, should avoid using this algorithm for such dates. In fact, there is little point in quoting a Torah portion for any date prior to the era of the Maccabees, who, after rededicating the Second Temple and declaring the festival of Chanukah in Hebrew year 3623, established the regular public Torah reading tradition that continues today. We don't know, however, how the Torah portions were adapted to the unpredictable observational Hebrew calendar, which allowed any month to have 29 or 30 days, depending on when the first new lunar crescent was seen, which was in use until the traditional fixed arithmetic traditional calendar was established in Hebrew year 4119.

In the second-last section of this page I will also give brief rules for determining if a Shabbat is special, that is not a festival or High Holy Day but having a special Haftorah reading rather than the one that belongs with the regular weekly Torah portion, or having some other ritual significance.

There are a certain number of Saturdays in the Hebrew year, depending on the starting weekday (Rosh HaShanah can only start on Monday, Tuesday, Thursday, or Saturday) and the length of the year (non-leap vs. leap; deficient, regular, or full), yielding a total of 14 possible year types. The list of Torah portions are to be sequentially read, starting with Bereishit on the Shabbat after Simchat Torah and continuing through and ending up at Haazinu on the last regular Shabbat before the Succot of the following Hebrew year. During that sequence certain Torah portions are combined into double portions, depending on the length of the year, the number of Saturdays "missed" from the regular sequence because of a festival or High Holy Day, and whether the locale is in the diaspora or in Israel.

The enumerated list of Torah portions follow. Note that the last portion, V'zot HaBrachah, is read on Simchat Torah and is never read during the morning service on a regular Shabbat, although its first aliyah is read during the Minchah service on Shabbat Haazinu and may be read on a Monday or Thursday morning prior to Succot (when a Monday or Thursday exists between Shabbat Haazinu and Succot).

1) Bereishit 10) Mikeitz 19) Terumah 28) Metzora 37) Shelach 46) Eikev
2) Noach 11) Vayigash 20) Titzaveh 29) Acharei Mot 38) Korach 47) Re'eh
3) Lech Lecha 12) Vayechi 21) Ki Tisa 30) Kedoshim 39) Chukat 48) Shoftim
4) Vayeira 13) Shemot 22) Vayakhel 31) Emor 40) Balak 49) Ki Teitzei
5) Chayei Sarah 14) Va'eira 23) Pekudei 32) Behar 41) Pinchas 50) Ki Tavo
6) Toldot 15) Bo 24) Vayikra 33) Bechukotai 42) Mattot 51) Nitzavim
7) Vayeitzei 16) Beshalach 25) Tzav 34) Bamidbar 43) Masei 52) Vayeilech
8) Vayishlach 17) Yitro 26) Shemini 35) Nasso 44) Devarim 53) Haazinu
9) Vayeishev 18) Mishpatim 27) Tazria 36) Beha'alotcha 45) Ve'etchanan 54) V'zot HaBrachah

The given date can be any weekday and can be a normal day, a festival, a High Holy Day, or a day of public fasting. If the given date is a regular weekday then the Torah portion to return is that of the next regular Shabbat.

This algorithm assumes that the given date has already been checked to determine if it is a festival or High Holy Day, and that information is available. It also assumes that the ordinal day numbers of all required dates are known relative to any convenient epoch, so that simple arithmetic operations can be carried out directly, such as adding or subtracting any integer number of days, or dividing an interval by 7 to determine the number of weeks that it contains.

The following are the only Torah portions that are ever combined:

On Shabbat, if the given date is a festival or High Holy Day (yom tov) or an intermediate festival day (chol ha-moed) then the weekly Torah portion is delayed and a special reading for that event is read instead.

On Monday and Thursday morning, if the given date is a yom tov or chol ha-moed, the last day of a 30-day month or the first day of any month (Rosh Chodesh), Hoshanah Rabbah, Purim, any day of Chanukah, or any public fasting day then the appropriate Torah portion is the special reading for that event instead of the regular weekly parshah.

In a computer program that supports calculations involving remote past dates, suppress all Torah portions prior to Hebrew year 3623, which was the year when the festival of Chanukah was declared by the Maccabees.

Otherwise we continue with the algorithm (names of variables are shown in italics):

Find the beginning of the annual cycle

Preset TargetShabbat to equal the given date.

If the given date is not Shabbat then search for the next regular Shabbat and set that date as the TargetShabbat.

Find the nearest Simchat Torah prior to the TargetShabbat. Outside Israel that is the 23rd of Tishrei, in Israel that is the 22nd of Tishrei.

Preset WorkingShabbat equal to the Shabbat after Simchat Torah, less 7 days.

Estimate the parshah based on weeks elapsed since Simchat Torah

Calculate the simple number of Saturdays that exist from Simchat Torah to TargetShabbat:

ParshahNumber = ( TargetShabbatWorkingShabbat ) / 7.

If PashahNumber < 22 THEN this is one of the first 21 parshiot that occur prior to Vayakhel and are never combined. Simply return the corresponding parshah name from the list above. Otherwise continue with the algorithm.

Prepare to loop

Set ParshahNumber = 21 and add 147 to WorkingShabbat (147=21×7).

Henceforth we will iteratively check through the portions until we get to the TargetShabbat, incrementing the ParshahNumber as we go.

At this point we need the following additional information:

Is the TargetShabbat in a non-leap year, or in a leap year?

Find the first day of Passover, on the 15th of Nisan, and determine its weekday.

Loop week-by-week checking for combined portions

Add 7 days to WorkingShabbat. If that Shabbat is yom tov or chol ha-moed then skip it.

Having found the next regular Shabbat, increment the ParshahNumber.

At the beginning of each iteration through the loop, default to not combining the portions for this week by setting Combined = FALSE. As we go through the algorithm, if the rules indicate that the portion is combined with the next then have the logic remember that by setting Combined = TRUE. At the end of each iteration through the loop, if Combined = TRUE then increment ParshahNumber to take into account that combined portion.

The only ParshahNumber values that require special checking are numbers 22, 27, 29, 32, 39, 42, and 51:

Case 22: Vayakhel (combine with Pekudei?)

Check how many Saturdays exist from WorkingShabbat until the day before Passover. If there are less than 4 then combine Vayakhel with Pekudei (there are only 3 Saturdays left before Passover in years in which these portions are combined).

Note that the algorithm goes only to the day before Passover so as not to include Passover in the count when Passover lands on Saturday, because Passover itself is a yom tov with its own special Torah portion. The WorkingShabbat is included in the count because it has to be a regular Shabbat.

Case 27: Tazria (combine with Metzora?)

Combine if NOT a leap year.

Case 29: Acharei Mot (combine with Kedoshim?)

Combine if NOT a leap year.

Case 32: Behar (combine with Bechukotai?)

Outside Israel: Combine if NOT a leap year.

Inside Israel: Combine if Passover does not start on Shabbat AND NOT a leap year.
The Passover exception only occurs in a 354-day year in which Rosh HaShanah starts on Thursday.

Case 39: Chukat (combine with Balak?)

Outside Israel: Combine if Passover starts on Thursday (because in such a case the second day of Shavuot falls on Shabbat in the diaspora).

Inside Israel: Never combine.

Case 42: Mattot (combine with Masei?)

Combine if there are less than 3 Saturdays from WorkingShabbat to Tisha B'Av (9th day of the month of Av), so that Devarim is the portion that will be read on the Shabbat before Tisha B'Av.

Case 51: Nitzavim (combine with Vayeilech?)

This is always the last Shabbat in Elul. The classical rule is to combine these portions if there is only one Shabbat between the coming Rosh HaShanah and Succot, but equivalently in terms of calendrical arithmetic it is simpler to combine if either Rosh HaShanah or Yom Kippur will land on Shabbat. The following novel rule is even simpler and works with all possible years types of the traditional or rectified Hebrew calendars:

Determine the number of days until the coming Rosh HaShanah, then combine if >3 days.

If, from the above exceptions, the WorkingShabbat has combined portions then increment ParshahNumber.

Continue looping for one week at a time until WorkingShabbat reaches the TargetShabbat.

Finish Up

For the case of a given date that is after Shabbat Haazinu and is a Monday or Thursday before Succot the above logic returns ParshahNumber = 1, but that does not apply until after Simchat Torah. Therefore if ParshahNumber = 1 AND the given date is before the 15th of Tishrei (the first day of Succot) then change the ParshahNumber = 54 to return V'zot HaBrachah instead.

Finally, return the name of the parshah as follows: If the TargetShabbat was found to have combined portions then the ParshahNumber was already incremented so from the list of Torah portion names return the name at ParshahNumber – 1, append a dash (or whatever separator is desired), and also return the name at ParshahNumber, otherwise it is a single portion so just return the name at ParshahNumber from the list.

Special Sabbaths

See also Jerrold Landau’s discussion of special days, here: https://jerroldlandau.com/Special_Days_(12).php.

Shabbat Mivarchim is the last Shabbat before Rosh Chodesh, whereupon the congregation recites a special blessing for the coming month, and the molad moment is announced, before commencing the Shabbat Musaf service.

As specified in the Talmud Bavli tractate Megilah page 31A near the end, Shabbat Machar Chodesh is the occasional Saturday that falls on the 29th day of a month, which is the day before Rosh Chodesh, on which the special Machar Chodesh Haftorah is recited. If that day is Shabbat Shekalim or Shabbat HaChodesh (explained below) then that usually overrides its status as Shabbat Machar Chodesh (and some congregations observe additional overrides), although commonly in such cases the first and last sentence of the Machar Chodesh Haftorah is recited after the special Shabbat Haftorah.
How often does Shabbat Machar Chodesh occur? For a detailed single-page analysis, accounting for cases where Machar Chodesh is replaced by a different Haftorah, click here: (Note that dates tabulated as "Never" are due to interactions with the Rosh HaShanah postponement rules: those dates can't fall on Shabbat unless the previous or next Rosh HaShanah were to fall on a disallowed weekday.)

Shabbat Rosh Chodesh is the occasional Saturday that falls on Rosh Chodesh (the first or 30th day of the month). It is always associated with ritual changes to the Shabbat Shacharit Amidah prayer (insertion of Yaaleh V'Yavoh [יעלה ויבוא] before V'Techezenah [ותחזנה]) and the Shabbat Musaf Amidah prayer (replacement of Ticanta Shabbat [תקנת שבת] through to Mikadesh HaShabbat [מקדש השבת] with Atah Yatsarta [אתה יצרת] through to Mikadesh HaShabbat V'Yisrael V'Roshei Chodeshim [מקדש השבת וישראל וראשי חדשים]).
Don't confuse this event with Shabbat HaChodesh, which can coincide, in which case the same ritual changes apply but the special Shabbat HaChodesh Haftorah is recited.
How often does Shabbat Rosh Chodesh occur? For a detailed single-page analysis, click here: (Note that dates tabulated as "Never" are due to interactions with the Rosh HaShanah postponement rules: those dates can't fall on Shabbat unless the previous or next Rosh HaShanah were to fall on a disallowed weekday.)

Shabbat Shuvah, also known as Shabbat Teshuvah, is the Saturday between Rosh HaShanah and Yom Kippur (day in Tishrei = 3rd to 9th, although the 9th is impossible if Rosh HaShanah can never start on Friday). On this day the congregation or yeshiva rabbi usually delivers a major derashah (longer than usual sermon), typically on the topic of repentence, during either the morning services or prior to the afternoon service. In addition to its ritual significance, at 2 am the following night Israel switches from Daylight Saving Time to Standard Time.

As of March 15th, 2005 (Gregorian) the law in Israel for Daylight Saving Time is: "Every year, from the last Friday before April 2nd at 02:00h until the last Sunday before the 10th of Tishrei at 02:00h, the time in Israel shall be advanced by one hour, thus leading Coordinated Universal Time by 3 hours."

Source: This law has appeared in Hebrew on the web site of the Israeli Government Ministry of the Interior, but the URL has been changed multiple times.

Shabbat Shirah is that Shabbat upon which the Torah portion Beshalach is read, 16 weeks after Simchat Torah. That Torah portion contains the song that the Children of Israel sang after safely crossing the Red Sea.

Shabbat Chanukah is a Shabbat falling within the festival of Chanukah, from the 25th of Kislev to the 2nd of Tevet, inclusive. If the 30th of Kislev is a Saturday then it is both Shabbat Chanukah and Shabbat Rosh Chodesh, it being both the 6th day of Chanukah and the first day of Rosh Chodesh.

On the Traditional and Rectified Hebrew calendars the 5th day of Chanukah (on the 29th day of Kislev) is never Shabbat, and the 6th day can only be Shabbat Rosh Chodesh when Kislev has 30 days (because the first day of Tevet is never Shabbat). When the first day of Chanukah (on the 25th of Kislev) is Shabbat Chanukah the eighth day of Chanukah (on the 2nd day of Tevet) is also Shabbat Chanukah, but this is only possible when Rosh HaShanah starts on Shabbat and the year is "perfect", with 30 days in both Cheshvan and Kislev.

Shabbat Shekalim is first day of Adar in non-leap years or Adar Sheini in leap years if that is a Saturday, otherwise it is the prior Shabbat (in the last 6 days of the prior month). When it lands on the first day of Adar in non-leap years or Adar Sheini in leap years it coincides with the second day of Rosh Chodesh. It can never land on the first day of Rosh Chodesh (the last day of Shevat in non-leap years or the last day of Adar Rishon in leap years), however, because in the traditional and rectified Hebrew calendar those days can never be Shabbat.

Shabbat Zachor is the Shabbat before Purim (day in last month of year = 8th to 13th).

Jerusalem only: If the 15th day of the last month of the year lands on Shabbat, then it is Shabbat Shushan Purim.

Shabbat Parah is the Saturday before Shabbat HaChodesh (days remaining before Nisan = 7th to 13th).

Shabbat HaChodesh is the first day of Nisan if that is a Saturday (in which case it coincides with Rosh Chodesh), otherwise the prior Shabbat (days remaining before Nisan = 0 to 6).

Shabbat HaGadol is the last Shabbat before Passover (day in Nisan = 8th to 14th). On this day the congregation or yeshiva rabbi usually delivers a major derashah (longer than usual sermon), typically on a topic related to the exodus from Egypt and/or Passover preparations, during either the morning services or prior to the afternoon service. When Shabbat HaGadol will be the day before Passover starts, however, some rabbis advance this derashah one week earlier so that it will be more relevant.

Shabbat Chazon (Prophesy) is the Shabbat before Tisha B'Av (day in Av = 4th to 9th). When the 9th of Av is Shabbat, observation of Tisha B'Av is postponed to the 10th of Av, hence this special Shabbat sometimes lands on the 9th.

Shabbat Nachamu (Consolation) is the Shabbat after Tisha B'Av (day in Av = 10th to 16th).

Verification

One who implements the rules documented herein ought to verify correct operation before relying on it. There are of course traditional sources that one may compare with. The reader can also compare with the "Events" window and Hebrew Calendar Zmanim export reports of my Windows freeware calendar calculator, Kalendis (in HTML, Tab-Delimited Text, or Comma-Separated Value formats), which follows the above rules as of version 9.259(981).

In addition, I generated full listings for all 14 calendar year types of the Traditional Hebrew Calendar for both Israel and the diaspora, which you can download in Microsoft Excel format by clicking here:

Torah-Portions.xls 228KB

See the "Explain" worksheet in the file. The spreadsheet requires Microsoft Excel or a compatible program such as LibreOffice Calc or OpenOffice Calc.

If you wish to know which dates a certain Torah portion or special Shabbat can fall on (limited by there being only 14 possible types of Hebrew calendar year) then you easily view that information in the spreadsheet by using its built-in autofilter menus. Similarly you can easily view which types of year have particular portions combined.


Updated 14 Cheshvan 5784 (Traditional) = 14 Cheshvan 5784 (Rectified) = Oct 28, 2023 (Symmetry454) = Oct 28, 2023 (Symmetry010) = Oct 29, 2023 (Gregorian)