I have a history of headaches. Not full blown migraines (usually), but long nagging low-grade ones. It’s almost guaranteed that some of this is caused by spending too much time in front of the computer, but what am I going to do? Spend less time in front of the computer? Pfft.

Here are some of the things that seem to work for mitigating them.


If I might be dehydrated or caffeine withdrawn, fix that first. Both will cause headaches that are not otherwise amenable to being fixed but are easily fixed by removing the relevant deficiency.

I tend to always be drinking water and usually drink all my caffeine first thing in the morning, so it’s relatively rare for me to be either of these, but schedule disruptions happen.


My primary drugs of choice are ibuprofen and caffeine (usually as coffee). Caffeine is helpful even if your headache isn’t caused by caffeine withdrawal (Exceptions: Excess of caffeine can cause headaches. Also some people get caffeine induced migraines). Something something blood flow.

Ibuprofen, well, it’s a pain killer. It seems to work really well for me. My experience is that NSAIDS are very effective on me and paracetamol does nothing except for make me worry about my liver (it’s perfectly safe at sensible dosages, but I don’t like things where taking too much of them can kill you).

That being said, I take probably more ibuprofen than I should, and probably with less food in my stomach than I should. I don’t particularly recommend following my lead. Note also that if you’re doing this on a daily basis then this can cause headaches [Edit to add: This is true of all over the counter painkillers, not just NSAIDS]

Most of the time some combination of the above is enough to shake most headaches for me. When it doesn’t and I’m verging into migraine territory I like some combination of paracetamol and codeine (I know I said paracetamol doesn’t work on me, but it apparently has a synergistic reaction with codeine. Also you can’t get neat codeine, and the amount of codeine in an ibuprofen + codeine mix without that reaction is apparently basically a placebo). I like migraleve, but anything with paracetamol and codeine in it is probably a good idea. I usually deploy this on top of ibuprofen, which I am given to understand is perfectly safe.

If you are regularly getting headaches you cannot self-medicate with over the counter drugs then you should see a doctor and not consult some guy on the internet’s self care advice.

Tension headaches

Fun fact: I trained as a massage therapist.

Supplementary information for fun fact: I didn’t qualify (scheduling conflicts between exams for my massage course and my mathematics degree). Also, as a massage therapist I make an excellent software developer.

However, this does get me a bit ahead of the game in terms of self-care for tension headaches.

In theory if you’re being sensible you should try these techniques first. In practice I usually reach for the ibuprofen and either the problem goes away or is sufficiently severe that I’m in no mood to be sensible. However, these are particularly useful if you have persistent ongoing headaches that you think might be tension related. The NHS guidelines on identifying a tension headache are useful, but to be honest if you’re feeling any sort of muscular tension and experiencing a headache you might as well try these. It may not help the headache, but it will distract you for a bit, won’t hurt and will probably help the muscle tension.

Upper back and shoulders

These are really hard to self massage, because most of the things you can do to self massage will make the other side worse. I use stretches to deal with these. I used to have a “The original backnobber 2” (yes that’s its actual name), which looks like an elaborate sex toy and I found almost entirely useless. Some actual elaborate sex toys may be more useful here – e.g. the Hitachi magic wand is usually sold as a self-massage device – but I can’t say that my experience with vibration systems (from a massage chair. Stop snickering) has actually been very useful for reducing upper back and shoulder tension.

I do have some stretches that I do to help if I have tense shoulders:

  • Lace your fingers together with your hands in front of you, palms facing outwards and push them forward as far as you can.
  • Do the same thing but with your hands behind you and your palms facing towards your body, then bend at the waist 90 degrees so that your hands are straight up into the air and stretch backwards.
  • Do ridiculous exaggerated shoulder rolls
  • Twist your upper body from side to side around a vertical axis

If these don’t help, I recommend an actual back massage. Get a friend or partner to give you a back rub (I don’t currently have any good recommended tutorials for that, sorry) or go to a professional (which is advice I don’t follow enough myself).

One technique that does work for me reasonably well is as follows:

  • With both hands at the same time, dig your fingers in between your shoulder blades and your spine (never put pressure on the spine! It’s the muscles next to it). Your elbows should be as high up as they would go.
  • Gradually lower your elbows, pulling your fingers along with them, until they come off the top of your shoulders.

Can’t promise that one helps, but it feels nice at least.

Neck and scalp

These are fortunately much easier to self-massage.

I have three main techniques here:

  • Temple rub: You’re probably already doing this one. Take your three main fingers and place them on your temples. Press reasonably firmly and move the skin in circles, from front to back.
  • Scalp massage: This is much easier if you’re not me and still have hair. Grab thick bunches of it near the roots and use it to move your scalp about. Similar to the temple rub, do it with both hands at once, rotating from front to back. I usually do this once on top and once at the back of my skull near the top. If, like me, you lack hair, you can do something similar by using the base of your hands, pressing firmly into the skin and using friction to move the scalp.
  • Massage the side of the spine from the base of the necks to where it joins your spine. Do this by placing the tips of your fingers there, digging in and pulling outwards. Then move up slightly and repeat the process until you run out of spine.

You can also do neck stretches by slowly rotating your head through a head shake as far as it can go in each direction, and also by bending your neck from side to side.

These don’t always help, and they don’t usually completely get rid of a tension headache for me, but they often reduce it to a level where a previously intolerable headache becomes tolerable and much more manageable with painkillers.


Sleep is also the cause of a lot of my headaches, but the worst ones usually go away after I’ve slept. If a headache is rendering me useless, sometimes the best solution is to deploy the above solutions (sans caffeine) and go to bed early and hope it will be better in the morning. It usually is.