The router's charger usually uses a standard power adapter, and its output plug size is not fixed at 5 mm. In fact, the plug size of the power adapter depends on its design and manufacturer, and there are common types of large (about 4 mm) and small (about 5 mm). Therefore, it cannot be said that the charger head of all routers is 5 mm. When purchasing or replacing router chargers, the appropriate charger head size should be determined according to the specific model and specifications.
Is that the router's power adapter? This cannot be generalized. The DC plug of many router power adapters is 5.5mm outside diameter, but this does not seem to have a uniform regulation. I have a D-Link router, its DC power interface diameter is 3.5mm.