The toxins of both _Clostridium tetani_ and _Corynebacterium diphtheriae_ are so toxic that you cannot use them for immunization, since the amount needed for proper antibody production would kill the individuals. For that purpose the toxins are "de-toxified" by reacting them with formaldehyde which takes away the toxicity but the resulting toxoids are still immunogenic. This happens by the reaction of the formaledehyde with the free aminogroups of the sidechains of the amino acids to form azomethin groups. This changes the protein so much, that it cannot bind to glangliosides any more which renders it untoxic. The immune system can still recognize unmodified parts (for this 8-10 amino acids in one stretch are enough) and make antibodies.