Be careful choosing which magnesium is best for migraines... your migraines. It comes in many forms. Glycinate is one of the best forms to take if you get migraines. But there are also two other formulations you need to know about… magnesium malate and threonate. This is really important because they may be much more effective at reducing your migraine attacks.
And there’s sulfate (a.k.a. Epsom salts) and magnesium oil for transdermal delivery!
But don’t get confused… there is also citrate which is recommended by some doctors. Oxide, hydroxide, gluconate, carbonate and chloride are not recommended for migraine reduction.
This is a great infographic courtesy of Swanson's Vitamins:
Magnesium supports your entire body. It’s involved in hundreds of your body's chemical processes that help you maintain optimal health. You can read more about that here.
Here are the ones you need to consider as a migraine sufferer:
This is one of the most bioavailable sources of magnesium, which means you will absorb and digest it well. It is the least likely to cause problems in your intestines, and with diarrhea. It is the one that is most commonly prescribed… but wait… this one is even better.
This one has become my first choice as the combination of magnesium and malic acid improves and supports ATP production at a cellular level. This increases energy and reduces pain. If you do experience diarrhea with this form, just reduce the dose or try the glycinate.
This one enhances memory and cognitive function. It has recently been studied and found to promote brain health and support learning. This is a third option for you to experiment with if you’re not getting the results you want from the other two.
If you hear the word ‘chelated’ this refers to a more complex process required to make the supplements. It means that the magnesium has been "chemically bound to amino acid proteins."  It tends to be more expensive, but it is easier to digest and absorb.
"Chelation is actually a natural process that occurs during digestion to help facilitate transport of minerals across the intestinal wall so they can be used by your body." 
There are others forms of magnesium out there, as I mentioned, but they differ in bioavailability and usefulness to you as a migraine sufferer. Some can be detrimental…
"You should also avoid magnesium glutamate and aspartate. These break down into neurotransmitters that can trigger headaches for many people." 
Also, please consider quality when you look into testing magnesium supplements.
Magnesium supplements are available in different forms… not just tablets. Orally there is: powder, capsules, liquid, syrup and tablets.
It also comes in: injections, intravenous magnesium and transdermal oil.
This is my choice… capsules with power in them comes third.
It's even more effective if you can take magnesium with cofactor Vitamin B6 (pyridoxine), Vitamin B2 (riboflavin) or a bioavailable B-complex. They can help speed up your absorption and provide faster relief.  There are great combination products like Migravent.
The dose can vary on each product, so make sure you read the supplement facts and serving size on each one. You can also consider your weight and age when choosing which magnesium is best for migraines. And then double check with your physician or naturopath.
Most ‘migraine-free’ adults need between 300 mg - 400 mg of magnesium daily. Here are the specific daily recommendations for magnesium intake from the National Institutes of Health (NIH) based on age.
The dose is different if you are pregnant or nursing, so make sure to check with your doctor.
The above numbers are just a general guideline. As a migraine sufferer, you might need more or less due to other factors that may affect your ability to absorb or store magnesium.
High levels of stress, drinking alcohol or having some other diseases can all affect the way magnesium is absorbed and used by your body.
The most common recommended dose is 200 mgs twice a day. However recent research suggests "that taking 300 mgs magnesium twice a day, either alone or in combination with medication, can prevent migraines." 
If you have a hard time sleeping, you can try taking 400 mgs before bed and see how that works instead of splitting it up through the day.
You can take more, up to 1,000 mgs per day but check with your doctor first before starting on any supplement regime, to make sure there is nothing else for it to interact with or cause problems.
Don't expect to see results immediately. Finding which magnesium is best for migraines and your body can take a couple of months.
You can read more on this post Can Magnesium Help Migraine?
Note: Magnesium, if taken in high doses, can cause unwanted side effects:
So please check with your doctor before deciding on supplementation and which magnesium is best for migraines.
Please get urgent medical attention if you have a severe reaction.
Also if you have kidney problems or kidney failure you should not take magnesium. As with any supplement, magnesium can interact negatively with other medications... so it's essential to check with your doctor before trying magnesium supplements.
Which Magnesium is Best for Migraines References:
1. Knight, Erin. (2017) Magnesium for Migraines: Why and How to Choose The Right Supplement [Online], Available at: https://www.engineeringradiance.com/2017/10/magnesium-migraines-choose-right-supplement/ Accessed Feb. 4, 2018.
2. National Institutes of Health, Office of Dietary Supplements (2018) Magnesium: Fact Sheet for Consumers. [Online], Available at: https://ods.od.nih.gov/factsheets/Magnesium-healthProfessional/ Accessed Feb. 4, 2018.
3. Swanson Blog (2016) What is the Best Magnesium Supplement Form for You? [Online], Available at: https://www.swansonvitamins.com/blog/chelsea/magnesium-types-compared Accessed Feb. 5, 2018.