Broadway isn’t just for tourists. New York City residents are returning to the theater in numbers not seen in almost 20 years, according to statistics released Tuesday by the Broadway League.

The annual demographics survey showed city residents made up about 2.85 million admissions to Broadway shows in 2016-17 — or 22 percent of the annual 13.3 million admissions.

That’s the highest total since the 1998-99 season when 2.96 million admissions were attributed to city residents.

Charlotte St. Martin, of the Broadway League, credited a strong local economy and specialized programs — such as Viva Broadway and Kids Nights on Broadway — with the boost in local attendance.

“There are also more shows that appeal to all ages and that helps keep the attendance up,” she said.

The survey was conducted from June 2016 through June 2017 at 48 different shows. More than 11,900 people returned the questionnaire.

“A lot of the shows on Broadway now are shows that are star-dominated — from Amy Schumer to Uma Thurman,” said veteran theater and dance publicist Richard Kornberg. “You had Bette Midler in ‘Hello Dolly,’ and Bruce Springsteen with his own show.”

The smash-hit “Hamilton” can also be a factor.

“‘Hamilton’ has become such an event, it takes a year for people to get in to see it,” he said.

Kornberg said he was struck by the younger crowd in Broadway audiences. The survey showed admissions among people in the 25-34 age group was 2.34 million, also the highest in 20 years.

“Younger audiences want to see stars,” he said.

Laurence Maslon, a theater historian and arts professor at New York University, said new material on Broadway may be luring more local crowds.

“There’s new product that is not tourist-tested yet and New Yorkers will always be first in line to see that,” he said.

Roughly 61 percent of people surveyed were tourists from the U.S. and other countries and 18 percent were from area suburbs, including Long Island.

The survey also provided a snapshot of audiences.

The overwhelming majority of audiences are white — 76.8 percent in 2016-17 — while 8.4 percent are Asian, 7.1 percent Hispanic/Latino and 3.4 percent Black. The survey said 4.3 percent identified as Middle Eastern, mixed race or other.

The average Broadway theatergoer is 41.7 years old and has a household income of $194,940, according to the report. More than half of the people surveyed, 66 percent, were female.

Daniel Impellizzeri, who was on his way to buy tickets to “Charlie and the Chocolate Factory” at the TKTS Booth in Brooklyn Tuesday, said he goes to about two shows a month.

“When I go . . . I see all the theaters are pretty packed,” said the 57-year-old Kensington resident. “You can tell the New Yorkers from the tourists. During the week, you tend to see more New Yorkers.”

Upper West Side resident Jasna Vukovic, 56, was looking to buy tickets for her birthday next week. She was scouting the TKTS board to see what was available.

“I always look for a deal — there’s a lot to see,” she said. “It seems to have become a lot less of a production to see something last minute. They’ve got that figured out a little bit better.”

New Yorkers might be happier going to the Crossroads of the World now that the rogue Hello Kitty, Batman and other costumed characters have to stay in designated spots, rather than aggressively approaching pedestrians to pose for photos and ask for tips.

The Broadway League and other tourism groups had griped that people in costumes were discouraging locals, noting it is their No. 1 complaint.

“While it is a bit better with the civic zones, it is still one of the biggest obstacles for getting New Yorkers to come to the Theatre District,” St. Martin said. “The carnival-like atmosphere with harassment by the costumed characters, and the heavy congestion both from people and too many vendors, are the key detractors for those who want a quality evening in the theater.”