Arwyn raises a good point about split pins. Don't be tempted to use the next size up just because it snuggly fits the hole with nut removed. It will make later removal far more difficult, there should be some slack.
Don't go too smaller diameter though, the head should fill most of the gap between castellations to ensure pin stays in required orientation.
Bear in mind there are metric and imperial sizes.
Be wary of using stainless pins in tight fitting spaces as it may be difficult to bend ends over and worst still when you want to straighten them when removing - I'm thinking of those securing pedal linkage clevis pins here.
If you have to cut pins down to suit make sure one end is left a little longer than the other to ease splitting and bending to secure. Use long nose pliers with serrated ends to grip before bending.
Finally they are correctly called split pins not cotter pins
