This sounds easy however two of the major brands, Hozelock and Gardena measure their water pipe differently to the industry standard and so this has made it very confusing for some customers. Both Hozelock and Gardena measure the diameter of their water pipe as an internal diameter. As an example Hozelock will list their micro irrigation pipe as having a diameter of 12mm. The measurement that they have taken relates to the internal diameter.
Water pipe should be measured as an external diameter. The reason that water pipe is measured in this way is because different pipes are used for different pressures or applications. As an example a 20mm water pipe may have a pressure rating which varies from 4 and up to 12 bar pressure. The difference is the strength of the pipe and the thickness of the wall. So a 20mm 4 bar pipe will have an outside diameter of 20mm and a wall thickness of 1.2mm and the 12 bar would still have an outside diameter of 20mm but a thicker wall 2.8mm.
So you can now see that the reason we measure the outside diameter and not the inside is so that the compression fittings will fit regardless of the rating of the water pipe.
To summarise you measure the outside diameter of a water pipe
To find out which size you should buy please refer to the faqs which pipe size should I buy