The Shop Around the Corner is based on the play Illatszertar (or Parfumerie), written by Miklos Laszlo. Ernst Lubitsch bought the story rights to what would become The Shop Around the Corner in advance preparation for a collaboration between himself and producer David O. Selznick. When that deal fell through, he shopped his property to MGM on the condition that he produce and direct the film. MGM agreed to his terms, but only if he would commit to directing Ninotchka for the studio.

In adapting the play as The Shop Around the Corner, both Lubitsch and scenarist Samson Raphaelson drew upon their personal histories. Lubitsch had worked in his father's tailor shop in Berlin as a youth, and Raphaelson had worked in a shop during the World's Columbian Exposition in Chicago just before the turn of the century. 

James Stewart was at the top of Lubitsch's list to play the simple Alfred Kralik because the actor was "the antithesis of the old-time matinee idol; he holds his public by his very lack of a handsome face or suave manner." At first, European actress Dolly Haas was penciled in for the female lead, but Lubitsch had second thoughts about casting an unknown actress for American audiences, and preferred Margaret Sullavan instead. Lubitsch waited for Stewart and Sullavan to become available in the midst of their busy schedules. In the meantime, he shot and completed Ninotchka, starring Greta Garbo and Melvyn Douglas.

In preparation for her character, Margaret Sullavan purchased a simple dress for $1.95 that she thought a shop girl would wear but Ernst Lubitsch took one look and told her it was too stylish. To make sure his film was stripped of the glamour usually associated with him, Lubitsch ordered that dress be left in the sun to bleach and altered to fit poorly.

Stewart and Sullavan had known each other a long time before making The Shop Around the Corner. Both were in a summer stock company called the University Players. It was there that Stewart realized his potential as an actor, so he followed Sullavan and fellow player Henry Fonda to New York to begin an acting career in earnest.

Even though Sullavan was infamous for her quick temper and disdainful attitude towards Hollywood, Stewart counted working with her as one of the great joys of his professional career. And because he knew her personally, he was more equipped than most of the cast and crew members to deal with her frequent and volatile emotional outbursts. 

Even Stewart could get flustered working with Sullavan, though, and one day it took him forty-eight takes to get a scene right. Stewart said: "We were in this little restaurant and I had the line: 'I will come out on the street and I will roll my trousers up to my knees.' For some reason I couldn't say it. She was furious. She said, 'This is absolutely ridiculous.' There I was standing with my trousers rolled up to my knees, very conscious of my skinny legs, and I said, 'I don't want to act today; get a fellow with decent legs and just show them.' Sullavan said, 'Then I absolutely refuse to do the picture.' So we did more takes."

Soon after wrapping principal photography, Lubitsch talked to the New York Sun in January 1940. "It's not a big picture, just a quiet little story that seemed to have some charm. It didn't cost very much, for such a cast, under $500,000. It was made in twenty-eight days. I hope it has some charm."

At the film's January 25, 1940 premiere at Radio City Music Hall, Lubitsch remarked, "I have known just such a little shop in Budapest...The feeling between the boss and those who work for him is pretty much the same the world over, it seems to me. Everyone is afraid of losing his job and everyone knows how little human worries can affect his job. If the boss has a touch of dyspepsia, better be careful not to step on his toes; when things have gone well with him, the whole staff reflects his good humor."

The modestly produced The Shop Around the Corner was a surprise hit, earning international profits of $380,000 at a time when Hollywood films were waning in the European market. Its influence has continued to be felt in various reincarnations of the story, first as a Judy Garland film musical called In the Good Old Summertime (1949), then as a 1963 Broadway musical entitled She Loves Me that was revived in 1993. In You've Got Mail (1998), the story was updated to the electronic age by having the secret lovers played by Tom Hanks and Meg Ryan correspond through email.