May magnets be used on Shabbos?
Normally, attaching things together on Shabbos is forbidden due to the sewing or building prohibition, if certain conditions are met. Thus, the question is raised whether a magnetic attachment falls under the prohibition of sewing or building and meets the conditions of prohibition and thus may not be used on Shabbos. The following is a general background on the sewing prohibition, which is the main category of prohibition that using magnets can possibly fall under. In the footnotes in B, we will deal with the building prohibition and why it does not apply regarding magnets.
A. Background on the sewing prohibition:
The Biblical prohibition of sewing: One who sews two stitches and [makes] a knot [at its end], or three stitches even if he does not make a knot [at its end] is liable [to bring a sin offering]. However [one who sews] two stitches and does not make a knot is exempt [from Biblical liability, although it is Rabbinically forbidden]. The reason for this is because [in such a case the sewing] does not last.
Rabbinically forbidden to make two stitches without a knot: Although [one who sews] two stitches which is defined as sewing is not meant to last forever and does not make a knot is exempt [from Biblical liability], it is [nevertheless] Rabbinically forbidden.
Gluing things together: One who attaches papers or skins with glue of the scribes and the like is [doing] an offshoot of the sewing [prohibition] and is liable.
Is sewing/gluing permitted if it will only last temporarily, or will not last at all? It is clear from the above ruling, that even temporary sewing, which is defined as sewing that is not meant to last forever, is at the very least Rabbinically forbidden to be done on Shabbos. It is unclear however if this Rabbinical prohibition applies even if the sewing is not meant to last at all, not even for 24 hours. Seemingly, this same law and its subsequent doubt would apply likewise to gluing, and thus it is forbidden to glue things together even for a temporary purpose however if it is not meant to last at all then this matter would be under question.
B. The law:
It is permitted to use magnets on Shabbos and doing so does not fall under neither the sewing or building prohibition. One may thus play with games that involve magnets and may attach a non-Muktzah magnet to a fridge. This applies even if one does not have any plans of when to undo the magnet. Nonetheless, one should not build items using large and heavy industrial magnets which very firmly and strongly attach to each other for the sake of it lasting forever.
Magnets that are in the form of letters and are meant to make words when put next to each other: It is permitted to place magnetic pieces next to each other even if they form a word. If they form a letter or number or picture, then initially it is proper to avoid placing them next to each other on Shabbos, although one does not need to protest those who do so. Likewise, one may be lenient to allow children below Bar/Bas Mitzvah to play with such puzzles on Shabbos.
Reading the information on magnets and magnets that are Muktzah: Those magnets that contain on them business advertisements or any other writings that are forbidden to be read on Shabbos are forbidden, may not be read on Shabbos and are therefore considered Muktzah under the category of Keli Shemilachto Li’issur.
 See Piskeiy Teshuvos 340:19; 38; 313:4
 Admur 340:12
 Admur ibid
 Admur 340:17
 Regarding other prohibitions we find that although the sages forbade doing even temporary Melacha, such as to make an act that is only meant to last temporarily, or attach the parts of a vessel even if it’s only meant to last temporarily, nonetheless, they permit it if it’s not meant to last anytime at all, which is defined as less than 24 hours or within that day. The question therefore is raised as to whether we apply the same leniency as well to the laws of sewing. Vetzaruch Iyun! Indeed, the Poskim of today debate this matter in their discussion of whether or not it’s permitted to use diapers that contain an adhesive sticker being that is not meant to last even for a day.
 See Shulchan Shlomo 2:314 [One may play with games that have magnets]; Piskeiy Teshuvos 313:4
Other opinions: Some rule that if the magnet will be left in place for some time as is common by magnets of a fridge then it is forbidden. [SSH”K 46 [new print]; Rav Elyashiv in Migdal David p. 599 footnote 28]
 The reason it is not forbidden due to sewing: It is not considered Tofer as there is no third item that attaches the two things together but rather a magnetic pull. [see Beir Moshe 29; Piskeiy Teshuvos 38; 313:4]
The reason it is not forbidden due to building: It is not forbidden due to Boneh due to several reasons: 1) Boneh never applies when attaching two things together if it is common for it to be undone within 24 hours, and thus not meant to last at all. [See Admur 313:21] Most, if not all magnets are not meant to remain where they are forever, and on the contrary are specifically made as a magnet in order so one can have the flexibility to place it wherever he wants whenever he wants without him having to take it apart. Accordingly, people do not view attaching a magnet to an item as an act of building. Thus, even if one decides to leave the magnet in place for a long time, it is nonetheless permitted to be done being that placing the magnet on the surface is not considered that one is building on the surface. [See Piskeiy Teshuvos 313:4 and footnote 43 that due to this reason magnets that are not meant to last at all on the surface are not under any prohibition and are permitted according to all opinions, even the Chazon Ish who argues on the Rama’s and Admur’s allowance to put up decorated sheets. Although in his opinion, in certain cases permanent magnets could be under a prohibition as he explains there (i.e. It is placed on a wall or item that holds 40 Seah to benefit the item or is placed with much effort). However, based on our explanation here in one and two, there should never be a prohibition with magnets even when placed for permanent basis, and even when placed on a wall] 2) Furthermore, perhaps a magnetic pull is not viewed as any real attachment and hence it is no different than resting a heavy item on top of a fridge which certainly is not considered building even though it is technically attached to it on some level due to the gravitational pull. See also Admur 315:6 that it is permitted to even permanently hang a decorative sheet on a wall and hence we see that even permanent attachments are permitted to be performed on Shabbos if there is no actual attachment taking place between the two items and one is simply resting on the other. See Admur 313:21 3) The magnet serves no purpose for the item that it is sitting on and it’s entire purpose of being there is to benefit it. [See Piskeiy Teshuvos 313:4 and footnote 37 that is on this basis that it is permitted similar to the permanent attachment of decorative sheets]
 See the previous footnote that the sewing and building prohibition does not apply by a magnetic attachment even when attached for permanent purpose.
 See Piskeiy Teshuvos 313:4
The reason: As in such a case, certainly people view the attachment as permanent and as a form of building, and hence the first allowance brought in the previous footnote falls apart. Now, although one can still argue the second allowance in this case as well, practically it is not certain that we hold this way regarding magnetic attachment, and in any event it would not be proper to permit building things on Shabbos even if technically they were not forbidden according to law, and certainly in this case here that is possible that doing so even through using magnets is under a Biblical prohibition.
 See Piskeiy Teshuvos 340:19
 Piskeiy Teshuvos 340:19; So rule in general regarding forming words on Shabbos by attaching letters together: Chayeh Adam; Ketzos Hashulchan 144:10 regarding cases brought there [to sew letters onto a peroches, that if they are weekly sewn they contain no writing prohibition]; Igros Moshe 1:135; Piskeiy Teshuvos 340:7 and 16; Beir Moshe 6:26; Avnei Neizer, brought in Ketzos Hashulchan 144 footnote 4, rules that placing letters near each other has no prohibition.
 See Admur 340:6 for a dispute regarding opening and closing books that have letters on their side and that the custom is to be lenient although the Poskim conclude that initially one is to be stringent [See Ketzos Hashulchan 144:3; Shaar Hatziyon 340:25 in name of Achronim; Sefer Hachaim; Poskim brought in Piskeiy Teshuvos 340 footnote 98] and according to some opinions the same accustom leniency would apply regarding puzzles [see below] and the same would apply here regarding magnets. [See Piskeiy Teshuvos 340:19 footnote 175 in name of Michabrei Zemaneinu that by regular magnets that do not have such a strong magnetic attachment it is permitted according to the lenient opinion who permits opening and closing the books with letters and making puzzles]; So rule in general regarding puzzles: Beir Moshe 6:26; Yesod Yeshurun 1:53; SSH”K 16:23; Mishneh Halachos 6:89 and Beir Moshe 6:125 regarding the allowance to place torn pages. See Admur 340:6 who only records the 2nd reason in Teshuvos Harama 119, “As since the letters are already written and it is just that they are lacking proximity, this does not contain a writing prohibition. As since it is possible to bring them close together easily without doing any new action they are considered like they are close and standing and one is doing nothing with this proximity.” This is opposed to the 1st reason in Rama ibid who states the allowance is due to that the book is bound and meant for opening and closing. Thus, we see that Admur ibid negated this reason and accepted the reason that applies equally to jigsaw puzzles.
Other opinions: Some write that it is forbidden to play with magnets on Shabbos if it will form letters or numbers or pictures. [SSH”K 16:23; Chut Shani 20:1, brought and negated in Piskeiy Teshuvos ibid]
 Piskeiy Teshuvos ibid
 See Admur 307:21, 28, 29