It can be the most exhilarating thing you do during the workday, but getting it right can be tricky. Here are some tips to help you get the most out of a midday workout:

How to prep

Have a plan. The night before, pack a light bag of just the essentials: a change of underwear, travel-size deodorant and wet wipes, if you won't have time for a shower. Need to shower? Bring a bottle of dry shampoo to cut down on time.

You might want to keep a pair of sneakers and toiletries in your desk at work. That way, you can just grab what you need and go. And consider arriving at the office a little early, in case it takes you longer than expected to get ready.

What to eat

Scarfing down a hoagie right before a run might not be the best idea, but you should eat something, said Nancy Clark, author of "Nancy Clark's Sports Nutrition Guidebook."

"The goal is to enter into your workout with a normal blood sugar level," Clark said. "If you're exercising at a pace you can maintain for a half-hour, your body can digest the food and use it during the workout. It all depends on your tolerance level."

If you're planning a high-intensity workout of burpees or jump squats, she recommends eating a hearty breakfast. For less strenuous exercise, Clark said, it's perfectly fine to eat a banana or half of your lunch before getting started.

What you eat post-workout also is essential. To recover from a tough routine, down a smoothie, peanut butter sandwich, chocolate milk or any other mini-meals with a balance of carbohydrates and protein.

"Protein builds and repairs muscles, but it does not refuel muscles. Carbs fuel, so you actually want three times more carbs than protein," Clark said.

Best workouts

If you work near a park or somewhere with trails, going for a run is a great way to break up the workday. If not, hit the treadmill at the gym, but add in some intervals — one minute of sprints followed by a 30-second jog.

Circuit training will burn calories and could build muscle if you throw some weights into the mix.

Game for a class? Just about every gym has a variety of 45-minute classes.

If you have to design your own workout, opt for an app like Nike Training Club, Sworkit, Spitfire Athlete, all of which have 30-minute cardio and strength-training routines. Fitbit now offers Fitbit Blaze, a touch-screen tracker that comes with access to the workout app FitStar.

If you can't get out of office, head to the stairwell for a quick workout. Do a few sets of calf raises on the stairs, then tackle some high-knee lifts and squats. If you're got the time — and energy — sprint up a couple flights of stairs.