
der Krampf
cramp
A sudden, painful, and involuntary contraction of a muscle or muscle group.
Mitten in der Nacht wachte ich mit einem schrecklichen Krampf in der Wade auf.
In the middle of the night, I woke up with a terrible cramp in my calf.
cramp
Loading your saved state.

cramp
A sudden, painful, and involuntary contraction of a muscle or muscle group.
Mitten in der Nacht wachte ich mit einem schrecklichen Krampf in der Wade auf.
In the middle of the night, I woke up with a terrible cramp in my calf.

pain / hassle
Colloquial for a very laborious, exhausting, or nerve-racking matter.
Die Steuererklärung ist jedes Jahr wieder ein einziger Krampf.
Doing the tax return is a complete pain every year.

seizure / convulsion
A seizure-like, uncontrolled twitching of the body caused by a disturbance in the brain, for example an epileptic seizure or a febrile convulsion.
Das kleine Kind erlitt einen Fieberkrampf und musste sofort ärztlich versorgt werden.
The small child had a febrile convulsion and needed immediate medical care.
In connection with muscles, 'Krampf' (cramp) is often used with the verbs 'haben' (to have) or 'bekommen' (to get). You usually have a cramp 'in' a specific body part.
Beim Schwimmen habe ich plötzlich einen Krampf im Bein bekommen.
While swimming, I suddenly got a cramp in my leg.
The meaning 'mühsame Angelegenheit' (laborious matter/hassle) is purely colloquial. The expression is often used with the verb 'sein' (to be) and the word 'einzig' (one single/complete) to emphasize the effort involved.
Das Ausfüllen der Formulare war ein einziger Krampf.
Filling out the forms was a complete pain.
In the medical meaning, 'Krampf' (seizure/convulsion) is often combined with the verb 'erleiden' (to suffer). Common compounds are 'Fieberkrampf' (febrile convulsion) or 'epileptischer Krampf' (epileptic seizure/convulsion).
Der Patient erlitt während des Anfalls einen schweren Krampf.
The patient suffered a severe convulsion during the seizure.
You can recognize the meaning from the context: If a body part is mentioned, it is a muscle cramp. If an activity or task is described as a 'Krampf' (pain/hassle), it is the colloquial meaning. Medical terms like 'Fieber' (fever) or 'epileptisch' (epileptic) point to a seizure or convulsion.
Der Umzug ohne professionelle Hilfe war ein totaler Krampf.
Moving house without professional help was a total pain.
seizure / fit / attack
Anfall and Krampf can refer to the same acute physical event from different perspectives. Anfall means the entire brief illness episode, while Krampf particularly emphasizes the uncontrolled jerking or movements. When talking about the whole event, Anfall is the better choice; when describing the muscle movements, Krampf is more appropriate.

Die unkontrollierten Zuckungen waren ein Krampf und hörten nach kurzer Zeit auf.
The uncontrolled jerking was a convulsion and stopped after a short time.
Bei seinem Anfall verlor er kurz das Bewusstsein und musste sich hinlegen.
During the seizure, he briefly lost consciousness and had to lie down.