Like many amateur genealogists, Ari Ehrlich started out just wanting to see if he was related to British royalty. You know, like Prince George and Princess Charlotte.

But last year’s gift of a subscription to Utah-based Ancestry.com ballooned a mild interest into a full-blown obsession (not a “mental disorder,” Ari insists, just an uncontrollable drive for discovery).

The site’s tools, data and DNA testing opened a door to bloodlines and human history, sucking the New York researcher into a vortex of marriage and death certificates, immigration papers, evolving surnames, mixed ethnicities and religious wars.

He began to pinpoint, for example, when Scottish-Irish freckles and ginger coloring made their way into an Ashkenazi Jewish gene pool.

Soon, the Jewish sleuth found himself on the computer incessantly, matching places and dates, and texting his latest find to his extended clan and beyond. He wanted to set up a table at a relative’s bar mitzvah so attendees could provide a cheek swab for a DNA test. He filed a Freedom of Information Act (FOIA) request with Homeland Security’s Citizen and Immigration Services to find the birthdate of his mother’s grandfather.

Yes, they are connected to King Henry VIII — “he had no grandchildren, but I’m descended from his sister”), to historical figures like Dolley Madison (“fourth cousin, eight times removed”) and Quaker William Penn (“my ninth great-uncle — we come from his brother, Edward Penn”) and American astronaut Neil Armstrong (“eighth cousin, twice removed”).

One of Ari’s Jewish great-great-greats hailed from medieval Spain, he quips in a high-pitched voice. “Looks like he survived the inquisition.”

As word spread of the genealogist’s successes in ferreting out relationships, the mayor of Tuxedo Park, N.Y., where Ari grew up, approached the family at a picnic and asked: “I’m adopted. Do you think Ari could find my birth mother?”

To that challenge, Ari replied: “I will not rest until I find her.”

Of course, he’ll have to do that detective work before bedtime. Ari just turned 12.

“My Aunt Lizzie got me the Ancestry account,” he says, “I’ve been geeking out ever since.”

All this “geeking out” has taught Ari how to do methodical research, to compile data, to try to explain inconsistencies in the records.

His mom, Katie Rosman, a reporter for The New York Times, says she has seen the work build empathy and wonder in the budding genealogist.

And he can’t keep himself from spreading the love.

On what would have been the 128th birthday of his great-great-grandmother Rose Stein Wyman, who escaped persecution in the Soviet Union, Ari posted an old photo of her on Instagram.

“She was very important to my mother,” he says. “I thought she deserved a birthday shoutout.”

Ari’s missive for his own mother’s birthday on Friday read: “I know I’ve only been alive since 2006, yet I have loved you since you were a simple DNA segment.”

The proud mom dates her son’s zeal for family history back to an earlier fascination with Greek gods.

“He had an encyclopedic knowledge of them,” Rosman recalls. “He liked to find out who came from whom — and how they got their stories from the people who created them.”

Then, last year, the family visited London for a three-day immersion in British history. Ari came back from the National Portrait Gallery, drawn to these bloodlines, how they crisscrossed one another and, inescapably, to the role religion played in family legacies.

He could see that “persecution leads to migration,” Rosman says. “People tend not to leave their homes unless there is a war or something outside of their lives.”

Little hints are strewn across seemingly bland certificates, waiting to be deciphered.

Consider, for example, the youngster’s hypothesis about his Irish ancestors — Sir Lancelot Jasper and Rose Sheppard.

Sir Lancelot was a Protestant (probably Anglican), Ari believes, because he had a title and at that time in Ireland, Catholics were not allowed to be in the aristocracy. His wife did not, which suggests she likely was Catholic.

Ari’s parents sometimes worry that their 12-going-on-25 son is spending too much of his spare time on the computer (“I assure you, he’s not playing video games,” Rosman says), and that he’s alienating his friends, who want to talk about soccer and the Yankees, not bloodlines and beliefs.

But they can’t see a reason to thwart him.

Ari’s dad, Joe Ehrlich, also sees a religious impulse behind his son’s searching.

For much of Ari’s childhood, the family lived in Tuxedo Park, which was a mostly Christian community.

The boy “takes a lot of pride in his Judaism,” Ehrlich says, but still felt a kind of otherness.

“We didn’t go to church, but a lot of our friends did,” the father says. “We didn’t decorate our house for Christmas, but went to other houses where they did.”

Uncovering Christians in the family’s past means, Ehrlich says, that “we are all from the same family tree — literally and figuratively.”

It further allows Ari to find common ground with anyone — including Mormons.

“The LDS Church very much has helped me,” he says. “Its historical records are beyond belief.”

He and the Ehrlich/Rosman family plan a trek to Utah, possibly to the 2019 RootsTech conference, which just ended for this year.

Ari doesn’t share the Mormon beliefs about heaven, but his mother has helped him forge a Jewish sense of life’s continuity.

Rosman’s mother died in 2006, while she was pregnant with Ari.

“I have done as much as I can to animate her for my children [including daughter Ella],” she says. “They know the songs she liked, the books she liked and everything about her.”

That way, the people who have died, Rosman says, “can still be with you.”

For Ari, his forebears don’t exist in some faraway afterlife.

“I want to know them, know their lives, their families, what they believed in, what wars they fought in, and how they survived,” he says like a wise old man. “It’s almost like I am there with them.”

Then Ari catches himself and says, slowly, “Actually, I am my ancestors.”

(Photo courtesy of Katie Rosman) Ari Ehrlich, a 12-year-old family history sleuth in New York.