You’re about to board a plane when the airline staff stops you and says your bag is too big or too heavy, and you’ll have to check it. That’ll cost you $25.

Airlines are looking for ways to increase profit, and your bags are a way to do it. Their dimensions and weight may cost you, so if you want to keep costs from spiraling, you’ll have to prepare.

"Two of the biggest drivers of airline profit are change fees and baggage fees," said Paul Hudson, president of Flyersrights.org, a consumer advocacy organization. And they can cost "as much or more than your ticket," he said. In fact, U.S. airlines earned $3.35 billion from baggage fees in 2013, the last full year for which figures are available, according to The U.S. Department of Transportation’s Bureau of Transportation Statistics.

Travelers need to check airline websites to learn what they charge, Hudson said. "Know what you're facing. Decide whether you want to buy that ticket and how you want to pack and organize your trip."

Know the rules: The rules can vary, depending on your destination, your class of travel and whether you’re flying in the U.S. or internationally. “There are a few ways to avoid checking a bag,” said Henry H. Harteveldt, founder and travel industry analyst for Atmosphere Research Group in San Francisco. “One way is to fly in the premium cabin, since business- and first-class passengers get to board first. Since there are fewer passengers in the cabins, you have a better chance of getting your bag in the overhead bin.” Flyers enrolled in top-tier loyalty programs generally get “priority” boarding, as do those with certain airline co-branded credit cards.

Weigh your bags: Check your airline’s website for its rules on bag weight. “Make sure you’re at least one pound under the airlines’ stated maximum allowable weight to account for any discrepancy with the ticket counters’ scales,” Harteveldt said. A hand-held bag scale can ensure your bag won’t go over the limit at the airport. And if you’re traveling internationally aboard a foreign-flag airline – even if you have a U.S. airline “code share” flight number – check the foreign-flag airline’s baggage rules. U.S. airlines are generally more generous on baggage rules, Harteveldt said.

Research luggage: Check your airline’s website for its rules on bag dimensions. Airlines also typically keep bag measurement systems near the gate. If you’re traveling with old luggage, your bag may simply be too tall or too wide to carry on board, and it will have to be checked – which generally costs $25 on U.S. carriers. If you have more than one oversized bag, that can add $50, $75 or more to your flight.

Choose a bag that will fit under the seat in front of you or in the overhead compartment. “You want to have the right equipment for the trip you’re trying to take,” said Rob Cassidy, president and COO of eBags.com, a website for luggage. If you’re traveling with children, aim to consolidate “everything into one checked bag,” said Cassidy, who uses color-coded packing cubes to pack his two young children’s items separately.

Look for a bag that makes the best use of space, and avoid heavy frames and fabrics that add weight, Harteveldt said. “Some suitcases lose a lot of space to the frames or the apparatus for the extendable handle. Look for a combination of interior packing space and lightweight construction.”

There are a lot of new travel bags on the market, so analyze your needs before researching. “Don’t fall for unnecessary accessories or amenities that serve limited purpose and take away from your packing space,” Harteveldt said.

Plan before packing: Think about what you will need on your trip, because carrying more than you need may add to your costs and complicate your travel. “Be disciplined when you pack,” Harteveldt said. “If you can avoid it, never take more than six days’ worth of clothing.” If you’re traveling on business, aim to have clothes laundered or sent out to a dry cleaner. Since shoes and sneakers tend to be heavy, limit yourself to two pairs and wear the heavier pair on the plane. If you must bring more, put a pair in your carry-on bag. Often, airlines permit one carry-on bag and one personal item, so organize your belongings carefully to bring as much as possible into the cabin with you.

Consider priority boarding: If you value convenience, you may want to keep your bag with you in the cabin. Some airlines let you pay extra – around $15 – for priority boarding, which enables you to board early and will ensure space in the overhead bins for a suitcase that is not oversized or overweight.