BETHLEHEM, Pa. — Christmas won’t come earlier this year, but the gifts might.

Just in time for the winter holiday shopping season, Amazon, Wal-Mart, Macy’s and other retailers are working behind the scenes to make sure they can deliver online orders to shoppers faster.

Retailers are building bigger warehouses –some the size of 20 football fields – to handle shipments. They’re also sending orders to shoppers directly from their stores and using sophisticated software that tells them the quickest, cheapest way to get orders shipped. And Amazon is cutting the time it takes to process an order from hours to minutes by using robots to pull items for shipment in its warehouses.

It’s a race for time by retailers as more people shop online. U.S. online sales are expected to increase 12 percent to $371 billion this year, accounting for 10 percent of overall retail sales, says Forrester Research. But as online shopping grows, so does the impatience of shoppers who want their orders fast.

Traditional brick-and-mortar stores are trying to catch up to Amazon.com, which set the standard for speed with its two-day delivery for members of its Prime loyalty program who pay $99 a year. But even Amazon feels pressure to please customers who have little tolerance for lengthy delivery waits.

“I would like to plan ahead, but I’ve been able to wait until the last minute to get things done,” said Keri Early, a Clyde, Illinois, resident who orders from Amazon frequently.

For many retailers, the goal to meet the demands of shoppers like Early for speedy service is to make two-day delivery standard. That’s half the average for standard delivery for the top 40 online retailers, according to data company StellaService. But most are stopping short of guaranteeing customers faster deliveries.

Wal-Mart says it aims to get packages to shoppers who get standard shipping within two days for a majority of the U.S. this holiday season. The retailer now uses 83 of its more than 4,500 U.S. stores to ship to customers.

The world’s largest retailer also is spending $1.2 billion to $1.5 billion in online investments this year and $1.1 billion next year. That’s up from last year’s $1 billion. The investments are squeezing profit: Wal-Mart stock tumbled Wednesday after it warned earnings would be down as much as 12 percent next year in part because of its heavy spending on e-commerce.

Still, Wal-Mart is spending to stay competitive with online rivals. Since last year, the world’s largest retailer has opened five warehouses across the country in Bethlehem, Pennsylvania; Fort Worth, Texas; Plainfield, Indiana; and Atlanta to handle online orders. Next year, Wal-Mart plans to open another center in southern California, one in Dallas and two more in Florida.

The new warehouses each will ship hundreds of thousands of orders daily, four to five times its dozens of existing smaller warehouses. Each new warehouse has several million items, five times the network of older warehouses. That will enable Wal-Mart to offer more consolidated orders arriving in fewer boxes.

“This is going to allow us to be more efficient, to do it faster, to do it cheaper and be more accurate with the orders, which is important with the customers,” said Greg Foran, CEO of Wal-Mart’s U.S. business.

One of Wal-Mart’s two Bethlehem warehouses opened in July and is considered the retailer’s crown jewel. It has two towers with four stories of the fastest moving items of the season that can be retrieved through a computerized chute.