Keto Calculator — Ketogenic Diet Macros

Calculate your personalized ketogenic diet macros: daily fat, protein, and carbohydrate targets to enter and maintain ketosis. Based on your weight, activity level, and goals.

This calculator estimates your TDEE, applies your goal's calorie adjustment, then sets keto-specific macros: carbs capped low (~25g net carbs) to support ketosis, protein based on estimated lean mass, and fat filling the rest. Keto isn't right for everyone — see the note in the tool and the guide below before starting.

Your details Ketogenic macros
Before starting keto: this diet was originally developed as a medical therapy and isn't right for everyone. If you have diabetes (especially if you take insulin or other blood-sugar-lowering medication), or a pancreatic, liver, kidney, or gallbladder condition, are pregnant or breastfeeding, or take any regular medication, talk to a doctor before starting — some combinations carry real risks and may need medical supervision or dose adjustments.
yrs
ft
in
lbs
lbs

The ketogenic diet is a very-low-carbohydrate, high-fat eating pattern designed to shift the body's primary fuel source from glucose to ketones — a state called ketosis. This calculator estimates daily fat, protein, and net carb targets from your body stats, activity level, and goal. Because keto is a more significant dietary shift than the other calculators on this site, and because it started as a medical therapy rather than a general wellness trend, this guide spends more time than usual on who should check with a doctor before starting.

Before you startKeto isn't right for everyone. Talk to a doctor first if you have diabetes (especially if you take insulin or other blood-sugar-lowering medication), a pancreatic, liver, kidney, or gallbladder condition, are pregnant or breastfeeding, or take any regular medication. See the section below for more detail.

What ketosis actually is

Under normal eating patterns, the body runs primarily on glucose derived from dietary carbohydrates. When carbohydrate intake drops low enough — and stays low for long enough to deplete the liver’s glycogen (stored glucose) reserves — the body shifts to breaking down fat into ketone bodies, which the brain and most other tissues can use as an alternative fuel source. This metabolic state is ketosis, and it’s the mechanism the entire diet is built around: restrict carbs enough, consistently enough, and the body switches its default fuel source from glucose to fat-derived ketones.

Ketosis is a normal, well-studied metabolic state, not an emergency — it’s distinct from diabetic ketoacidosis (DKA), a dangerous condition involving dangerously high ketone levels combined with high blood glucose, which occurs almost exclusively in people with insulin-deficient diabetes and is a completely different physiological situation from nutritional ketosis in someone without diabetes. The two are sometimes confused because they share the word “ketosis,” but the blood ketone levels involved, the underlying cause, and the risk differ substantially between them.

Blood ketone levels give a useful sense of scale here: nutritional ketosis from a well-formulated keto diet typically produces blood beta-hydroxybutyrate (the main ketone measured by home meters) in the range of roughly 0.5–3.0 mmol/L, with much of that range considered a normal, stable state rather than something requiring concern. DKA, by contrast, typically involves ketone levels well above that range combined with high blood glucose and blood pH low enough to require emergency treatment — a combination that essentially can’t happen in someone without significantly impaired insulin function, since insulin (even at low background levels in a non-diabetic person) keeps ketone production within a bounded, physiological range.

How this calculator estimates your macros

The calculation starts the same way as this site’s other calorie tools: TDEE from the Mifflin-St Jeor equation and your activity level, adjusted by your selected goal (a 20% deficit for weight loss, a 10% surplus for muscle gain, or no adjustment for maintenance). From there, the macro split follows keto-specific logic rather than the percentage-based approach used by the Macro Calculator:

Keto macro order1. Carbs: ~5% of calories, capped at 25g net carbs for strict keto
2. Protein: set from your protein preference × estimated lean body mass
3. Fat: fills the remaining calorie budget

Carbs are set first and capped low, since staying under a carb ceiling is what actually maintains ketosis — this is the one non-negotiable constraint the diet is built around. Protein comes next, based on a protein-per-pound-of-lean-mass preference (0.8–1.2g/lb) rather than a flat percentage, since protein needs scale more directly with lean tissue than with total calories. Fat absorbs whatever calorie budget remains after carbs and protein are set, which is why fat consistently ends up as the largest share of total calories on keto — commonly 65–75%, matching the ranges cited by most major keto resources.

Worked example

Using this calculator’s own default example — a 35-year-old man, 185 lbs, 5’10” tall, lightly active, goal: maintain, moderate protein preference (1.0g/lb lean mass):

Step by stepBMR ≈ 1,780 cal/day · TDEE ≈ 1,780 × 1.375 = 2,448 cal/day (maintenance, no adjustment)
Carbs: 2,448 × 0.05 ÷ 4 ≈ 31g → capped at 25g net carbs (100 cal)
Lean mass ≈ 185 × (1 − 0.18) = 152 lbs · Protein: 152 × 1.0 = 152g (608 cal)
Fat: 2,448 − 100 − 608 = 1,740 cal ÷ 9 ≈ 193g

That works out to roughly 71% fat, 25% protein, and 4% net carbs by calories — squarely within the standard ketogenic macro ranges. The 18% body fat figure used for the lean-mass estimate (25% for the female default) is a rough population-average assumption, not a personal measurement; anyone who has an actual body fat percentage from this site’s Body Fat Calculator or another source can mentally adjust the protein target — a meaningfully leaner or higher-body-fat starting point will shift the “true” lean mass, and therefore the protein target, somewhat from this estimate.

Net carbs explained

“Net carbs” is the number virtually everyone on keto tracks instead of total carbs, and it’s calculated as total carbohydrate grams minus fiber grams (some people also subtract sugar alcohols). The logic behind the subtraction is that fiber isn’t broken down into glucose during digestion the way other carbohydrates are, so it doesn’t meaningfully raise blood glucose or interfere with ketosis, even though it’s counted within “total carbohydrates” on a nutrition label.

Net carbs formulaNet carbs = Total carbs − Fiber (− sugar alcohols, for some trackers)

Most current guidance places strict keto at under 20g net carbs per day, with a more moderate 20–50g range remaining workable for many people — especially after several weeks of full “fat-adaptation,” when the body’s ketone-producing machinery becomes more efficient and can tolerate a somewhat wider carb range while remaining in ketosis. This calculator caps its carb target at 25g regardless of the 5%-of-calories calculation, landing it within that commonly-cited strict range as a reasonably safe default.

Entering and staying in ketosis

Most people reach measurable ketosis within 2–4 days of consistently restricting net carbs to the 20–50g range, once existing glycogen stores are depleted — exercise can speed this up, since physical activity burns through glycogen faster than rest alone. Ketone levels can be verified with urine test strips (least accurate but cheapest and easiest), breath ketone meters, or blood ketone meters (most accurate, using a fingerstick similar to a glucose test), with blood testing generally considered the gold standard for anyone who wants a precise reading rather than a rough indicator.

Staying in ketosis over the following weeks and months comes down almost entirely to consistency with the carb ceiling — a single higher-carb meal can temporarily interrupt ketone production, but this isn’t a permanent setback; returning to carbohydrate restriction typically restores ketosis within a day or two for most people. Individual carb tolerance while remaining in ketosis varies meaningfully between people based on factors like muscle mass, insulin sensitivity, and activity level, which is part of why this calculator’s 25g default is a reasonably conservative starting point rather than a number that applies identically to everyone.

There’s also a documented, if less widely discussed, sex difference in carb tolerance on keto: men tend to tolerate somewhat higher carbohydrate intake while remaining in ketosis than women do, likely related to differences in average muscle mass and baseline metabolic rate. Hormonal fluctuations across the menstrual cycle can shift a woman’s carb tolerance further, with insulin sensitivity typically higher during the follicular phase and lower during the luteal phase — meaning the exact same carbohydrate intake might maintain ketosis at one point in the cycle but not another. None of this changes the basic mechanism, but it’s a reasonable explanation for why two people following what looks like an identical keto approach can have noticeably different experiences with the same carb ceiling.

Keto flu and electrolytes

“Keto flu” refers to a cluster of symptoms — headache, fatigue, brain fog, irritability, nausea — that many people experience during the first one to two weeks of a ketogenic diet, as the body adjusts from primarily burning glucose to primarily burning ketones. It’s largely driven by electrolyte shifts rather than the ketones themselves: as insulin levels drop on a low-carb diet, the kidneys excrete more sodium than usual, and that sodium loss carries potassium and magnesium out with it.

Common prevention approachIncrease water intake (commonly 3–4 liters/day) · Add extra salt to food · Prioritize potassium-rich keto foods (avocado, leafy greens) · Consider a magnesium supplement

Symptoms typically resolve within about a week as the body adjusts and electrolyte losses are replaced. Persistent or severe symptoms — beyond the usual mild, short-term adjustment period — are worth discussing with a doctor rather than pushing through, since they can sometimes signal an electrolyte imbalance significant enough to need direct correction.

Who should talk to a doctor before starting keto

Keto was originally developed as a medical treatment for epilepsy, and it remains a clinically-supervised intervention for a range of conditions today — which is a useful reminder that it’s a genuine metabolic shift, not a low-stakes change. A few groups in particular should talk to a doctor before starting, rather than beginning on their own:

  • Anyone with diabetes — particularly if you use insulin or other blood-sugar-lowering medication. Combining certain diabetes medications (including SGLT2 inhibitors) with a ketogenic diet carries a documented risk of a serious complication called euglycemic diabetic ketoacidosis, where blood pH drops dangerously even though blood glucose looks normal. Medication doses often need adjustment when starting keto, and that adjustment should happen under medical guidance, not through self-experimentation.
  • Anyone with pancreatic, liver, kidney, or gallbladder conditions — a high-fat diet places different demands on digestion and metabolism than a typical diet, and these organs are directly involved in processing that fat.
  • Anyone who is pregnant or breastfeeding — nutritional needs during this period are different, and a major dietary shift is not something to start without medical input.
  • Anyone on regular medication of any kind — several medication classes (including some blood pressure medications and diuretics) can interact with the fluid and electrolyte shifts that come with starting keto, and dosing may need to be reviewed.

None of this means keto is unsafe for everyone in these groups — many people in several of these categories do use ketogenic diets, sometimes specifically under medical supervision for a clinical reason. The point is narrower: these are exactly the situations where “figure it out from a calculator and some articles” is the wrong approach, and a conversation with a doctor first is what changes an genuinely risky situation into a well-managed one.

Is keto right for everyone else?

Even setting the medical considerations above aside, keto is a significantly more restrictive eating pattern than most alternatives, and restrictiveness has real trade-offs beyond the diet’s direct physiological effects. It can be harder to sustain socially (many default restaurant and gathering foods are carb-heavy), harder to sustain psychologically for people prone to rigid or all-or-nothing thinking about food, and it eliminates entire food categories — whole grains, legumes, most fruits, starchy vegetables — that carry their own nutritional benefits, which need to be deliberately replaced from the foods keto does allow.

None of this makes keto a bad choice for everyone; plenty of people find it a genuinely sustainable, effective approach for their specific goals and preferences. But it’s worth choosing deliberately rather than by default, and revisiting periodically — if a restrictive diet starts to feel like a source of stress, isolation, or disordered eating patterns rather than a sustainable tool, that’s a signal worth taking seriously and discussing with a doctor or registered dietitian, not a sign of failing at the diet.

Frequently asked questions
How many carbs can I eat on keto?
Most ketogenic diets limit net carbs to 20–50g per day. "Net carbs" means total carbs minus fiber. Staying under 20g is most reliable for reaching and maintaining ketosis, especially early on; after 4–8 weeks of fat-adaptation, some people can increase toward 30–50g and remain in ketosis. This calculator caps its carb target at 25g by default. Individual tolerance varies — if progress stalls, lowering carbs further is the usual first adjustment.
How long does it take to enter ketosis?
Most people reach measurable ketosis within 2–4 days of consistently restricting net carbs, once glycogen stores are depleted — exercise speeds this up. Signs include increased thirst and urination, "keto breath," reduced appetite, initial fatigue ("keto flu"), and eventually more stable energy. Urine strips, breath meters, or blood ketone meters can confirm it directly.
What is "keto flu" and how do I avoid it?
Keto flu is a set of temporary symptoms (headache, fatigue, brain fog, irritability, nausea) during the first 1–2 weeks, largely caused by electrolyte loss as insulin drops and the kidneys excrete more sodium, taking potassium and magnesium with it. Prevention: drink plenty of water, add salt to food, eat potassium-rich keto foods like avocado and leafy greens, and consider a magnesium supplement. Symptoms typically resolve within about a week.
Is keto safe for people with diabetes?
This requires direct medical supervision, not self-guided experimentation. Combining certain diabetes medications — including SGLT2 inhibitors and insulin — with a ketogenic diet carries a documented risk of a serious complication called euglycemic diabetic ketoacidosis, and medication doses often need adjustment when starting keto. Anyone with diabetes should talk to their doctor before starting, especially if on blood-sugar-lowering medication.
Why is my protein target based on lean body mass instead of total weight?
Protein needs scale more directly with lean tissue than with total body weight, since fat tissue has much lower protein turnover than muscle. This calculator estimates lean mass using a rough population-average body fat assumption (18% for men, 25% for women) and multiplies by your chosen protein preference (0.8–1.2g per lb of lean mass). If you know your actual body fat percentage from a more precise source, you can adjust your expectations accordingly.
Can I build muscle on a ketogenic diet?
Yes, though it typically requires more deliberate protein and calorie planning than a higher-carb approach, since carbohydrate availability supports the high training volumes some muscle-building approaches rely on. Selecting the "muscle gain" goal on this calculator applies a 10% calorie surplus on top of your maintenance calories, with protein still set from your lean-mass-based preference.

This calculator provides general health information only and is not a substitute for professional medical advice, diagnosis, or treatment. The ketogenic diet has real medical contraindications for some people — please speak with a qualified healthcare provider before starting, especially if you have diabetes, a pancreatic, liver, kidney, or gallbladder condition, are pregnant or breastfeeding, or take regular medication.