For holding average-sized pins and badges, we recommend our D62 disc magnets, as they provide the appropriate amount of pull strength through a wide range of fabric thicknesses. If you will be holding large or heavy pins or badges, or will be holding through exceptionally thick material, then our D72 or D82 discs may be necessary to provide enough holding force.
Also check out our Sewing Magnets that are made specifically for use as magnetic closures.  They are intended to be sewn inside the fabric, remaining hidden from view.
They come in 3 different sizes and are sold in matched pairs.  Also note that some have a thin plastic cover that protects them from moisture, which is an excellent solution for anything that goes through the washing machine.
See our Sewing Magnet Article for an example of how to use them.  There, we describe how we replaced the Velcro fasteners on a pair of cargo shorts.