Every pipe question comes down to one small equation: how much water must move, and how fast its allowed to travel. Answer those two and the bore that joins them is fixed.
Pipe Diameter Calculator solves either direction - the internal diameter a flow needs at your design velocity, or the flow a chosen pipe will carry - in metric or imperial units.
It works on the true internal bore, not the nominal label, so results transfer across materials.