Food to Steps Calculator
/* ============ EASY CUSTOMIZATION ============ */
#fts{
–accent:#0e7c86; /* main brand color (buttons, highlights) */
–accent-dark:#0a5c64;
–steps:#f59f00; /* color of the big step count */
–ink:#0f2a33; /* main text */
–muted:#5d7580; /* secondary text */
–line:#d9e4e8; /* borders */
–bg:#f3f7f8; /* tool background */
–card:#ffffff;
}
/* ============================================ */
#fts, #fts *{box-sizing:border-box}
#fts{
font-family:system-ui,-apple-system,”Segoe UI”,Roboto,Helvetica,Arial,sans-serif;
color:var(–ink); background:var(–bg); max-width:720px; margin:0 auto;
padding:24px; border-radius:16px; line-height:1.5;
}
#fts h2{margin:0 0 4px; font-size:1.6rem; letter-spacing:-.01em}
#fts .sub{margin:0 0 20px; color:var(–muted)}
#fts label{display:block; font-weight:600; font-size:.9rem; margin-bottom:6px}
#fts textarea, #fts input, #fts select{
font:inherit; color:inherit; border:1.5px solid var(–line); border-radius:10px;
background:var(–card); padding:12px 14px; width:100%;
}
#fts textarea{min-height:96px; resize:vertical}
#fts textarea:focus, #fts input:focus, #fts select:focus, #fts button:focus-visible{
outline:3px solid color-mix(in srgb,var(–accent) 35%,transparent); outline-offset:1px; border-color:var(–accent);
}
#fts .row{display:flex; gap:12px; margin-top:14px; align-items:flex-end; flex-wrap:wrap}
#fts .row > div{flex:1 1 140px}
#fts .weight{display:flex; gap:8px}
#fts .weight select{width:84px; flex:none}
#fts .go{
flex:none; background:var(–accent); color:#fff; border:0; border-radius:10px;
padding:13px 26px; font-weight:700; font-size:1rem; cursor:pointer; min-height:48px;
}
#fts .go:hover{background:var(–accent-dark)}
#fts .chips{margin-top:12px; display:flex; flex-wrap:wrap; gap:8px; align-items:center}
#fts .chips span{font-size:.85rem; color:var(–muted)}
#fts .chip{
border:1.5px solid var(–line); background:var(–card); border-radius:999px;
padding:5px 12px; font-size:.85rem; cursor:pointer; color:var(–ink); width:auto;
}
#fts .chip:hover{border-color:var(–accent); color:var(–accent-dark)}
#fts .result{margin-top:24px; display:none}
#fts .result.show{display:block}
#fts .big{
background:var(–ink); color:#fff; border-radius:14px; padding:22px 24px;
}
#fts .big .n{font-size:clamp(2.6rem,10vw,4rem); font-weight:800; line-height:1; color:var(–steps); font-variant-numeric:tabular-nums}
#fts .big .l{font-size:1rem; margin-top:4px; opacity:.9}
#fts .stats{display:flex; gap:22px; flex-wrap:wrap; margin-top:16px; padding-top:14px; border-top:1px solid rgba(255,255,255,.18)}
#fts .stats div{font-size:.9rem; opacity:.9}
#fts .stats b{display:block; font-size:1.2rem; color:#fff; font-variant-numeric:tabular-nums}
#fts .items{margin-top:16px; background:var(–card); border:1px solid var(–line); border-radius:14px; overflow:hidden}
#fts .item{display:grid; grid-template-columns:64px 1fr auto 32px; gap:10px; align-items:center; padding:12px 14px; border-bottom:1px solid var(–line)}
#fts .item:last-child{border-bottom:0}
#fts .item input{padding:7px 8px; text-align:center; border-radius:8px}
#fts .item .nm{font-weight:600}
#fts .item .nm small{display:block; font-weight:400; color:var(–muted); font-size:.8rem}
#fts .item .kc{font-variant-numeric:tabular-nums; font-weight:600; text-align:right; white-space:nowrap}
#fts .item .rm{border:0; background:none; font-size:1.3rem; line-height:1; color:var(–muted); cursor:pointer; border-radius:8px; padding:4px}
#fts .item .rm:hover{color:#c0392b}
#fts .item.unknown{grid-template-columns:1fr 120px 32px; background:#fff8e6}
#fts .item.unknown .nm small{color:#8a6100}
#fts .note{font-size:.82rem; color:var(–muted); margin-top:14px}
#fts .cta{
display:none; margin-top:18px; background:var(–card); border:1.5px solid var(–accent);
border-radius:14px; padding:16px 18px;
}
#fts .cta.show{display:block}
#fts .cta p{margin:0 0 10px}
#fts .cta a{
display:inline-block; background:var(–accent); color:#fff; text-decoration:none;
padding:10px 18px; border-radius:10px; font-weight:700;
}
#fts .cta a:hover{background:var(–accent-dark)}
@media (max-width:480px){
#fts{padding:16px}
#fts .item{grid-template-columns:58px 1fr 32px}
#fts .item .kc{grid-column:2; text-align:left}
#fts .item .rm{grid-row:1; grid-column:3}
}
How many steps to walk it off?
Type what you ate and see roughly how many steps equal those calories.
What did you eat?
Try:
Burger meal
Breakfast
Pizza night
Donut
Your weight (optional, more accurate)
lbkg
Calculate steps
0
steps to burn about 0 calories
0 miles walking
0 minutes at a brisk pace
Estimates only, based on typical portion sizes and an average walking stride. Calories and steps vary by person.
Change any quantity above to match your portion. This tool is not medical or nutrition advice.
Want a plan that goes beyond counting steps? Get our step-by-step weight loss guide.
See the guide
(function(){
/* ———- FOOD DATABASE ———-
Format: [“alias one|alias two”, “serving description”, calories per serving]
Add your own foods by adding new lines. Longest matching alias wins. */
var FOODS = [
// Breakfast & bakery
[“egg”,”1 large”,72],[“scrambled egg”,”1 egg”,91],[“fried egg”,”1 egg”,90],[“omelet|omelette”,”2-egg”,250],
[“bacon”,”1 slice”,43],[“sausage”,”1 link”,90],[“toast”,”1 slice”,80],[“bagel”,”1 medium”,270],
[“cream cheese”,”1 tbsp”,50],[“croissant”,”1 medium”,230],[“pancake”,”1 medium”,90],[“waffle”,”1 waffle”,220],
[“french toast”,”1 slice”,150],[“oatmeal”,”1 cup”,160],[“cereal”,”1 cup”,150],[“granola”,”1/2 cup”,210],
[“donut|doughnut”,”1 donut”,250],[“muffin”,”1 large”,400],[“yogurt”,”1 cup”,150],[“greek yogurt”,”1 cup”,130],
[“granola bar”,”1 bar”,120],[“protein bar”,”1 bar”,210],
// Fast food & sandwiches
[“hamburger”,”1 burger”,250],[“burger”,”1 burger”,300],[“cheeseburger”,”1 burger”,300],[“big mac”,”1 burger”,550],
[“double cheeseburger”,”1 burger”,450],[“fries|french fries”,”medium order”,365],[“chicken nugget|nugget”,”1 nugget”,45],
[“pizza”,”1 slice”,285],[“pepperoni pizza”,”1 slice”,310],[“hot dog”,”1 with bun”,290],[“taco”,”1 taco”,170],
[“burrito”,”1 burrito”,550],[“quesadilla”,”1 quesadilla”,500],[“chicken sandwich”,”1 sandwich”,450],
[“sandwich”,”1 sandwich”,350],[“sub|hoagie”,”6-inch”,450],[“grilled cheese”,”1 sandwich”,400],[“blt”,”1 sandwich”,400],
[“fried chicken”,”1 piece”,320],[“chicken wing|wing”,”1 wing”,100],[“onion ring”,”1 ring”,40],[“nachos”,”1 plate”,600],
[“fishnchips|fish and chips”,”1 plate”,900],[“wrap”,”1 wrap”,400],
// Mains
[“pasta|spaghetti”,”1 serving”,330],[“rice”,”1 cup cooked”,205],[“fried rice”,”1 cup”,240],[“macncheese|mac n cheese”,”1 cup”,310],
[“lasagna”,”1 slice”,380],[“steak”,”6 oz”,420],[“chicken breast|chicken”,”4 oz grilled”,190],[“salmon”,”6 oz fillet”,350],
[“shrimp”,”3 oz”,85],[“meatball”,”1 meatball”,80],[“sushi roll|sushi”,”6 pieces”,250],[“ramen”,”1 bowl”,450],
[“pad thai”,”1 plate”,600],[“curry”,”1 cup”,300],[“soup”,”1 cup”,150],[“chili”,”1 cup”,250],[“salad”,”1 side salad”,100],
[“caesar salad”,”1 salad”,350],[“mashed potato”,”1 cup”,210],[“baked potato”,”1 medium”,160],[“sweet potato”,”1 medium”,110],
[“pork chop”,”1 chop”,300],[“ribs”,”3 ribs”,450],[“tofu”,”4 oz”,90],[“beans”,”1/2 cup”,110],[“tuna”,”1 can”,120],
// Fruit & veg
[“apple”,”1 medium”,95],[“banana”,”1 medium”,105],[“orange”,”1 medium”,62],[“grapes”,”1 cup”,100],[“strawberry|strawberries”,”1 cup”,50],
[“blueberry|blueberries”,”1 cup”,85],[“watermelon”,”1 wedge”,85],[“avocado”,”1 whole”,240],[“broccoli”,”1 cup”,55],[“carrot”,”1 medium”,25],
[“corn”,”1 ear”,100],[“mango”,”1 whole”,200],[“pineapple”,”1 cup”,80],
// Snacks & sweets
[“chips”,”1 small bag”,150],[“popcorn”,”3 cups”,95],[“pretzel”,”1 oz”,110],[“cookie|chocolate chip cookie|oatmeal cookie”,”1 medium”,150],[“brownie”,”1 brownie”,240],
[“cake”,”1 slice”,350],[“cupcake”,”1 cupcake”,300],[“pie”,”1 slice”,300],[“ice cream”,”1 cup”,270],[“scoop of ice cream”,”1 scoop”,140],
[“chocolate bar”,”1 bar”,230],[“candy bar”,”1 bar”,250],[“candy”,”1 handful”,100],[“chocolate”,”1 oz”,150],[“almond”,”1 oz”,165],
[“peanut”,”1 oz”,160],[“nuts|mixed nuts”,”1 oz”,170],[“trail mix”,”1/4 cup”,175],[“peanut butter”,”1 tbsp”,95],[“cheese”,”1 slice”,110],
[“crackers|cracker”,”6 crackers”,90],[“hummus”,”2 tbsp”,70],
// Drinks
[“soda|coke|pepsi|sprite|cola”,”1 can (12 oz)”,140],[“diet soda|diet coke”,”1 can”,0],[“beer”,”12 oz”,150],[“wine”,”1 glass”,125],
[“margarita”,”1 glass”,275],[“cocktail”,”1 drink”,200],[“vodka|whiskey|rum|tequila”,”1 shot”,100],[“orange juice|juice”,”1 cup”,110],
[“milk”,”1 cup”,120],[“latte”,”16 oz”,190],[“cappuccino”,”12 oz”,130],[“coffee”,”1 cup black”,5],[“frappuccino”,”16 oz”,400],
[“smoothie”,”16 oz”,250],[“energy drink”,”1 can”,110],[“sports drink|gatorade”,”20 oz”,130],[“milkshake|shake”,”1 shake”,600],
[“hot chocolate”,”1 cup”,190],[“sweet tea”,”16 oz”,120],
// Chinese takeout & Panda Express (typical restaurant portions)
[“orange chicken”,”1 entree”,510],[“chow mein”,”1 side”,510],[“lo mein|lo main|low mein|lomein”,”1 serving”,450],
[“cream cheese rangoon|crab rangoon|rangoon”,”1 piece”,65],[“egg roll”,”1 roll”,200],[“spring roll”,”1 roll”,100],
[“potsticker|dumpling|gyoza”,”1 piece”,50],[“wonton soup”,”1 bowl”,180],[“hot and sour soup|egg drop soup”,”1 cup”,90],
[“beijing beef”,”1 entree”,480],[“kung pao chicken”,”1 entree”,320],[“general tso|general tsos chicken”,”1 entree”,430],
[“sesame chicken”,”1 entree”,500],[“sweetnsour|sweet and sour chicken”,”1 entree”,450],[“beefnbroccoli|broccoli beef”,”1 entree”,380],
[“teriyaki chicken”,”1 entree”,340],[“mongolian beef”,”1 entree”,470],[“honey walnut shrimp”,”1 entree”,360],
[“steamed rice|white rice”,”1 cup”,205],[“noodle”,”1 cup”,220],
// More restaurant & everyday foods
[“burrito bowl”,”1 bowl”,700],[“chicken tender”,”1 tender”,120],[“biscuit”,”1 biscuit”,200],[“chicken salad”,”1 serving”,350],
[“tuna salad”,”1 serving”,300],[“turkey”,”4 oz”,150],[“ham”,”2 slices”,60],[“green beans”,”1 cup”,45],[“cottage cheese”,”1 cup”,180],
[“pudding”,”1 cup”,150],[“applesauce”,”1 cup”,100],[“tortilla”,”1 tortilla”,120],[“naan”,”1 piece”,260],[“samosa”,”1 piece”,250],
[“gyro”,”1 gyro”,600],[“oreo”,”1 cookie”,53],[“protein shake”,”1 shake”,160],[“pancake syrup”,”1 tbsp”,50],
// More drinks (typical sweetened sizes; edit calories if yours differs)
[“melon drink|melon juice|melon soda|honeydew drink|watermelon juice|watermelon drink”,”16 oz”,170],
[“melon bubble tea|melon milk tea|honeydew bubble tea|honeydew milk tea|melon boba|honeydew boba|watermelon boba|melon slush|melon smoothie”,”16 oz”,300],
[“bubble tea|boba|milk tea|boba tea”,”16 oz”,320],[“melon|cantaloupe|honeydew”,”1 cup”,60],
[“fruit punch|fruit drink|kool aid|kool-aid|sweet drink”,”12 oz”,150],[“lemonade”,”12 oz”,150],[“limeade”,”12 oz”,150],
[“iced tea|sweet iced tea”,”16 oz”,100],[“tea|green tea|herbal tea|unsweetened tea”,”1 cup”,2],
[“kombucha”,”16 oz”,60],[“coconut water”,”11 oz”,60],[“aloe drink|aloe vera drink”,”16 oz”,150],
[“water|sparkling water|seltzer”,”1 glass”,0],[“slushie|slushy|icee”,”16 oz”,200],[“lemon lime soda|ginger ale|root beer|dr pepper|mountain dew|fanta”,”12 oz can”,150],
[“chocolate milk”,”1 cup”,190],[“almond milk”,”1 cup”,40],[“oat milk”,”1 cup”,120],[“iced coffee”,”16 oz”,80],
[“sweet tea”,”16 oz”,120],[“horchata”,”16 oz”,300],[“mimosa”,”1 glass”,120],[“sangria”,”1 glass”,170],[“white claw|hard seltzer”,”12 oz”,100],
// Fast food & chains (typical published values, rounded; vary by location)
[“quarterpounder|quarter pounder”,”1 burger”,520],[“whopper”,”1 burger”,670],[“baconator”,”1 burger”,960],[“mcchicken”,”1 sandwich”,400],
[“filet-o-fish|filet o fish”,”1 sandwich”,390],[“egg mcmuffin|mcmuffin”,”1 sandwich”,310],[“mcflurry”,”1 regular”,510],
[“hash brown”,”1 patty”,140],[“apple pie”,”1 slice”,300],[“frosty”,”small”,350],[“chick-fil-a nugget|chick fil a nugget”,”1 nugget”,31],
[“waffle fries”,”medium”,420],[“crunchwrap”,”1 crunchwrap”,530],[“chalupa”,”1 chalupa”,350],[“chipotle burrito”,”1 burrito”,1000],
[“footlong|foot long”,”12-inch sub”,800],[“breakfast burrito”,”1 burrito”,500],[“breakfast sandwich”,”1 sandwich”,400],
[“baconeggcheese”,”1 sandwich”,450],[“sausage biscuit”,”1 biscuit sandwich”,450],[“biscuitsgravy”,”1 plate”,550],
[“chickenwaffles”,”1 plate”,900],[“corn dog”,”1 corn dog”,330],[“pizza roll”,”1 roll”,35],[“breadstick”,”1 breadstick”,140],
[“garlic bread”,”1 slice”,150],[“soft pretzel”,”1 pretzel”,350],[“mozzarella stick”,”1 stick”,80],[“jalapeno popper”,”1 popper”,90],
[“potato skin”,”1 skin”,140],[“cheesesteak|philly cheesesteak”,”1 sandwich”,750],[“club sandwich”,”1 sandwich”,650],[“reuben”,”1 sandwich”,700],
[“patty melt”,”1 sandwich”,800],[“hamcheese”,”1 sandwich”,350],[“pbj”,”1 sandwich”,380],[“meatloaf”,”1 slice”,330],[“pot roast”,”1 serving”,400],
[“chicken fried steak”,”1 serving”,850],[“chicken pot pie”,”1 pie”,600],[“cornbread”,”1 piece”,200],[“coleslaw”,”1/2 cup”,150],
[“cobb salad”,”1 salad”,650],[“chicken caesar salad”,”1 salad”,600],[“greek salad”,”1 salad”,300],
// Coffee shops
[“pumpkin spice latte|psl”,”16 oz”,390],[“caramel macchiato”,”16 oz”,250],[“mocha”,”16 oz”,360],[“chai latte”,”16 oz”,240],
[“matcha latte”,”16 oz”,240],[“cold brew”,”16 oz”,5],[“refresher”,”16 oz”,90],[“cake pop”,”1 pop”,170],[“banana bread”,”1 slice”,410],
[“glazed donut”,”1 donut”,240],[“munchkin|donut hole”,”1 piece”,60],[“cinnabon”,”1 roll”,880],[“cinnamon roll”,”1 roll”,450],
// Italian & pizza places
[“fettuccine alfredo|alfredo”,”1 plate”,1000],[“chicken parmesan|chicken parm”,”1 plate”,900],[“cheese pizza”,”1 slice”,270],
// Mexican restaurant
[“enchilada”,”1 enchilada”,320],[“fajita”,”1 serving”,500],[“tamale”,”1 tamale”,285],[“chimichanga”,”1 chimichanga”,700],
[“refried beans”,”1/2 cup”,120],[“spanish rice|mexican rice”,”1 cup”,210],[“guacamole”,”2 tbsp”,50],[“salsa”,”2 tbsp”,10],
[“queso”,”2 tbsp”,100],[“tortilla chips”,”1 oz”,140],
// Japanese, Korean, Vietnamese, Indian, Mediterranean
[“miso soup”,”1 cup”,40],[“edamame”,”1 cup”,190],[“shrimp tempura|tempura”,”1 piece”,80],[“chicken katsu|katsu”,”1 plate”,700],
[“bibimbap”,”1 bowl”,560],[“pho”,”1 bowl”,450],[“banh mi”,”1 sandwich”,550],[“chicken tikka masala|tikka masala”,”1 serving”,500],
[“butter chicken”,”1 serving”,500],[“falafel”,”1 piece”,60],[“shawarma”,”1 wrap”,600],
// Desserts
[“cheesecake”,”1 slice”,450],[“tiramisu”,”1 slice”,400],[“churro”,”1 churro”,240],[“funnel cake”,”1 cake”,700],
[“sundae”,”1 sundae”,400],[“frozen yogurt”,”1 cup”,220],
// ===== FRUIT =====
[“peach”,”1 medium”,60],[“pear”,”1 medium”,100],[“plum”,”1 medium”,30],[“nectarine”,”1 medium”,60],[“cherry|cherries”,”1 cup”,87],
[“kiwi”,”1 medium”,42],[“grapefruit”,”1/2 fruit”,52],[“lemon”,”1 fruit”,17],[“lime”,”1 fruit”,20],[“pomegranate”,”1 whole”,230],
[“papaya”,”1 cup”,55],[“raspberry|raspberries”,”1 cup”,64],[“blackberry|blackberries”,”1 cup”,62],[“apricot”,”1 fruit”,17],
[“fig”,”1 medium”,37],[“date”,”1 medjool”,66],[“raisin”,”1/4 cup”,120],[“dried cranberries|dried cranberry|craisin”,”1/4 cup”,130],
[“dried mango”,”1 oz”,100],[“coconut”,”1 oz”,100],[“guava”,”1 fruit”,37],[“dragon fruit”,”1 cup”,60],[“tangerine|clementine|mandarin”,”1 fruit”,35],
[“fruit cup”,”1 cup”,80],[“fruit salad”,”1 cup”,100],[“plantain”,”1 medium”,220],[“fried plantain”,”1 cup”,365],
// ===== VEGETABLES =====
[“lettuce”,”1 cup”,8],[“spinach”,”1 cup”,7],[“kale”,”1 cup”,33],[“cucumber”,”1 medium”,45],[“tomato”,”1 medium”,22],
[“bell pepper|pepper”,”1 medium”,30],[“onion”,”1 medium”,44],[“celery”,”1 stalk”,6],[“cauliflower”,”1 cup”,27],[“cabbage”,”1 cup”,22],
[“zucchini”,”1 medium”,33],[“mushroom”,”1 cup”,15],[“asparagus”,”6 spears”,20],[“peas”,”1/2 cup”,60],[“brussels sprout”,”1 cup”,56],
[“eggplant”,”1 cup”,20],[“beet”,”1 cup”,58],[“garlic”,”1 clove”,4],[“pickle”,”1 spear”,5],[“olive”,”5 olives”,40],
[“potato|boiled potato”,”1 medium”,130],[“sweet potato fries”,”1 serving”,400],[“vegetables|veggies|roasted vegetables”,”1 cup”,120],
[“veggie burger”,”1 patty”,150],[“sauerkraut”,”1/2 cup”,14],[“kimchi”,”1/2 cup”,15],[“avocado toast”,”1 slice”,230],
[“potato salad”,”1/2 cup”,180],[“pasta salad”,”1 cup”,350],[“macaroni salad”,”1/2 cup”,200],[“baked beans”,”1/2 cup”,120],
[“chickpea”,”1/2 cup”,135],[“lentil”,”1/2 cup”,115],[“black bean”,”1/2 cup”,110],[“salad with dressing”,”1 salad”,250],
// ===== MEAT, FISH, PROTEIN =====
[“chicken thigh”,”1 thigh”,230],[“chicken drumstick|drumstick”,”1 drumstick”,160],[“rotisserie chicken”,”4 oz”,190],
[“ground beef”,”4 oz cooked”,290],[“ground turkey”,”4 oz”,170],[“pork tenderloin”,”4 oz”,140],[“lamb chop”,”1 chop”,200],
[“brisket”,”4 oz”,300],[“pulled pork”,”4 oz”,250],[“prime rib”,”8 oz”,700],[“filet mignon”,”6 oz”,400],[“sirloin”,”6 oz”,360],
[“ribeye”,”10 oz”,800],[“cod”,”4 oz”,90],[“tilapia”,”4 oz”,110],[“tuna steak”,”6 oz”,220],[“crab”,”3 oz”,85],[“lobster”,”1 tail”,130],
[“scallop”,”4 scallops”,100],[“oyster”,”6 oysters”,100],[“sardine”,”1 can”,190],[“fish stick”,”1 stick”,50],[“calamari”,”1 appetizer”,450],
[“egg white”,”1 egg white”,17],[“egg salad”,”1/2 cup”,190],[“deli meat|lunch meat|cold cuts”,”2 oz”,70],[“salami”,”3 slices”,100],
[“pepperoni”,”5 slices”,50],[“jerky|beef jerky”,”1 oz”,80],[“protein powder”,”1 scoop”,120],[“tempeh”,”4 oz”,220],
[“beyond burger”,”1 patty”,230],[“impossible burger”,”1 patty”,240],[“shrimp cocktail”,”4 shrimp”,50],[“crab cake”,”1 cake”,200],
[“lobster roll”,”1 roll”,450],[“fish taco”,”1 taco”,200],[“fried catfish|catfish”,”1 fillet”,300],[“fried shrimp”,”6 pieces”,250],
// ===== BREAD, GRAINS, CEREAL =====
[“bread|white bread”,”1 slice”,75],[“sourdough”,”1 slice”,120],[“bun|hamburger bun”,”1 bun”,120],[“english muffin”,”1 muffin”,130],
[“pita”,”1 pita”,165],[“quinoa”,”1 cup”,220],[“couscous”,”1 cup”,175],[“brown rice”,”1 cup”,215],[“bulgur”,”1 cup”,150],
[“grits”,”1 cup”,150],[“instant ramen”,”1 pack”,380],[“rice cake”,”1 cake”,35],[“frosted flakes”,”1 cup”,150],[“cheerios”,”1 cup”,100],
[“overnight oats”,”1 jar”,300],[“muesli”,”1/2 cup”,150],[“crepe”,”1 crepe”,100],[“biscuits”,”1 biscuit”,200],[“roll|dinner roll”,”1 roll”,90],
[“baguette”,”1 slice”,80],[“cornflakes|corn flakes”,”1 cup”,100],[“granola cereal”,”1/2 cup”,210],
// ===== SNACKS & CANDY =====
[“doritos|cheetos|lays|pringles|fritos|ruffles|takis”,”1 oz”,150],[“goldfish”,”1 oz”,140],[“cheez-it|cheezit”,”1 oz”,150],
[“ritz”,”5 crackers”,80],[“pop tart|poptart”,”1 pastry”,200],[“fruit snacks”,”1 pouch”,80],[“gummy bears|gummies|gummy”,”1 oz”,100],
[“skittles|starburst|sour patch”,”1 pack”,230],[“mnms|m n ms”,”1 small pack”,240],[“kit kat|kitkat”,”1 bar”,210],[“snickers”,”1 bar”,250],
[“reeses|reese”,”2 cups”,210],[“twix”,”1 pack”,250],[“milky way”,”1 bar”,240],[“hershey|hersheys”,”1 bar”,210],[“dark chocolate”,”1 oz”,170],
[“chocolate chips”,”1 tbsp”,70],[“nutella”,”1 tbsp”,100],[“jam|jelly”,”1 tbsp”,50],[“honey”,”1 tbsp”,64],[“marshmallow”,”1 large”,25],
[“lollipop|sucker”,”1 pop”,60],[“popsicle|ice pop”,”1 pop”,45],[“ice cream sandwich”,”1 sandwich”,150],[“ice cream cone”,”1 cone”,200],
[“ice cream bar”,”1 bar”,250],[“gelato”,”1 scoop”,150],[“sorbet”,”1 scoop”,100],[“custard”,”1/2 cup”,150],[“flan”,”1 slice”,220],
[“creme brulee”,”1 ramekin”,350],[“jello|jell-o”,”1 cup”,80],[“whipped cream”,”2 tbsp”,50],[“rice pudding”,”1 cup”,300],
[“baklava”,”1 piece”,330],[“eclair”,”1 eclair”,260],[“cannoli”,”1 cannoli”,250],[“macaron”,”1 macaron”,70],[“danish|pastry”,”1 danish”,350],
[“scone”,”1 scone”,360],[“pumpkin pie”,”1 slice”,320],[“pecan pie”,”1 slice”,500],[“key lime pie”,”1 slice”,400],[“peach cobbler|cobbler”,”1 serving”,350],
[“blondie”,”1 bar”,250],[“chocolate cake|birthday cake”,”1 slice”,350],[“carrot cake”,”1 slice”,450],[“red velvet”,”1 slice”,420],
[“frosting|icing”,”2 tbsp”,140],[“sugar cookie”,”1 cookie”,130],[“krispy kreme|original glazed”,”1 donut”,190],[“timbit”,”1 piece”,70],
[“rice krispie treat”,”1 bar”,90],[“smore”,”1 s’more”,150],[“granola bar|cereal bar”,”1 bar”,120],[“trail mix bar”,”1 bar”,190],
[“peanuts|roasted peanuts”,”1 oz”,160],[“cashew”,”1 oz”,160],[“walnut”,”1 oz”,185],[“pistachio”,”1 oz”,160],[“pecan”,”1 oz”,196],
[“sunflower seeds”,”1 oz”,165],[“pumpkin seeds”,”1 oz”,160],[“chia seed”,”1 tbsp”,60],[“flaxseed”,”1 tbsp”,55],
[“dried fruit”,”1/4 cup”,120],[“protein bar”,”1 bar”,210],[“popcorn kernel|microwave popcorn”,”1 bag”,300],[“kettle corn”,”3 cups”,150],
// ===== DAIRY & EGG ITEMS =====
[“cheddar|mozzarella|swiss|parmesan|provolone|american cheese”,”1 oz”,110],[“string cheese”,”1 stick”,80],[“cream”,”1 tbsp”,50],
[“creamer|coffee creamer”,”1 tbsp”,35],[“sour cream”,”2 tbsp”,60],[“whole milk”,”1 cup”,150],[“skim milk”,”1 cup”,85],
[“soy milk”,”1 cup”,100],[“kefir”,”1 cup”,110],[“ghee”,”1 tbsp”,120],[“ricotta”,”1/2 cup”,170],[“feta”,”1 oz”,75],[“eggnog”,”1 cup”,350],
[“bagelcreamcheese”,”1 bagel”,400],[“eggs benedict”,”1 serving”,700],[“quiche”,”1 slice”,400],[“frittata”,”1 slice”,250],
[“yogurt parfait|parfait”,”1 parfait”,300],[“acai bowl”,”1 bowl”,500],[“smoothie bowl”,”1 bowl”,350],
// ===== DRINKS (non-alcoholic) =====
[“red bull”,”8.4 oz”,110],[“monster”,”16 oz”,210],[“rockstar”,”16 oz”,250],[“celsius”,”12 oz”,10],[“vitamin water|vitaminwater”,”20 oz”,120],
[“arnold palmer”,”16 oz”,100],[“capri sun|juice box”,”1 pouch”,70],[“apple juice”,”1 cup”,115],[“cranberry juice”,”1 cup”,130],
[“grape juice”,”1 cup”,150],[“tomato juice|v8″,”1 cup”,40],[“premier protein”,”1 shake”,160],[“ensure”,”1 bottle”,220],
[“apple cider”,”1 cup”,120],[“tonic water”,”12 oz”,125],[“root beer float”,”1 float”,400],[“shirley temple”,”12 oz”,150],
[“americano”,”12 oz”,5],[“espresso”,”1 shot”,3],[“flat white”,”12 oz”,170],[“iced latte”,”16 oz”,130],[“vanilla latte”,”16 oz”,250],
[“mocha frappuccino”,”16 oz”,420],[“hot tea with honey”,”1 cup”,65],[“orange soda”,”12 oz”,160],
// ===== ALCOHOL =====
[“red wine|white wine”,”1 glass”,125],[“champagne|prosecco”,”1 glass”,90],[“light beer|bud light|miller lite|coors light|michelob ultra”,”12 oz”,100],
[“ipa|craft beer”,”12 oz”,200],[“hard cider|cider”,”12 oz”,200],[“gin”,”1 shot”,100],[“moscow mule”,”1 drink”,180],[“old fashioned”,”1 drink”,160],
[“mojito”,”1 drink”,220],[“pina colada”,”1 drink”,450],[“daiquiri”,”1 drink”,250],[“bloody mary”,”1 drink”,125],[“long island”,”1 drink”,780],
[“white russian”,”1 drink”,400],[“martini”,”1 drink”,160],[“cosmopolitan”,”1 drink”,200],[“aperol spritz|spritz”,”1 drink”,150],
[“smirnoff ice|hard lemonade”,”12 oz”,200],[“irish coffee”,”1 cup”,200],[“tequila sunrise”,”1 drink”,190],[“paloma”,”1 drink”,200],
[“sake”,”4 oz”,160],[“soju”,”1 shot”,70],[“mixed drink”,”1 drink”,180],[“sangria”,”1 glass”,170],[“mimosa”,”1 glass”,120],
// ===== ITALIAN =====
[“risotto”,”1 cup”,340],[“gnocchi”,”1 cup”,250],[“ravioli”,”1 cup”,300],[“carbonara”,”1 plate”,800],[“bolognese|meat sauce”,”1 cup”,200],
[“marinara”,”1/2 cup”,70],[“pesto”,”1 tbsp”,80],[“bruschetta”,”1 piece”,80],[“calzone”,”1 calzone”,800],[“stromboli”,”1 slice”,300],
[“eggplant parmesan”,”1 serving”,500],[“focaccia”,”1 slice”,150],[“panini”,”1 sandwich”,600],[“penne|rigatoni|linguine|fettuccine”,”1 serving”,330],
// ===== MEXICAN / LATIN =====
[“street taco”,”1 taco”,180],[“chilaquiles”,”1 plate”,500],[“pozole”,”1 bowl”,300],[“elote”,”1 ear”,250],[“taco salad”,”1 salad”,700],
[“pupusa”,”1 pupusa”,250],[“arepa”,”1 arepa”,280],[“empanada”,”1 empanada”,280],[“ceviche”,”1 cup”,150],[“tostada”,”1 tostada”,250],
[“carne asada”,”6 oz”,350],[“carnitas”,”4 oz”,280],[“al pastor”,”1 taco”,190],[“birria”,”1 taco”,250],[“tres leches”,”1 slice”,400],
// ===== INDIAN =====
[“dal|daal”,”1 cup”,200],[“palak paneer|saag paneer”,”1 cup”,300],[“chana masala”,”1 cup”,280],[“biryani”,”1 cup”,300],
[“tandoori chicken”,”1 leg”,260],[“paneer”,”3 oz”,260],[“roti|chapati”,”1 roti”,100],[“dosa”,”1 dosa”,170],[“idli”,”1 idli”,40],
[“paratha”,”1 paratha”,250],[“lassi”,”1 cup”,200],[“gulab jamun”,”1 piece”,150],[“pakora”,”1 piece”,70],[“korma”,”1 cup”,400],
// ===== THAI / VIETNAMESE / SE ASIAN =====
[“green curry|red curry|yellow curry”,”1 cup”,300],[“pad see ew”,”1 plate”,700],[“tom yum”,”1 cup”,90],[“summer roll|fresh roll”,”1 roll”,70],
[“satay”,”1 skewer”,70],[“mango sticky rice”,”1 serving”,400],[“papaya salad|som tam”,”1 cup”,100],[“nasi goreng”,”1 plate”,600],
[“laksa”,”1 bowl”,550],[“massaman curry”,”1 cup”,350],
// ===== JAPANESE / KOREAN =====
[“udon”,”1 bowl”,400],[“soba”,”1 cup”,110],[“onigiri”,”1 piece”,180],[“okonomiyaki”,”1 pancake”,500],[“takoyaki”,”1 ball”,50],
[“yakitori”,”1 skewer”,70],[“sashimi”,”4 pieces”,100],[“nigiri”,”1 piece”,55],[“california roll”,”8 pieces”,255],[“spicy tuna roll”,”6 pieces”,290],
[“mochi”,”1 piece”,100],[“bulgogi|korean bbq”,”4 oz”,250],[“kimchi fried rice”,”1 cup”,300],[“japchae”,”1 cup”,300],[“tteokbokki”,”1 cup”,350],
[“korean fried chicken”,”1 piece”,250],[“kimbap”,”1 roll”,400],[“hibachi chicken”,”1 plate”,600],[“hibachi steak”,”1 plate”,700],
// ===== MIDDLE EASTERN / GREEK =====
[“tzatziki”,”2 tbsp”,30],[“dolma”,”1 piece”,40],[“spanakopita”,”1 piece”,200],[“moussaka”,”1 serving”,400],[“souvlaki”,”1 skewer”,150],
[“kebab|kabob”,”1 skewer”,200],[“baba ganoush”,”2 tbsp”,40],[“tabbouleh”,”1 cup”,150],[“shakshuka”,”1 serving”,350],[“lamb gyro”,”1 gyro”,650],
// ===== SOUTHERN / EUROPEAN / OTHER =====
[“schnitzel”,”1 piece”,450],[“bratwurst|brat”,”1 brat”,300],[“pierogi”,”1 pierogi”,80],[“clam chowder”,”1 cup”,200],[“gumbo”,”1 cup”,250],
[“jambalaya”,”1 cup”,300],[“po boy|po’boy”,”1 sandwich”,800],[“beignet”,”1 beignet”,90],[“hush puppy”,”1 piece”,70],[“bbq sauce”,”2 tbsp”,60],
[“hot sauce|tabasco”,”1 tsp”,1],[“soy sauce”,”1 tbsp”,10],[“mustard”,”1 tsp”,3],[“tartar sauce”,”2 tbsp”,140],[“gravy”,”1/4 cup”,50],
[“alfredo sauce”,”1/4 cup”,110],[“teriyaki sauce”,”1 tbsp”,15],[“sriracha”,”1 tsp”,5],[“honey mustard”,”2 tbsp”,130],
[“thousand island”,”2 tbsp”,120],[“italian dressing|vinaigrette”,”2 tbsp”,70],[“blue cheese dressing”,”2 tbsp”,150],[“caesar dressing”,”2 tbsp”,160],
[“peanut sauce”,”2 tbsp”,100],[“guac”,”2 tbsp”,50],[“aioli”,”1 tbsp”,90],[“relish”,”1 tbsp”,20],
// ===== SOUPS =====
[“chicken noodle soup”,”1 cup”,90],[“tomato soup”,”1 cup”,100],[“broccoli cheddar soup”,”1 bowl”,360],[“french onion soup”,”1 bowl”,400],
[“minestrone”,”1 cup”,120],[“lentil soup”,”1 cup”,180],[“split pea soup”,”1 cup”,190],[“bread bowl”,”1 bowl”,700],
// ===== MORE FAST FOOD & CHAINS =====
[“popeyes chicken sandwich|spicy chicken sandwich”,”1 sandwich”,650],[“double double”,”1 burger”,670],[“animal style fries”,”1 order”,750],
[“shackburger”,”1 burger”,500],[“crazy bread”,”1 piece”,100],[“pizza crust”,”1 slice”,120],[“deep dish pizza”,”1 slice”,450],[“thin crust pizza”,”1 slice”,220],
[“buffalo chicken wrap”,”1 wrap”,550],[“chicken quesadilla”,”1 quesadilla”,550],[“steak quesadilla”,”1 quesadilla”,600],
[“loaded nachos”,”1 plate”,900],[“cheese fries”,”1 order”,550],[“chili cheese fries”,”1 order”,650],[“onion blossom”,”1 appetizer”,1600],
[“spinach dip”,”1/4 cup”,120],[“bread basket”,”1 piece”,100],[“side salad”,”1 side”,120],[“house salad”,”1 salad”,250],
// Add-ons
[“ketchup”,”1 tbsp”,20],[“mayo|mayonnaise”,”1 tbsp”,90],[“ranch”,”1 tbsp”,70],[“olive oil|oil”,”1 tbsp”,120],[“butter”,”1 tbsp”,100],
[“syrup”,”1 tbsp”,50],[“sugar”,”1 tsp”,16],[“dressing”,”2 tbsp”,130]
];
var NUMWORDS = {couple:2,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,dozen:12,half:0.5};
// Build regexes once
FOODS = FOODS.map(function(f){
var aliases = f[0].split(“|”).map(function(a){
var src = a.replace(/[.*+?^${}[\]\\]/g, function(c){ return /[()|]/.test(c) ? c : “\\”+c; });
return { text:a, len:a.length, re:new RegExp(“\\b(?:”+src+”)(?:s|es)?\\b”) };
});
return { aliases:aliases, serving:f[1], kcal:f[2], label:({macncheese:”mac and cheese”,fishnchips:”fish and chips”,sweetnsour:”sweet and sour chicken”,beefnbroccoli:”beef and broccoli”,quarterpounder:”quarter pounder with cheese”,baconeggcheese:”bacon, egg and cheese”,chickenwaffles:”chicken and waffles”,biscuitsgravy:”biscuits and gravy”,hamcheese:”ham and cheese sandwich”,pbj:”peanut butter and jelly sandwich”,mnms:”M&Ms”,bagelcreamcheese:”bagel with cream cheese”})[f[0].split(“|”)[0]]||f[0].split(“|”)[0] };
});
function findFood(seg){
var best=null, bestLen=0;
FOODS.forEach(function(f){
f.aliases.forEach(function(a){
if(a.re.test(seg) && a.len>bestLen){ best=f; bestLen=a.len; }
});
});
return best;
}
function lev(a,b){
var m=a.length,n=b.length,d=[],i,j;
if(Math.abs(m-n)>2) return 9;
for(i=0;i<=m;i++) d[i]=[i];
for(j=1;j<=n;j++) d[0][j]=j;
for(i=1;i<=m;i++) for(j=1;j=5;});
var best=null, bd=9;
if(!words.length) return null;
FOODS.forEach(function(f){
f.aliases.forEach(function(a){
if(a.len-1 || /[^a-z]/.test(a.text)) return;
words.forEach(function(w){
var d=lev(w,a.text), max=a.len>=8?2:1;
if(d>0 && d<=max && d<bd){ bd=d; best=f; }
});
});
});
return best;
}
function cap(s){ return s.charAt(0).toUpperCase()+s.slice(1); }
function esc(s){ return String(s).replace(/[&”‘]/g,function(c){return {“&”:”&”,””:”>”,'”‘:”"”,”‘”:”'”}[c];}); }
function parseQty(seg){
var s = seg.replace(/\d+(?:\.\d+)?\s*(?:oz|ounces?|g|grams?|ml|lbs?|pounds?|kg)\b/g,””); // ignore weights like “6 oz”
var m = s.match(/(\d+)\s+(\d+)\/(\d+)/);
if(m) return +m[1] + (+m[2])/(+m[3]);
m = s.match(/(\d+)\/(\d+)/);
if(m) return (+m[1])/(+m[2]);
m = s.match(/(\d+(?:\.\d+)?)/);
if(m) return +m[1];
m = s.match(/\b(couple|two|three|four|five|six|seven|eight|nine|ten|dozen|half)\b/);
if(m) return NUMWORDS[m[1]];
return 1;
}
function parseSegment(seg){
// Exact calories typed in, e.g. “300 calories of cake”
var c = seg.match(/(\d+(?:\.\d+)?)\s*(?:kcal|cals?|calories)\b/);
if(c){
var nm = seg.replace(c[0],””).replace(/\b(of|worth|about|around|a|an)\b/g,””).replace(/\s+/g,” “).trim() || “custom item”;
return {name:cap(nm), serving:”as entered”, kcal:+c[1], qty:1, known:true};
}
var food = findFood(seg) || fuzzyFind(seg);
if(!food){
var label = seg.replace(/^\s*(\d+(?:\.\d+)?|a|an|one|some|a couple of)\s+/,””).trim() || seg;
return {name:cap(label), serving:””, kcal:null, qty:1, known:false, manual:””};
}
var size = 1, tag = “”;
if(/\b(extra large|xl|huge|giant)\b/.test(seg)){ size = 1.6; tag = “extra large”; }
else if(/\b(large|big|jumbo)\b/.test(seg)){ size = 1.35; tag = “large”; }
else if(/\b(small|mini|kid)\b/.test(seg)){ size = 0.7; tag = “small”; }
var serving = (tag ? tag+” · ” : “”) + food.serving;
return {name:cap(food.label), serving:serving, kcal:Math.round(food.kcal*size), qty:parseQty(seg), known:true};
}
function parseInput(text){
var t = text.toLowerCase()
.replace(/mac\s*(?:and|&|n)\s*cheese/g,”macncheese”)
.replace(/fish\s*(?:and|&|n)\s*chips/g,”fishnchips”)
.replace(/sweet\s*(?:and|&|n)\s*sour/g,”sweetnsour”)
.replace(/(?:beef|broccoli)\s*(?:and|&|n)\s*(?:broccoli|beef)/g,”beefnbroccoli”)
.replace(/quarter\s*pounder(?:\s+with\s+cheese)?/g,”quarterpounder”)
.replace(/bacon,?\s*egg,?\s*(?:and|&|n)\s*cheese/g,”baconeggcheese”)
.replace(/chicken\s*(?:and|&|n)\s*waffles?/g,”chickenwaffles”)
.replace(/biscuits?\s*(?:and|&|n)\s*gravy/g,”biscuitsgravy”)
.replace(/ham\s*(?:and|&|n)\s*cheese/g,”hamcheese”)
.replace(/\bm\s*&\s*m’?s?\b/g,”mnms”)
.replace(/bagel\s+with\s+cream cheese/g,”bagelcreamcheese”)
.replace(/\b(?:gin|vodka|rum|whiskey|whisky|bourbon|jack|tequila|scotch)\s*(?:and|&|n|with)\s*(?:tonic|coke|cola|soda|sprite|ginger ale|ginger beer|cranberry|juice|lemonade)/g,”mixed drink”)
.replace(/pb\s*(?:and|&|n)\s*j\b|peanut butter\s*(?:and|&|n)\s*jelly/g,”pbj”);
return t.split(/,|;|\n|\+|&|\band\b|\bwith\b/)
.map(function(s){return s.replace(/\b(?:from|at)\s+[a-z0-9′. ]+$/,””).trim();})
.filter(Boolean)
.map(parseSegment);
}
// ———- Steps math ———-
// Walking burns ~0.57 calories per pound of body weight per mile; ~2,100 steps per mile.
var STEPS_PER_MILE = 2100, STEPS_PER_MIN = 110;
function kcalPerStep(){
var w = parseFloat(el(“weight”).value);
var unit = el(“unit”).value;
if(!(w>0)) w = 160; // default average weight in lb
else if(unit===”kg”) w = w*2.20462;
return 0.57*w/STEPS_PER_MILE;
}
// ———- UI ———-
var state = [];
function el(id){ return document.getElementById(“fts-“+id); }
function render(){
var box = el(“items”);
box.innerHTML = state.map(function(it,i){
if(!it.known){
return ‘
‘+
‘
‘+esc(it.name)+’Not in our food list. Enter the total calories:
‘+
”+
‘
× ‘;
}
return ‘
‘+
”+
‘
‘+esc(it.name)+(it.serving?’per ‘+esc(it.serving)+’ · ‘+it.kcal+’ cal ‘:”)+’
‘+
‘
‘+
‘
× ‘;
}).join(“”);
totals();
}
function totals(){
var cal = 0;
state.forEach(function(it,i){
var row = el(“items”).querySelector(‘[data-i=”‘+i+'”]’);
if(it.known){
var c = Math.round((it.qty||0)*it.kcal);
cal += c;
if(row) row.querySelector(“.kc”).textContent = c.toLocaleString()+” cal”;
} else {
cal += parseFloat(it.manual)||0;
}
});
var steps = Math.round(cal / kcalPerStep());
el(“cal”).textContent = Math.round(cal).toLocaleString();
el(“steps”).textContent = steps.toLocaleString();
el(“miles”).textContent = (steps/STEPS_PER_MILE).toFixed(1);
el(“mins”).textContent = Math.round(steps/STEPS_PER_MIN).toLocaleString();
el(“result”).classList.add(“show”);
var cta = el(“cta”); if(cta) cta.classList.toggle(“show”, cal>0);
}
function calculate(){
var text = el(“food”).value.trim();
if(!text){ el(“food”).focus(); return; }
state = parseInput(text);
render();
el(“result”).scrollIntoView({behavior:”smooth”, block:”nearest”});
}
el(“go”).addEventListener(“click”, calculate);
el(“food”).addEventListener(“keydown”, function(e){
if(e.key===”Enter” && (e.ctrlKey||e.metaKey)) calculate();
});
el(“weight”).addEventListener(“input”, function(){ if(state.length) totals(); });
el(“unit”).addEventListener(“change”, function(){ if(state.length) totals(); });
el(“chips”).addEventListener(“click”, function(e){
var ex = e.target.getAttribute && e.target.getAttribute(“data-ex”);
if(ex){ el(“food”).value = ex; calculate(); }
});
el(“items”).addEventListener(“input”, function(e){
var row = e.target.closest(“.item”); if(!row) return;
var it = state[+row.getAttribute(“data-i”)];
if(e.target.classList.contains(“qty”)) it.qty = parseFloat(e.target.value)||0;
if(e.target.classList.contains(“manual”)) it.manual = e.target.value;
totals();
});
el(“items”).addEventListener(“click”, function(e){
if(!e.target.classList.contains(“rm”)) return;
var row = e.target.closest(“.item”);
state.splice(+row.getAttribute(“data-i”),1);
render();
});
})();