Ty Bingham had to earn 21 merit badges on his way to becoming an Eagle Scout. It’s the highest rank in Boy Scouts, reached by more than 2.4 million boys since the award was first presented in 1912.

But the California teenager recently joined an even more exclusive group when he earned all of Scouting’s available merit badges — currently 137 — a feat achieved by fewer than 350 boys in the history of the organization, according to meritbadgeknot.com, an unofficial but authoritative site that tracks the achievement.

The Boy Scouts of America has introduced or discontinued some badges over the years, changing the total number available for scouts to earn. Some of the newer ones, like animation, game design and programming, reflect updates in technology, while traditional ones, such as archery, bugling and camping, remain.

The organization itself does not keep track of how many scouts have earned all of the available badges, but it said in a statement that the feat was “an extremely rare achievement.” Troy Pugh, the founder of Merit Badge Knot, estimated that an average of 18 scouts per year out of the 1 million who are eligible earn all of them.

Reaching that milestone requires, among other things, an obsessive attention to detail and time management and a network of adult counselors to help meet the particular requirements of each badge, scouts and their leaders said.

A drive to go to extraordinary lengths also helps.

For instance, Ty built in his backyard a 15-foot tall, 64-square-foot minihouse and started construction on a 50-foot long roller coaster made of wood. It’s not quite done yet, but he got credit for his 50 hours of work on it. That was all for just one merit badge, composite materials.

“I definitely gained a great respect for engineers who build these for amusement parks,” he said.

In 2015, Ty, who lives El Dorado Hills, Calif., about 30 miles northeast of Sacramento, had only 20 merit badges and a little more than two years left to earn the rest before he turned 18, the mandatory cutoff age.

He created color-coded spreadsheets with names like “Merit Badge Graph of Progress” and “Preparing the Time Requirement Badges.” He routinely worked on three merit badges a week, but even then it was a photo finish: On the day before he turned 18 in May, he worked 15 hours to complete his final four.

Interactive Feature | Get the Morning Briefing by Email What you need to know to start your day, delivered to your inbox Monday through Friday.

Kurt Finlayson, the scoutmaster for Ty’s troop, No. 528, marveled at his achievements.

“He’s very detailed when he’s doing things,” Mr. Finlayson said. “I knew he was going to make it because he is just a go-getter. It was crazy.”

It took an average of 10 hours to earn each merit badge. Along the way, Ty battled stress and anxiety. At times he was not sure he would finish. “It tested my patience — a lot,” he said.

For scouts pursuing this goal, staying motivated can be the greatest challenge.

Koby Nguyen and his brother Ben, of Irvine, Calif., earned all of the badges last year, a process that sometimes “felt like a drag,” Koby said in an email.

“Sacrificing countless weekends and staying up to do research on each merit badge were just some of the toughest parts about earning all of them,” he wrote.

Mr. Pugh, of Merit Badge Knot, earned all of the 126 badges that were available when he was a scout. His son, Christian, a highly decorated scout who became an Eagle Scout when he was 13, also earned all of them.

Mr. Pugh said in an email that he maintains the website as a way to honor the achievements of the scouts and encourage others. He compiles the list based on news reports and releases or reports from local councils that include a scout’s history.

Ty and Koby both said the scuba diving badge was the most challenging for them to collect, and Mr. Pugh said Christian struggled most with the signaling badge. The badge covers topics such as semaphore, American Sign Language, Morse code and the use of nautical flags.

It had been discontinued in 1992 but was brought back as part of the scouts’ centennial celebration and was only available in 2010. At 11 years old, Christian had to learn to send and receive Morse code at a required speed.

“A common last merit badge of scouts who have earned all of the merit badges has been bugling, but having played the trumpet in his school band class, this was not as difficult as it could have been,” Mr. Pugh wrote of his son’s experience. “Certainly, none of these compared to a young scout working on his dits and dahs of Morse code.”

Mr. Pugh said the scouts who make his list demonstrate confidence to tackle subjects they don’t understand and to complete tasks on time.

“While many kids these days spend hours of their days playing on their electronic devices or other less-than-productive endeavors, these scouts have their minds on preparing themselves for life,” he wrote.