Bar magnets look like regular rectangular magnets but they are magnetised in a specific way. To be a ‘bar’ magnet, the magnet must have the north pole on one end and the south pole on the other, magnetised down their length. This means that they are stronger on each end where the pole faces are located. This is different to rectangular magnets which are ordinarily magnetised so that their north and south poles are on the larger, flat faces and magnetised through their thickness.
Bar magnets are used when maximum strength is required from a small pole area. They are also commonly used to activate reed switches in proximity and counting applications. And, of course we must not forget the traditional alnico bar magnets, which are usually painted to identify the north and south poles and have been used in classrooms for decades!