A properly sized mainspring will fill half of the available area in the barrel. It is easy to calculate the dimensions of the barrel; you will need at least a fragment of the old mainspring to specify the appropriate thickness.
Change the items in the yellow boxes and see the Results below.
This calculator, provided by Horology - The Index, is one in a series of repair calculations.