Kidney Infection (Pyelonephritis)

Medically Reviewed by Poonam Sachdev on February 13, 2024
8 min read

A kidney infection, also called pyelonephritis, is when bacteria or viruses cause problems in one or both of your kidneys. It's a type of urinary tract infection (UTI).

Your kidneys' main job is to remove waste and extra water from your blood. They're part of your urinary tract and make pee that carries the waste out of your body.

Your urinary tract also contains:

  • Ureters. These thin tubes, one for each kidney, carry pee to your bladder.
  • Bladder. This stores urine.
  • Urethra. This tube carries pee from your bladder out of your body.

If any of these parts gets germs in it, you can get a UTI. Most often, your bladder gets infected first. This can be painful but isn't usually serious.

But if the bad bacteria or viruses travel up your ureters, you can get a kidney infection. If you don't get it treated, it can cause life-threatening problems.

Symptoms of a kidney infection include:

  • Dark, cloudy, or bloody pee
  • Pee that smells bad
  • Fever and chills
  • Loss of appetite
  • Needing to pee a lot
  • Feeling pain when you pee
  • Pain in your lower back, side, or groin
  • Upset stomach, nausea, and vomiting

Children younger than 2 may have a high fever.

Adults over 65 might not have any of the usual symptoms. They might only have symptoms affecting their thinking, such as:

  • Confusion
  • Jumbled speech
  • Hallucinations

Kidney infections usually start with a bladder infection that spreads to your kidney. Bacteria called Escherichia coli are most often the cause. These bacteria live in your intestines, where they don't cause any problems. But they do cause problems in your urinary tract. Other bacteria or viruses can also cause kidney infections.

How long does it take for a UTI to turn into a kidney infection?

If you don't treat a bladder infection quickly, bacteria can travel up to your kidneys. How long it takes for germs to spread from the bladder to the kidneys is different for each person.

Anyone can get a kidney infection. But people assigned female at birth are more likely to get one because they get more bladder infections.

The urethras of people assigned female at birth are shorter than those of people assigned male at birth. This makes the urethra closer to the vagina and anus, which makes it easier for bacteria or viruses to get into the urethra. Once they do get in, it's a shorter trip to the bladder. From there, bacteria can spread to the kidneys.

You're more likely to get a bladder and kidney infection if you're pregnant. This is because of hormone changes and because your baby puts pressure on your bladder and ureters and slows the flow of urine.

Any problem in your urinary tract that keeps pee from flowing as it should can raise your chances of a kidney infection, such as:

A blockage in your urinary tract. Anything that slows or stops the flow of pee through your urinary tract lets bacteria back up into your kidneys. A kidney stone, enlarged prostate, or sagging (prolapsed) uterus can all block pee from leaving your body.

Trouble emptying your bladder. Nerve problems, infections, swelling, or surgery can make it harder for your bladder to fully empty. Bacteria can grow in the pee that builds up inside your bladder.

A different shaped urinary tract. Changes in the shape of your urinary tract can make it harder for pee to get through.

Vesicoureteral reflux (VUR). This is when pee flows backward from your bladder to your ureters and kidneys. VUR most often affects babies and young children.

You're also more likely to get a kidney infection if you have:

Nerve damage. You feel pain and other symptoms of a bladder infection when your nerves send signals to your brain. If those nerves are damaged, you may not know when you have an infection or if it has spread to your kidney.

A urinary catheter. This tube drains pee from your bladder through your urethra. You might need a catheter after surgery or if you can't get out of bed for a few days or longer. Germs can travel through the catheter to your bladder and kidneys.

A weak immune system. Diseases like HIV and type 2 diabetes make it harder for your immune system to fight off germs. Some medicines also turn down your immune system response and increase your risk of infections. These include medicines you take after an organ transplant to stop your body from rejecting the new organ.

After asking about your symptoms, your doctor will probably do tests including:

  • Urine analysis to look for bacteria in your pee. They'll also look for white blood cells which your body makes to fight an infection.
  • Urine culture to see what kind of bacteria you have.

Your doctor may also use these tests:

Ultrasound, MRI, or CT scan. These are imaging tests that let your doctor look inside your body to see if there is a blockage in your urinary tract.

Voiding cystourethrogram. This is a type of X-ray to look for problems in your urethra and bladder when is full and when you are emptying it.

If you don't get treatment, a kidney infection can cause serious problems like:

Kidney abscess. This happens when pus collects inside the kidney tissue. The bacteria may spread to other parts of your body like your lungs and bloodstream.

Blood poisoning (septicemia). When bacteria from a kidney infection get into your blood, they can spread through your body and into your organs. This is a medical emergency and needs treatment right away.

Severe infection. An infection called emphysematous pyelonephritis may destroy kidney tissue and make toxic gas build up there. It usually happens in people who have diabetes.

Kidney failure. Rarely, a kidney infection can cause so much damage that the kidneys stop working as they should.

Problems in pregnancy. If you have a kidney infection while pregnant you might get a severe infection, have a breathing problem called adult respiratory distress syndrome, and your baby might be early.

Your doctor will prescribe antibiotics for you to take for at least 2 weeks. Take all of the medicine, even if you start to feel better.

You might take one or a combination of antibiotics, such as:

  • Trimethoprim-sulfamethoxazole

  • Amoxicillin or augmentin

  • Ceftriaxone or cephalexin

  • Ciprofloxacin or levofloxacin

If your kidney infections keep coming back, there might be a problem with the shape of your urinary tract. Your doctor may send you to a specialist, such as a urologist. Problems with the shape of the urinary tract may need surgery to fix.

How long does a kidney infection last?

Most people feel better within 2 weeks. But sometimes, a kidney infection can take a few weeks to clear up. If you're over 65 or you have other health problems like a weak immune system, it might take longer for you to recover. Call your doctor if you don't feel better after you finish all of your antibiotic.

UTIs are common during pregnancy, so your risk of a kidney infection is higher. Not treating the infection quickly could cause problems with you and your baby, such as:

  • Delivering your baby before the due date
  • Your baby being born too small
  • Damage to your kidneys
  • Lung problems that make it hard for you to get enough oxygen

It's important to get professional medical care for a kidney infection. But there are some things you can do at home to make you feel better:

  • Drink plenty of fluids to flush out germs.
  • Get extra rest.
  • Take a pain reliever with acetaminophen. Don't use aspirinibuprofen, or naproxen because these can raise your risk of kidney problems.
  • Use a heating pad on your belly, back, or side.

To help you recover from a kidney infection:

  • Wait to have sex until your symptoms go away. Pee right after sex to flush out some of the germs in your urinary tract.
  • Don't get dehydrated. Drink extra water and other fluids to help flush out bacteria.
  • Avoid holding in urine. Waiting too long to pee could give bacteria a chance to multiply in your urinary tract.

You can't completely prevent bladder infections. But you may be less likely to get one if you:

  • Don't use deodorant sprays or douches on your genitals
  • Drink lots of water
  • Go to the bathroom as soon as you feel the urge
  • Pee after having sex
  • Wipe front to back after using the bathroom

You may need treatment in a hospital if:

  • You're very sick from a kidney infection
  • The infection doesn't get better with antibiotics
  • You have a health condition or a weak immune system
  • You're pregnant

Hospitalization for severe kidney infections

At the hospital, you may get antibiotics and fluids through a vein in your. If you're pregnant, you may also need tests to check your health and the health of your baby. Your doctor will prescribe an antibiotic that is safe for you and your baby.

How long you need to stay in the hospital depends on how bad your kidney infection is. Your doctor will let you know what to expect.

Drink lots of water, go to the bathroom regularly, and pee right after sex to prevent kidney infections. If you do get an infection, it's important to start treatment quickly to avoid complications like kidney damage and blood poisoning. Most kidney infections will clear up within 2 weeks after starting antibiotics.

How can I tell if I've got a kidney infection?

Common symptoms of a kidney infection include:

  • Dark, cloudy, bloody pee
  • Burning or pain when you pee
  • A constant urge to pee, even soon after you empty your bladder
  • Bad-smelling urine
  • Fever and chills
  • Pain in your lower back, side, or groin

Can a kidney infection go away on its own?

In some people, kidney infections do clear up on their own. But because these infections can cause serious complications, it's best to see your doctor for treatment.

How can I test for kidney infection at home?

You can't test for a kidney infection at home. You can buy a home UTI test kit, but it will not tell you if you have a kidney infection. If you have symptoms, you should see your doctor.

How fast can a UTI turn into a kidney infection?

The amount of time it takes for a UTI to turn into a kidney infection is different for each person.