It's not always a great idea to take Fido flying, but sometimes you have a good reason to take your dog along when you're traveling by air. Problem is, the

Gregory Karp

It's not always a great idea to take Fido flying, but sometimes you have a good reason to take your dog along when you're traveling by air. Problem is, the logistics can seem overwhelming, with the cost, paperwork and myriad rules and regulations to sift through, many of which are  different from airline to airline.

Still, it's possible to figure it out and for your pooch to  have a safe and comfortable flight.

In short, the best advice is to talk to your veterinarian and your airline about what you need to do.  Here's what you're likely to learn when preparing to fly with your canine. (Note: Service dogs and emotional support dogs typically don't have to adhere to the same costs and requirements as pets. Contact your airline for details on how to fly with these  kinds of animals.)

Cabin vs. cargo: Know the differenceIn-cabin

Generally, if your dog in its carrier can fit under the seat in front of you, it can go in the cabin. So that means a dog weighing up to about 20 pounds. Of course, that under-seat space can  vary  depending on the aircraft, and airlines typically restrict how many total pets are allowed per flight  " which is why you should check with  the airline. You can't buy an extra seat for your dog. Traveling with a dog this way, essentially as carry-on luggage, usually incurs a lower fee than if it travels in the belly of the plane. And by the way,  a pet in its carrier counts as your carry-on bag.

Having your dog with you might provide peace of mind " although you're not  allowed to take it out of the carrier during the flight. But it might add stress, as you worry about lugging the carrier down the airplane aisle or the dog barking or having an accident that will disturb fellow passengers.

As checked luggage or shipping cargo

The other option  " and the only option for bigger dogs  " is flying as cargo in a pressurized, temperature-controlled compartment not too different  from the passenger cabin. These dogs essentially fly as checked bags on the same flight as you or unaccompanied, as shipping cargo, sometimes called manifest cargo or air freight. Again, check with your airline. Delta Air Lines, for example, won't let you book a pet shipped by Delta Cargo until 14 days before departure.

Note: The Humane Society of the United States generally recommends against traveling with your dog anywhere but the cabin  " which is impossible for bigger dogs. And not all airlines will transport dogs as cargo. Southwest Airlines and JetBlue Airways, for example, offer only in-cabin flights for small dogs and cats. However, airlines have been flying pets as cargo for many years, with proportionally few incidents  " and they must report animal injuries, losses and deaths to the federal government. In 2016, airlines reported 26 deaths, 22 injuries and zero losses in nearly 524,000 animals transported.

Whether you choose cabin or cargo, you must adhere to airline rules about your dog's age and weight. For example, United Airlines requires puppies be at least 2 pounds  or 10 weeks old.

Using a dedicated pet shipping company is another way to go. You can find one at  International Pet and Animal Transportation Association, an industry organization.

Be aware of the costs

Owning jet-set pets isn't cheap. First, you'll have to make a reservation for your dog.

Several of the biggest  airlines in the U.S. charge $125 each way for an in-cabin pet, though fees are somewhat less on other airlines, like Southwest Airlines ($95) and JetBlue ($100). Prices were current as of January 2018. The fee is usually payable when you get to the airport, not when you book.

Potential related cost: Because your in-cabin pet counts as your carry-on, you might be paying to check your roll-aboard unless you get a free checked bag because it's a perk of your frequent flyer elite status or your airline-branded credit card.

Pets that fly as cargo often cost more " for example, $200 each way on American Airlines  when pets are checked as luggage

On United, shipping costs with its PetSafe program are based on the combined weight of the pet and its kennel. A dog and its  kennel weighing 75 pounds and flying domestically would cost $428, according to a January 2018  rate table.

If you have a stopover of more than a few hours, it could trigger another pet fee.

Additional expenses  include the cost of a pre-flight veterinary visit and pet carrier. Some experts say it's a good idea to have an identification microchip implanted in your pet in case it gets lost.

Understand health requirements, restrictions

Check with your veterinarian to make sure your dog is healthy enough for air travel. Some species, especially such pug-nosed dogs as boxers and Boston terriers, aren't allowed to fly on  many airlines because  it can be hard for them to breathe at high altitudes.

You may also need a health certificate  from a veterinarian seven to 10 days before you fly, according to airline industry group Airlines for America.

Aside from health and breed, make sure you're aware of other potential rules, restrictions and guidelines.  Visit your airline's website to find out more about your specific trip.

Consider  the kennel

Airlines can have lengthy and detailed requirements for the box your dog rides in, often called a crate, carrier or kennel. Generally, the kennel will need to be large enough for your dog to stand up and turn around inside. Airlines have maximum size requirements. For example, American Airlines allows an in-cabin carrier kennel of up to 19 inches in length, 13 inches in width and 9 inches in height if it's noncollapsible, larger if it's collapsible.

Airlines and animal experts say to reduce stress, it's important to acclimate your dog to the kennel before flying.

Here are kennel tips from Airlines for America " these are especially important if your dog travels as cargo:

Label your dog's kennel with your contact information.Write 'LIVE ANIMAL' on the top and one side of the kennel. Draw arrows or write 'THIS SIDE UP' on two sides of the kennel.Put bedding or 'absorbent material' on the kennel floor.Attach empty food and water dishes to the inside of the kennel. Ensure they can be accessed from the outside.challenges of International flights

Requirements for flying internationally with your dog are more complex and typically require even more planning.  And some airlines  " Southwest is an example  " won't allow pets on international flights at all.

If pets are allowed, you'll need to obtain an international health certificate and comply with the requirements of your destination country. The U.S. Department of Agriculture's Animal and Plant Health Inspection Service lists regulations by country.

Upon return to the U.S., dogs may need proof of immunization against rabies, according to the Centers for Disease Control and Prevention.

United, for example, suggests for international trips that  you contact the appropriate embassy or consulate at least one month before  your trip to check on the specifics of the country's entry procedures.

What to do before departure dayBookingBook a nonstop flight if possible. (That's different from a 'direct' flight, which can have stops.) 'This will decrease the chances that your pet is left on the tarmac during extreme weather conditions or mishandled by baggage personnel during a layover,' according to the website for the American Society for the Prevention of Cruelty to Animals.If you must have a stopover, some airlines require a minimum stopover time when traveling with pets. For example, it might be one hour for domestic flights and two hours for flights outside the continental U.S. The ASPCA recommends you tape a small  bag of food outside the  kennel so airline  workers can feed your dog during these stops.Try to avoid flying during holidays, which can be busy. In warm weather,  try to fly during the morning or evening. In cold weather, midday flights may be better, suggests the American Veterinary Medical Association.Preparing your petAnimal experts generally frown on sedating an animal, and it may not fly with the airline, either. United Airlines, for example, 'will not knowingly accept a dog or cat that has been sedated.'The evening before your departure, freeze a dish of water for your dog. That will prevent it from spilling during the loading process, and when it eventually melts, your dog can drink it,  advises the ASPCA.Attach  a current photo of your dog to the top of the  kennel to help identify it if it escapes the carrier.Don't feed your pet in the hours leading up to flight departure because 'a full stomach can cause discomfort for a traveling pet,' United Airlines' website says. It recommends that you avoid  feeding  a healthy, large-breed adult dog  within four hours  of takeoff. 'Small-breed puppies younger than 16 weeks and less than 10 pounds may be fed a small meal two to three hours before their flight,' the site says.What to  do on departure dayCheck-in

On the day of flying, arrive at the airport early and check in at the ticket counter with your dog if it's flying in the cabin. If it's flying as cargo, check with your airline about where to drop your pet. You might bring it to the passenger terminal if it's traveling as checked luggage or the air cargo terminal, which  is usually a different location at the airport. (You might pick up your dog at a cargo terminal, too.)

Security screening

For in-cabin transport of dogs, the  kennel goes on the conveyor belt and through the X-ray machine, while you leash your dog and carry or lead it through the metal detector. This can be a hassle, less so if you have membership in TSA PreCheck,  which gives you access to quicker lines and means you don't have to take off your shoes  or  light jacket.

And remember: Details of pet policies vary widely by airline, so it's best to check directly with the carrier when you're planning a trip. With  a little planning and research, both you and your pet can expect a smooth flight.

More From NerdWallet

Shake Up Business Travel by Taking Some 'Bleisure' Time Tame Your Credit Card Debt Worries With 3 Tactics Why Couples Need Their Own Slush Funds

Gregory Karp is a writer at NerdWallet. Email: gkarp@nerdwallet.com. Twitter: @spendingsmart.