In the back of a Concord, N.H., school gymnasium, as Bernie Sanders gave a triumphant speech after winning the New Hampshire Democratic primary, Kenneth Pennington stood staring at his smartphone, watching the numbers climb. Mr. Pennington, 24, the campaign’s digital director, saw thousands of people cramming onto the Sanders website at once, frantically trying to donate to his campaign. In one minute alone, 2,689 people had donated an average of $34.

“It was, obviously, a big day,” said Mr. Pennington, who found himself jumping up and down as the contributions rolled in.

Mr. Sanders has no official finance director, but with the help of people like Mr. Pennington, who built his first website at age 12, he has created a fund-raising juggernaut that has fueled his unexpectedly competitive race for president. The network his team built now threatens the once-daunting Clinton fund-raising model, which the family perfected over years of Beverly Hills dinners, Hamptons summer parties, and rewards for donors like nights in the Lincoln Bedroom.

Mr. Sanders, the Vermont senator, has raised some $96 million to Hillary Clinton’s $127 million, but he is gaining ground after raising $5 million more than she did last month. His operation is also highly efficient — Mr. Sanders simply asks his small donors to give online, and they do, while Mrs. Clinton has left the campaign trail repeatedly to fly to other cities for receptions with bigger contributors.