Depending on which way you drive to Lego’s headquarters in Enfield, Connecticut, you’ll pass by either cornfields or concertina wire, or both. Every brick of every Lego set that will end up in the hands of any kid in North America passes through this mammoth facility, nestled among farms and three state prisons. It’s also the setting for Lego’s newest initiative, a program that brings mass customization to a product that, by its very nature, is already mass customized.

Beginning in late August, some of the bricks arriving at this 450,000-square-foot warehouse will travel to a small corner cordoned off by conveyor belts. That’s the home of Lego Factory, a new initiative that lets fans decide what they’d like to build and then lets them buy the necessary bricks. Customers create any structure they can imagine using Lego’s freely downloadable Digital Designer software. If they then decide to actually build their creation, the software, which keeps track of which pieces are required, sends the order to this corner of the Enfield warehouse. There, employees put all the pieces (which are grouped in standardized bags) into a box, along with instructions, and ship it off. “We’ve been toying with this idea for a long time,” says Steven Hawco, vice president of Lego’s Shop at Home division, which is overseeing the project. “And now technology is giving us the ability to actually do this.”

Lego put Digital Designer on its site last November. Although the company was initially mum about whether users would be able to purchase their designs, the software has proven popular, especially because users have been able to share their creations with others in the Lego community, one of the traditional building blocks of the company’s customer loyalty. Some of the most creative models have been renderings of the Danish Parliament building and M.C. Escher’s “Another World.”

Deciding how much latitude to give users is an essential part of any mass-customization program, says B. Joseph Pine, the author of Mass Customization: The New Frontier in Business Competition (Harvard Business School Press, 1993). “Fundamentally,” he says, “customers don’t want choice. They just want exactly what they want. Your job is to help them figure out what it is they want, because often they don’t know or can’t articulate it.”

One of the early lessons, for example, was that Lego couldn’t offer every piece in its inventory. Limiting the number of bricks also brought down fulfillment costs, which vary little from the traditional process. “In terms of production, we’re not adding layers of complexity,” says Michael McNally, Lego’s senior brand-relations manager. “We’ve already produced these elements. So it’s just a matter of rejiggering our fulfillment process and our packing process.”

Lego tried an earlier, less-complex version of this initiative in late 2000, with Lego Mosaic. Customers would submit a digital photograph, which would be Lego-fied into hundreds of little tiles used to create a black-and-white mosaic. Despite a brief surge in popularity in 2004 after being featured in O, the Oprah Magazine, it never really caught on, and a few leftover mosaic sets gather dust in the corner of the warehouse where Lego Factory resides.

McNally doesn’t think Lego Factory will share a similar fate, pointing to the 77,000 models that have already been designed using the software. “And that was before they even knew they would be able to buy them,” he says. While he doesn’t expect Lego Factory to turn the company around overnight — Lego lost $310 million last year on revenue of $1.1 billion — “it’s something that has huge potential for the company, and strategically, we’re looking to see where it hits and how deeply.” Executives hope that it could amount to as much as 10% of online sales.