Magnesium Test
Overview
A magnesium test is a simple test, usually a blood test, that checks how much magnesium is in your body. Magnesium is a mineral your body needs to keep muscles, nerves, the heart and bones working properly. The test helps your doctor see whether your level is too low, normal, or (less often) too high.
Key facts
- It is usually done with a small blood sample from a vein in your arm, and sometimes a urine (wee) sample is also tested.
- Magnesium levels can be affected by what you eat, how well your gut absorbs food, your kidneys, alcohol, and some prescribed medicines.
- A magnesium result on its own rarely tells the whole story, so doctors usually look at it alongside other tests such as kidney function and other minerals like calcium and potassium.
Yes. Magnesium testing is common. It is often checked as part of a group of mineral tests, especially if you are unwell, in hospital, or taking medicines that can affect your mineral levels.
Anyone can have a magnesium test. It is checked more often in people with kidney problems, diabetes, long-term gut problems like coeliac disease or Crohn's disease, people who drink a lot of alcohol, people taking certain prescribed medicines, people who have been vomiting or had diarrhoea for a while, and during pregnancy.
Symptoms
- A fit (seizure) or losing consciousness
- A very fast, very slow or irregular heartbeat, or chest pain
- Severe difficulty breathing
- Sudden severe muscle weakness, especially if you cannot move or speak properly
- Collapse or being unresponsive
- ⚠Chest fluttering or palpitations that keep coming back
- ⚠New tingling or numbness in the hands, feet or around the mouth
- ⚠Muscle cramps that are frequent, painful or spreading
- ⚠Confusion, unusual drowsiness or a change in behaviour
- ⚠Being unable to keep fluids down because of vomiting or diarrhoea
Common symptoms
- Muscle cramps, twitching or weakness
- Feeling very tired or low on energy
- Poor appetite, nausea or feeling sick
- Tingling or numbness in the hands and feet
- A fluttering or pounding feeling in the chest (palpitations)
- Low mood or poor sleep
- If levels are high: feeling sick, flushing, drowsiness, weak muscles or feeling unusually slow and foggy
Symptoms in children
- Poor feeding or slow weight gain in babies
- Being unusually irritable or sleepy
- Muscle twitching or shaky movements
- Tummy upset or vomiting
- In severe cases, fits (seizures) — this needs emergency help
Symptoms in older adults
- Feeling weak or unsteady on the feet, which can lead to falls
- Confusion or memory problems
- Tiredness that is put down to 'just getting older'
- Loss of appetite or weight loss
- Irregular heartbeat, especially in people with heart conditions
Causes
Main causes
- Not getting enough magnesium in your diet over a long period
- Gut problems that stop you absorbing it, such as long-lasting diarrhoea, coeliac disease, Crohn's disease, or surgery on the bowel
- Losing magnesium through the kidneys, which can happen with some kidney conditions, diabetes, or after certain illnesses
- Drinking a lot of alcohol regularly
- Vomiting or diarrhoea for several days
- Some prescribed medicines can lower magnesium, such as some water tablets (diuretics) and some stomach-acid medicines
- High magnesium is much less common and is usually linked to kidney problems, or to taking magnesium-containing laxatives or indigestion remedies for a long time
Risk factors
- Long-term kidney disease
- Type 1 or type 2 diabetes that is not well controlled
- Long-term gut or bowel conditions
- Regular heavy alcohol use
- Taking several medicines that affect minerals
- Poor diet or eating very little for a long time
- Pregnancy, when the body's needs go up
- Being in hospital or seriously unwell, which is why levels are often checked there
When to see a doctor
See a doctor urgently if:
- You have palpitations, chest pain, or a heartbeat that feels fast or uneven
- You have a fit, faint, or feel very drowsy and confused
- You cannot keep fluids down for more than a day because of vomiting or diarrhoea
- You have new, spreading muscle weakness or severe cramps
Book a routine appointment if:
- You have ongoing muscle cramps, twitching or tingling that you cannot explain
- You feel constantly tired and low on energy despite rest
- You have a long-term gut condition, kidney condition or diabetes and want your mineral levels reviewed
- You are taking medicines that might affect magnesium and have new symptoms
- You are taking magnesium supplements or magnesium-based laxatives or indigestion remedies and feel unwell
Diagnosis
A magnesium test is done by taking a small sample of blood, usually from a vein in your arm. It is often done alongside other tests, so you may have several tests from the same sample. If your result is unusual, your doctor may arrange a repeat test, a urine test, or tests of your kidney function and other minerals to work out why.
Tests that may be done
- Blood magnesium test, taken with a small needle from a vein
- Other blood minerals, usually calcium and potassium, checked at the same time
- Kidney function tests, to see how well your kidneys are working
- Blood sugar test, to check for diabetes
- A 24-hour urine test (collecting your urine over a day) to see how much magnesium your body is passing out
- Tests for gut conditions if your doctor thinks you are not absorbing food well, such as blood tests or stool tests
- An electrocardiogram (ECG), a quick heart tracing, if you have palpitations or an irregular heartbeat
What to expect at your appointment
You usually do not need to fast for a magnesium test unless your doctor asks you to. The blood sample takes a few minutes, and you may feel a quick sting when the needle goes in. You can eat, drink and go about your day normally afterwards. Results often come back within a few days, and your doctor will explain what they mean alongside your other tests and symptoms.
Treatment
Treatment depends on what the test shows and why. If your magnesium is mildly low, your doctor may first look at your diet and any medicines you take. If it is clearly low, or you have symptoms, they may suggest a magnesium supplement in a form and amount they choose for you. If your magnesium is high, the focus is usually on finding the cause and stopping anything that is adding extra magnesium. In serious cases, treatment is given in hospital.
Self-care at home
- Eat a wide range of magnesium-rich foods such as green leafy vegetables, nuts, seeds, beans, lentils, whole grains and bananas
- Keep a note of your symptoms so you can tell your doctor whether they are getting better or worse
- Tell your doctor and pharmacist about everything you take, including vitamins, herbal remedies and over-the-counter medicines
- Cut back on alcohol if you drink regularly
- Stay well hydrated, especially if you have had diarrhoea or vomiting
- Do not start or stop supplements or prescribed medicines on your own — check with your doctor or pharmacist first
Medical treatments
Your doctor will tailor treatment to the cause. For low magnesium, they may recommend magnesium supplements taken by mouth, or, if levels are very low or you cannot absorb them, magnesium through a drip in hospital. They may also strengthen your diet, review medicines that lower magnesium, and treat any underlying gut, kidney or blood sugar problem. For high magnesium, they will usually stop anything containing extra magnesium, review kidney health, and in more serious cases give treatment in hospital to bring levels down safely. You should never start or change any supplement or medicine without advice from a qualified healthcare professional.
When is surgery considered?
Surgery is not used to treat a magnesium problem. However, your magnesium level may be checked before and after an operation, because it can affect your heart and muscles during recovery.
Living with this condition
Most people with a magnesium problem carry on with normal life. You may have a repeat test after a few weeks or months to check that things have settled. If you take a supplement, keep it out of reach of children and store it as your pharmacist advises. Keep a simple log of symptoms such as cramps or tiredness, so you can say clearly whether things are improving.
Lifestyle tips
- Build meals around fresh, minimally processed foods
- Include a magnesium-rich food most days, such as spinach, pumpkin seeds, almonds, black beans or oats
- Limit very high intakes of alcohol
- Stay active with gentle regular exercise, which helps muscles and sleep
- Get enough sleep and manage stress where you can
- Have any long-term conditions such as diabetes or kidney disease reviewed regularly
Diet and exercise
A balanced diet is the safest way to keep magnesium steady. Food sources are absorbed gently and are very unlikely to push your level too high. Good choices include dark green vegetables, nuts, seeds, wholegrains, beans, lentils, and moderate amounts of dairy. Exercise is generally helpful — walking, swimming, cycling or strength work — but if you have painful cramps or feel weak, start gently and build up. Always check with your doctor before taking extra supplements on top of a balanced diet, because more is not always better.
Mental health and emotional wellbeing
Low magnesium can be linked with low mood, poor sleep and feeling anxious, and living with ongoing tiredness or cramps can be frustrating. It helps to tell someone how you are feeling — your doctor, a friend or family member. Support groups for long-term conditions can be reassuring, and talking therapies are available through your local health service. If you ever feel hopeless or have thoughts of harming yourself, please reach out for crisis support straight away — contact your local emergency number or a crisis line in your country.
Prevention
Many magnesium problems can be prevented or at least made less likely. Eating a varied diet, limiting alcohol, and having regular reviews of your medicines all help. If you have a long-term condition that affects your levels, such as kidney disease, diabetes or a gut condition, keeping it well managed is the best protection. Be cautious with over-the-counter magnesium supplements, laxatives and indigestion remedies — check with your pharmacist before using them regularly.
Vaccines
There is no vaccine for magnesium problems. Staying up to date with routine vaccinations is still a good idea for your general health, especially if you have a long-term condition.
Screening programmes
There is no general screening programme for magnesium. Testing is done when there is a reason — for example, symptoms, a long-term condition, or medicines that can affect your levels. If you think you are at risk, ask your doctor whether a magnesium test is appropriate for you.
Complications
If left untreated
- Ongoing muscle cramps, weakness and tiredness that affect daily life
- Heart rhythm problems, which can be serious if magnesium stays very low or very high
- Low levels of other minerals such as calcium and potassium, because magnesium helps balance them
- Weaker bones over time, which raises the risk of fractures
- Fits (seizures) in severe cases
- In high magnesium, slowed heart rate, low blood pressure and drowsiness
Long-term outlook
The outlook is good. Most magnesium problems are found early and are easy to manage once the cause is understood. Many people improve with simple changes to diet or medicines, and serious problems are uncommon when levels are checked and treated. If you have a long-term condition, regular check-ups keep things on track — and your healthcare team is there to help at each step.
Find support
External links open third-party websites. Ruqelo Health is not responsible for external content. Listing an organisation does not imply endorsement.
Always verify with your doctor
Health guidance differs by country and region. This page is general education and may not match the guidelines, medicines, or practice where you live. Discuss your concerns with your own doctor or healthcare provider, and follow local guidance where it exists.
Important notice This information is for educational purposes only. It does not replace professional medical advice, diagnosis, or treatment. Always consult a qualified healthcare provider about your specific situation. If you are experiencing a medical emergency, call your local emergency services immediately.
Related conditions
Sources and guidance
No guideline names this topic
No health guideline or clinical chapter that names this exact topic is cited here. This page is for general education and information only. It is not a diagnosis, a treatment plan, or personal medical advice. Check with your own doctor and follow their advice. If symptoms are severe, sudden, or worrying, get medical care promptly, and call your local emergency number in an emergency. Ruqelo LLC is not responsible for medical or legal outcomes from decisions based on this information.
Last updated: October 24, 2026
Educational note: This information is for education only and is not a diagnosis.
Use it to support, not replace, advice from a licensed clinician.
If symptoms are severe, worsening, or urgent, call your local emergency number or seek emergency care.
Guidance may differ by country or region. Confirm local recommendations with a qualified healthcare provider.