I am writing a tool in python to analyze the Talmud (e.g. word counts, how many times a specific phrase is used etc.) and I need a free downloadable text file of the Gemara, preferably with Rashi and Tosafos.

Thanks for all your help!!

  • 1
    Have you looked at Sefaria?
    – magicker72
    Dec 24, 2022 at 23:25
  • 1
    Mi Yodeya user Shalom says here that he downloaded the text from Mechon Mamre (there's a הורדת כל הבבלי link on that page). Rashi and Tosfos you'd need to get somewhere else though - I don't see it there.
    – Rish
    Dec 24, 2022 at 23:44
  • @Rish if you put it into an answer I might accept it, depending on whether anyone can find a rashi or tosfos one...
    – fartgeek
    Dec 24, 2022 at 23:50
  • @magicker72 Where can I download a text file on sefaria??
    – fartgeek
    Dec 24, 2022 at 23:51
  • @fartgeek github.com/Sefaria/Sefaria-Export
    – magicker72
    Dec 24, 2022 at 23:52

2 Answers 2


Sefaria has all these texts available for free. The easiest way to download them is to go to the Sefaria-Export github repository here. You can download the entire repository as a ZIP by clicking on the green Code button at the top-right, and then choosing "Download ZIP". The files you're looking for will be in the txt folder, then the Talmud folder, then the Bavli folder. If you just want to download the Bavli folder, you might try one of the solutions here.

  • Thank you very much!
    – fartgeek
    Dec 25, 2022 at 16:29
  • I have been having trouble with one issue: If a Tosafos starts one one amud, and ends on another, it cuts off at the end of the amud? Do you have a solution?
    – fartgeek
    Mar 1, 2023 at 1:33
  • @fartgeek A new tosafot starts with a דיבור המתחיל — some words from the gemara followed by a dash or hyphen. You should be able to find all locations that don't start with a few words + hyphen/dash with a regex search.
    – magicker72
    Mar 1, 2023 at 3:57

I provide the exact Python code how to this, here: How To Download Sefaria's Entire Talmud At Once

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .