It turns out it does pay to have good penmanship — especially if you’re in the Torah business.

On June 3, Jews around the world will celebrate the festival of Shavuot, which celebrates the revelation of the Ten Commandments to Moses and the Israelites who escaped slavery in Egypt.

To mark the occasion, members of the Chabad-Lubavitch Hasidic sect in Brooklyn gave The Post a rare look at the world of Torah scroll making — a laborious process that’s remained mostly unchanged for thousands of years.

The Torah, the first five books of the Old Testament handwritten exclusively on parchment, can fetch $20,000 to upwards of $120,000, a sky-high sum affected by one thing more than any other: good handwriting.

“You get something from a beginner that nobody knows, you’re going to get something that looks like it was written by a first grader,” said Rabbi Mendel, who prepares the animal hides.

To get the year-long process in motion, someone has to commission a new Torah — typically a synagogue congregation, or an individual who wants to donate one to a synagogue to honor a dead relative.

Mendel, 30, whose Crown Heights shop produces about three Torahs a year, starts the process by rendering the hides, which come to him either salted or frozen. “It’s meat, it’ll spoil,” he noted.

Calfskin is usually used — about 65 animals are used to make a complete torah. The animal itself needs to be kosher — goats, deer, sheep can also be used to make torahs — but does not necessarily have to be killed at a kosher slaughterhouse.

The hides are first treated in a caustic lime bath, which helps separate the fats and oils in the skin.

They’re stretched so they dry flat, and when ready, they’re scraped, sanded and cut to size, with indentations made so that the scribe is able to write straight; new scrolls contain 245 columns with 42 lines in each.

Using a feather quill or reed pen, a specially trained scribe, called a sofer, is expected to perfectly replicate every letter of the Torah — all 304,805 of them — in the Assyrian-style Hebrew script.

Scribes — who make a declaration each time they begin work that their actions are for the holiness of the scroll — are not allowed to work from memory, and instead copy the letters from a kosher scroll, or certified copy of one, according to Rabbi Shmuel Klein, who is in training to be a scribe.

Only black ink, traditionally prepared with tannic acid and iron sulfate, is allowed. And any mistake, or if the letters are too close together, will render the work un-kosher, and they’ll have to go back to fix it.

“It’s used as a parable — if one Jew has a problem, it doesn’t affect just that one Jew — the whole Jewish nation has a problem,” Mendel said.

Towards the end of the Torah, the scribe will leave an outline of the last few letters so that members of the community who commissioned the work can fill them in and have a hand in its creation.

The scribe checks his work, but so does modern technology. A scanner and computer program are used to ferret out errors, which are scraped out with a blade.

Members of the community participate in the completion of a new Torah by writing a letter with the assistance of the scribe.Photo: Ira Berger

When the scribe deems his work perfect, a thread made of sinew is used to tie the parchment sheets together to make one scroll, which can weigh about 25 pounds and stand two feet tall. The scroll is attached with sinew to two wooden shafts called atzei chayim — trees of life— covered with an embroidered cloth, and topped with an ornate keter, a crown, typically made of silver.

It’s all a labor of love.

“The Torah is what keeps the Jewish people around, and that’s why we’re still around,” Mendel said.