Solid or creamy
TSA has two entries. “Cheese (Solid)” is a yes for both bags. “Cheese (Creamy)” is a yes in your carry-on only at 3.4 ounces or less, and a yes in your checked bag.
A block of cheddar or a bag of string cheese is solid. Cream cheese, or a cheese spread you’d put on a cracker, is creamy.
TSA’s travel tips give the test for the creamy kind: “If you can spill it, spread it, spray it, pump it or pour it, and it’s larger than 3.4 ounces, it should go in a checked bag.”
At the checkpoint
TSA’s note on both entries: officers “may instruct travelers to separate items from carry-on bags such as foods, powders, and any materials that can clutter bags and obstruct clear images on the X-ray machine.” If you’re keeping it cold, ice packs have their own page.
As a gift
TSA encourages gift bags or boxes with lids that come off, so an officer can look inside “and avoid the possibility of opening fully wrapped presents.” More in food gifts and wrapped gifts.
Flying home from abroad
TSA’s answer covers screening at US airports. On the way home you go through the other airport’s screening first, and its rules are the ones that count there.
Coming home through US customs
USDA lists “solid hard or soft cheeses” among the foods that may enter from any country, as long as the cheese has no meat in it and doesn’t pour like a liquid. USDA’s examples of cheese that pours are ricotta and cottage cheese.
CBP’s page on prohibited items is shorter: “You may bring bakery items and certain cheeses into the United States.” USDA is stricter about other dairy: “Most milk and dairy items from countries with foot-and-mouth disease (FMD) are not allowed.” That’s why yogurt gets a different answer.
Declare it either way. USDA says declared food brings no penalty, even when it’s refused. What happens if you don’t.

TSA puts this on every entry: “The final decision rests with the TSA officer on whether an item is allowed through the checkpoint.”