NEW YORK — As the holidays near, retailers face a dilemma: Open on Thanksgiving and stand accused of ruining a national holiday, or stay closed and risk losing sales.

J.C. Penney, Staples and Macy’s are in the first camp, opening earlier this Thanksgiving in a bid to draw bargain hunters. Nordstrom and Costco Wholesale plan to remain shuttered, saying that their employees deserve time with their families.

While each strategy carries risks, the Thanksgiving Day holdouts face the possibility that consumers will be tapped out by the time they finally open when the sun rises on Black Friday. The possibility is even more acute as the choppy economic recovery restrains Americans’ spending and the Internet lets them devise detailed plans for landing the best deals.

“The cost to not open is more because it can cause market- share loss if your direct competitor is open,” Poonam Goyal, an analyst for Bloomberg Intelligence, said. “If the middle-income shopper only has $500 to spend and Wal-Mart snatches $400 of it Thursday, there’s only $100 left for retailers to snatch Friday.”

J.C. Penney said Thursday it will unlock its doors at 5 p.m., compared with 8 p.m. in 2013. Toys “R” Us will let in shoppers at 5 p.m., the same time as last year. Macy’s said last month it would open at 6 p.m., two hours earlier than last year. Nordstrom and Costco, meanwhile, plan to stay shut to give employees a break.

While Wal-Mart hasn’t announced Thanksgiving plans for this year, most stores operate 24 hours a day and would already be open on the holiday.

Representatives of J.C. Penney, Macy’s and Costco didn’t respond to requests for comment.

Even consumers who don’t venture outside may still do some shopping that day. Thanksgiving is poised to feature the seasons’ best offers online with steeper discounts than on Black Friday and Cyber Monday, according to Adobe Systems’ 2014 Digital Index Online Shopping forecast.

Despite some backlash on social media calling for the holiday to be preserved for family time, retailers are trying to meet customer demand. About 45 percent of consumers plan to shop on Thanksgiving, according to a survey released last month by New York-based consulting firm Accenture.

“Holidays are becoming an excuse for people to go shopping, so the notion people are hanging around the fireplace on a holiday is long gone,” Allen Adamson, chairman of North America for brand consultant Landor Associates in New York, said in an interview.

“People are used to shopping whenever they want to, whether the store is open or not.”

Malls are doing their part to help their tenants capture sales. Mall of America in Bloomington, Minnesota, will open at 6 p.m. on Thanksgiving and remain open until 10 p.m. the following day, said Dan Jasper, a spokesman. Last year, most of the mall’s 500 tenants opened on Thanksgiving, and the mall saw more than 230,000 visitors between then and the end of Black Friday. More are expected this year, he said.

To attract additional traffic, the shopping center is making this Thanksgiving night a family event, offering unlimited amusement-park rides until midnight, with ticket money going to charities, Jasper said.

“A lot of times, the consumers are looking for something to do,” he said. “They’ve spent the whole day with their families.”