How long to cook burgers on grill: Temperatures and times to remember.

Hamburgers and hot dogs are a quintessential Fourth of July and summertime barbecue meal. If you've invited lots of family and friends for backyard festivities, it's helpful to have a tasty meal you can whip up in large batches.

Even if you're rushing to throw the patties on before the fireworks begin, it pays to be cautious while grilling. Raw or undercooked beef can contain harmful, illness-causing bacteria. Your patties should be thoroughly cooked.

Ready to get grilling? We've got a handy guide to mastering a delicious burger.

How long does it take to grill burgers?

Whether you're grilling with charcoal, propane or electricity, the key is to bring your meat to the right internal temperature.

The U.S. Department of Agriculture recommends all ground meat be cooked to 160º F to prevent foodborne illness. It's best to use a digital meat thermometer to check if your meat is done, but it generally takes 4 1/2 to 5 minutes per side, according to Allrecipes. Thicker patties take longer to cook.

If you're looking for a different level of "doneness," there are other temperature guidelines you can follow. Cooking under 160º F carries a higher risk of bacteria, but if you let your burgers rest for a few minutes after cooking, the presence of bacteria reduces. It also makes for a more tasty bite because the meat's natural juices can redistribute.

Here are the internal cooking temperatures for each level of doneness, according to the Grass Roots Farmers Co-Op:

  • Medium-rare: 135º F

  • Medium: 145º F

  • Medium-well: 155º F

  • Well-done: 160º F

Each of these levels takes a different amount of time to cook. Here's how long you can expect to cook your burger patties, according to Bon Appetit:

  • Medium-rare: 6-7 minutes total

  • Medium: 7-8 minutes total

  • Medium-well: 9 minutes total

  • Well-done: 10 minutes total

How to grill corn: Follow this step-by-step guide

How long to grill plant-based burgers

Meatless patties usually have a lower risk of carrying certain bacteria, but that doesn’t mean you should undercook them. If your Beyond Meat isn’t thoroughly cooked, you could consume raw pea protein, which can be difficult to digest, according to Prepared Cooks.

Cook your patties until each side is brown and caramelized on the bottom. It'll take about four minutes per side, according to Beyond Meat.

How to light a charcoal grill

Lighting a charcoal grill is usually easiest with a chimney, a cylindrical device that helps the coals light each other by containing and directing the flow of heat. Some easy-light charcoal can also be lit with matches.

Here's how to get your grill going with a chimney, according to charcoal company Kingsford:

  1. Fill the chimney with charcoal

  2. Add kindling, like newspapers or old paper

  3. Light the kindling and place the chimney on top of it

  4. Pour out the chimney into the grill after 15-20 minutes when the coals are covered in gray ash.

Kingsford also presents a simple method to light your grill if you don’t have a chimney:

  1. Pile up the charcoal briquets.

  2. Add lighter fluid and light the coals (Never squirt lighter fluid onto a flame)

  3. Wait until coals are mostly covered in gray ash and then spread them out

Are hot dogs good for you? How to choose the healthiest hot dog

Just Curious for more? We've got you covered.

USA TODAY is exploring the questions you and others ask every day. From "How long to grill chicken breast" to "How to recycle" to "What is the best sunscreen?" – we're striving to find answers to the most common questions you ask every day. Head to our Just Curious section to see what else we can answer for you.

This article originally appeared on USA TODAY: How long to grill burgers: Temperatures and times to know