An Obsidian plugin to track your food intake (calories, macronutrients) and nutritional information with real-time nutrition totals, intelligent food suggestions, and flexible entry methods including both database-driven and inline nutrition tracking.
This plugin works on mobile and desktop, with layouts that adapt to smaller screens.
- Add nutrients: Create nutrient entries with detailed nutritional information through a convenient modal interface
- OpenFoodFacts integration: Search and import nutritional data from the OpenFoodFacts database by product name or barcode
- Complete nutrition tracking: Track calories, fats, saturated fats, carbohydrates, sugar, fiber, protein, and sodium
- Metadata format: Stores nutritional data in YAML frontmatter for easy querying and analysis, including barcode, brand, and URL for products imported from OpenFoodFacts
- Configurable storage: Set a custom directory for storing nutrient files
- Configurable food tag: Customize the tag used for food entries (default:
#food, can be changed to#meal,#nutrition, etc.) - Intelligent autocomplete: Type your food tag followed by a food name for intelligent suggestions from your nutrient database
- Flexible food formats: Multiple ways to track your food:
- Database entries:
#food [[food-name]] amount- uses your nutrient database - Inline nutrition:
#food Food Name 300kcal 20fat 10prot 30carbs 3sugar- specify nutrition directly - Multiple units: Support for various units including g, kg, ml, l, oz, lb, cup, tbsp, tsp, pc
- Database entries:
- Visual highlighting: Food amounts and nutrition values are highlighted in the editor for easy identification
- Blue highlighting for calorie intake and nutrition values
- Red highlighting for calorie burns (workout tag or negative calories)
- Workout logging: Track exercise with a dedicated tag (default:
#workout) or by entering negative calories to subtract them from your totals- Autocomplete only suggests calorie values for workout entries (no food names or other nutrients)
- Visual distinction: workout calories are highlighted in red to differentiate from food intake
- Automatic daily total: Real-time calculation of total nutrition from all food entries in the current document
- Compact visual display: Clean nutrition bar with emoji indicators and progress bars
- Interactive tooltips: Hover over nutrition indicators to see detailed values and goal progress
- Flexible display modes: Show nutrition total in status bar or directly in the document
- Comprehensive metrics: Track calories, fats, saturated fats, protein, carbohydrates, fiber, sugar, and sodium
- Smart parsing: Automatically detects and calculates nutrition from food entries throughout your notes
- Frontmatter totals: Nutrition totals are automatically saved to file properties (e.g.,
ft-calories,ft-protein) for fast statistics loading and external querying
- Goals file support: Define daily nutrition goals in a simple text file
- Visual progress bars: Real-time progress indicators showing how close you are to your goals
- Color-coded feedback: Green (within 10% of goal), yellow (below 90%), red (exceeding goal)
- Compact nutrition bar: Bordered container with emoji progress indicators separated by vertical lines
- Enhanced tooltips: Detailed hover information shows values and goal completion percentages
- Flexible goal setting: Set goals for calories, fats, saturated fats, protein, carbohydrates, fiber, sugar, and sodium
- Quick access: Ribbon button opens a window with a month picker and daily macronutrient table
- Daily breakdown: Each row shows the same compact nutrition bar used in the status bar
- Fast loading: Statistics are read from frontmatter properties instead of re-parsing entire files
- Flexible matching: Daily notes are detected using a configurable filename format (default
YYYY-MM-DD)
- Open Obsidian
- Go to Settings > Community plugins
- Disable Safe mode if necessary
- Click Browse and search for "Food Tracker"
- Install the plugin
- Enable the plugin after installation
- Download the latest release from the GitHub repository
- Extract the ZIP file into your Obsidian vault's
.obsidian/plugins/folder - Enable the plugin in Obsidian settings
- Open the command palette (Ctrl/Cmd + P)
- Search for "Add nutrient" and select the command
- Fill in the nutrient information in the modal:
- Name or barcode (required)
- π Search: Use the search button to find foods in OpenFoodFacts database
- Enter a product name to search by text
- Enter a barcode (8-14 digits) to look up by barcode (EAN-8, UPC-A, EAN-13, ITF-14)
- Nutritional values per 100g:
- Calories
- Fats (in grams)
- Carbohydrates, sugar, fiber (in grams)
- Protein (in grams)
- Sodium (in milligrams)
- Optional: Serving size to specify typical weight of one piece (in grams)
- Click "Create" to save the nutrient file
- In any note, type your food tag (default:
#food) followed by a space - Start typing a food name - autocomplete suggestions will appear from your database
- Select a food item and add the amount with unit:
#food [[apple]] 150g #food [[chicken-breast]] 200g #food [[oats]] 50g
For quick tracking without creating database entries, specify nutrition values directly:
#food Breakfast sandwich 250kcal 15fat 12prot 20carbs
#food Protein shake 180kcal 8fat 25prot 5carbs 2sugar
#food Mixed nuts snack 200kcal 18fat 6prot 8carbs
Supported nutrition keywords:
kcal- caloriesfat- fats in gramssatfat- saturated fats in gramsprot- protein in gramscarbs- carbohydrates in gramssugar- sugar in gramsfiber- fiber in grams (database entries only)sodium- sodium in milligrams (database entries only)
You can combine both methods in the same document:
#food [[oatmeal]] 50g
#food Quick protein bar 200kcal 8fat 15prot 20carbs
#food [[banana]] 1pc
The nutrition total will automatically update as you add food entries using any method.
Deduct workout calories from your daily totals in two ways:
-
Use the dedicated workout tag (default:
#workout):#workout Morning run 230kcal #workout Strength training 180kcalWhen you type
#workoutfollowed by a description and start typing numbers, autocomplete will suggest only calorie values (e.g.,300kcal). Food names and other nutrition keywords are not available with the workout tag.Important: Workout tags only accept positive calorie values. Negative values (e.g.,
#workout running -200kcal) are invalid and will be ignored in calculations and not highlighted. This ensures clear semantics: workout entries always represent calories burned. -
Enter negative calories directly with your food tag for ad-hoc workout tracking:
#food Evening yoga -120kcal
In both cases, the plugin subtracts the logged calories (and any other specified nutrients) from your daily totals. Calories logged with the workout tag or as negative values are highlighted in red in the editor to visually distinguish calorie burns from calorie intake (which is highlighted in blue).
Calorie floor: Your total calorie count is always floored at 0. If your workout calories exceed your food intake, the plugin displays 0 kcal instead of a negative value, ensuring totals never go below zero.
- Create a goals file in your vault (e.g.,
nutrition-goals.md) - Define your daily nutrition goals using the following format:
calories: 2000 fats: 70 protein: 120 carbs: 250 fiber: 25 sugar: 50 sodium: 2300 - Configure the goals file path in plugin settings
- Your nutrition totals will now display as a compact nutrition bar with emoji progress indicators
The nutrition bar displays as a bordered container with:
- Emoji indicators: Each nutrient represented by an emoji (π₯ calories, π₯ fats, π₯© protein, etc.)
- Progress bars: Visual progress indication within each emoji indicator
- Vertical separators: Clean lines between each nutrient for clarity
- Interactive tooltips: Hover over any emoji to see detailed values and goal completion percentages
The progress bars use color coding:
- Green: You're within 10% of your goal (90-110%)
- Yellow: You're below 90% of your goal
- Red: You've exceeded your goal (over 110%)
Go to Settings > Food Tracker to configure:
- Nutrient directory: Choose where nutrient files are stored (default: "nutrients"). The setting now offers type-ahead folder suggestions.
- Nutrition total display: Choose to show the total in the status bar or directly in the document
- Food tag: Customize the tag used for food entries (default: "food" for
#food, can be changed to "meal" for#meal, "nutrition" for#nutrition, etc.) - Workout tag: Customize the tag used for workout entries (default: "workout" for
#workout) - Daily note filename format: Specify the Moment.js-style pattern used to find daily notes (default:
YYYY-MM-DD). Supports tokens likeddddor literal text (e.g.,YYYY-MM-DD-[journal]). The preview shows how today's note would be named. - Daily note format examples:
YYYY.MM.DDβ2025.11.12YYYY-MM-DD-[journal]β2025-11-12-journaldddd YYYY-MM-DDβWednesday 2025-11-12
- Goals file: Specify the path to your nutrition goals file (e.g., "nutrition-goals.md"). The field includes type-ahead file suggestions.
- Metadata field names: Customize the frontmatter property names used for storing nutrition totals in daily notes. By default, the plugin uses
ft-prefixed names (e.g.,ft-calories,ft-protein). You can customize these to match your existing setup or personal preferences (e.g., justcaloriesinstead offt-calories).
Note: When you change the food or workout tag settings, the plugin will only recognize the new tags. Existing entries will need to be updated if you want them included in calculations.
- Obsidian v0.15.0 or higher
Run the development build with change watch:
yarn dev:watchRun the TypeScript type check:
yarn typecheckRun the linter:
yarn lintRun the tests:
yarn testRun the tests in watch mode:
yarn test:watchGenerate a coverage report:
yarn coverageFormat the code:
yarn formatBuild CSS from source:
yarn build:cssRun the production build (includes tests, type checking, and formatting):
yarn buildBump the version in package.json and manifest.json:
yarn versionFull release process (version bump, push, and tag):
yarn releaseThis plugin is licensed under the MIT License.