Keilim28: 5
כִּפָּה שֶׁהוּא טָמֵא מִדְרָס, וּנְתָנוֹ עַל הַסֵּפֶר — טָהוֹר מִן הַמִּדְרָס, אֲבָל טָמֵא טְמֵא מֵת. חֵמֶת שֶׁעֲשָׂאָהּ שָׁטִיחַ, וְשָׁטִיחַ שֶׁעֲשָׂאוֹ חֵמֶת — טָהוֹר. חֵמֶת שֶׁעֲשָׂאָה תֻּרְמָל, וְתֻרְמָל שֶׁעֲשָׂאוֹ חֵמֶת; כַּר שֶׁעֲשָׂאוֹ סָדִין, וְסָדִין שֶׁעֲשָׂאוֹ כַר; כֶּסֶת שֶׁעֲשָׂאָהּ מִטְפַּחַת, וּמִטְפַּחַת שֶׁעֲשָׂאָהּ כֶּסֶת — טָמֵא. זֶה הַכְּלָל: כֹּל שֶׁשִּׁנָּהוּ לִשְׁמוֹ — טָמֵא; לְשֵׁם אַחֵר — טָהוֹר.
[If] a kerchief was tamei midras, and one gave it [over] to be [used as a cover for a] Torah scroll, it becomes tahor from midras [tumah], but it is tamei with corpse-tumah. [If] a waterskin was made into a mat or a mat was made into a waterskin, it is tahor. [If] a waterskin was made into a shepherd’s pouch or a shepherd’s pouch was made into a waterskin; [if] a pillow was made into a bedsheet or a bedsheet was made into a pillow; [if] a mattress was made into a flat sheet or a flat sheet was made into a mattress, [it remains] tamei. This is the general rule: Any [article] that is changed into [an article] of the same [type of use] retains its tumah; [if it is changed into an article] of a different [type of use], it is tahor.