Houseflies are annoying. The buzzing sound they make is infuriating, and they just can't grasp that glass is impossible to fly through even though it's transparent. Noisy and stupid: the worst possible combination.

They're also dangerous, as they carry a host of diseases. All in all, houseflies aren't welcome in our homes.

But they're not the only kind of fly, not by a long shot. The insects we call "flies" belong to a group called the Diptera, which contains at least 110,000 species.

That huge diversity means some flies have become truly spectacular. Two groups, the Mydas flies and timber flies, are in contention for the title of largest flies in the world.

Mydas flies are technically known as the Mydidae. They are found all around the world, but mostly in hot places with scrub vegetation. There are about 400 species.

The largest species, which is often trotted out as the largest fly in the world, is Gauromydas heros (or sometimes Mydas heros). It has been reported to grow to 7cm long.

However, when Erica McAlister of the Natural History Museum in London, UK measured her specimens, she found they were only about 6cm.

This may be close to the upper size limit for flies, at least with Earth's climate and atmospheric makeup the way it is. According to a 2005 study, ambient temperature sets a limit on the metabolic rate a fly can achieve, and thus on how big it can afford to grow.

We don't know much about Mydas flies' lifestyles.

Adult males have been observed feeding from flowers, perhaps drinking nectar. However, the larvae seem to be predators. G. heros larvae live in or near the ants of leafcutter ants (Atta sp.), where they may feed on the larvae of other insects that are eating the ants' waste.

Male G. heros defend territories centred on the mounds made by the ants. The females lay their eggs there, so a male that controls the area will secure plenty of matings.

The males of another species, Mydas ventralis, are also mildly territorial. They perch on elevated rocks, giving them an excellent view of their surroundings, and fly aggressively at rival males.

So if the Mydas flies aren't quite as big as has sometimes been reported, what about the timber flies?

They are technically called the Pantophthalmidae. They live in Central and South America, from Mexico in the north to Brazil and Paraguay in the south.

They get their common name because their larvae live in trees. Female timber flies lay their eggs on dying trees, and the larvae drill their way inside. To do this, they have evolved massive mandibles. If there are lots in one tree, they can reportedly be heard munching from several metres away.

They probably feed on the fermenting sap at the heart of the decaying tree, and may remain there for many months while they steadily grow. The wood doesn't contain much nutrition, says McAlister. "Because they eat such awful food, they take ages to develop."

When they eventually emerge as adults, they are giants.

"The largest ones we've got are around 8cm head to abdomen," says McAlister, who recently re-examined the Natural History Museum's collection of timber flies. Pantophthalmus bellardi can have a wingspan of 8.5cm. This convincingly trumps the Mydas flies.

The adults only live for a few weeks. They don't seem to eat, and accordingly have under-developed mouthparts. Instead, like many adult insects, they only do one thing: mate and lay eggs.

They don't move much. One study found that P. tabaninus doesn't try to fly unless disturbed. They seem to be quite shy and reclusive, and are hard to find.

In fact, despite their intimidating size the adults are quite harmless.

"They look just like horseflies so they scare the bejesus out of everyone, but they're pathetic," says McAlister. "They just eat wood."

Female timber flies have a long, sharp organ jutting out of their rear ends. "It looks like a massive sting but it's just the female's egg-laying tube," says McAlister.

Rather than having powerful defences, many of them mimic other insects that are more ferocious. They have modelled themselves on tarantula hawk wasps, which famously hunt large spiders such as tarantulas. These are fearsome insects, but the timber flies are nothing of the sort.

While the timber flies do seem to be the largest flies in the world, there is one another contender. There is a crane fly or daddy-long-legs known as Holorusia brobdignagius, which has very long legs.

According to the naturalist Mark Carwardine in his book Animal Records, if you stretch out its legs so they are straight they would reach 23cm. It's up to you if you think that counts.