Multiband linear dipole antennas are necessary for many strip- or bar-shaped gateway devices of the Internet of Things (IoT) for connectivity under various communication protocols. However, the conventional methodology to design multiband dipole antennas is generally empirically based. More frequency bands usually mean even more arms/slots, which results in increasingly bulky size. In this article, we introduce an algorithm to use the fewest arms to design any multiband linear dipole antenna. The algorithm is based on sharing arms after the effective ranges of mode excitation are determined by characteristic mode analysis (CMA). It also applies to multiple wideband or ultrawideband antennas. By this algorithm, an exemplified pentaband dipole antenna is designed, effectively covering 433, 868, 1176, 1575, and 2450 MHz bands for low-power wide-area network (LPWAN), global navigation satellite system (GNSS), and industrial, scientific and medical (ISM) applications. The antenna has only 2.5 pairs of arms. 50% of arms are reduced in comparison to traditional methods. This algorithm significantly simplifies the structure of a multiband dipole antenna, especially suitable for strip- or bar-shaped IoT devices.