### [How To Create Your Own Macro Calculator in WordPress](https://wpforms.com/how-to-create-your-own-macro-calculator-in-wordpress/)

**Published:** March 6, 2024
**Author:** Hamza Shahid

**Excerpt:** Looking for a straightforward way to create your own Macro calculator for a health & fitness business website?

You’ll be glad to hear that WPForms can help create calculator forms that automatically estimate daily calorie targets for various fitness goals.

So, if you're trying to provide your website visitors with a quick approach to estimate their IIFYM (If It Fits Your Macros), follow the steps in this guide!

**Content:**

Looking for a straightforward way to create your own Macro calculator for a health & fitness business website?

You’ll be glad to hear that WPForms can help create calculator forms that automatically estimate daily calorie targets for various fitness goals.

[Create Your Macronutrients Calculator Now](https://wpforms.com/pricing/)

So, if you’re trying to provide your website visitors with a quick approach to estimate their IIFYM (If It Fits Your Macros), follow the steps in this guide!

## How To Create a Macronutrients Calculator in WordPress

Creating a macronutrients calculator for your health & fitness website can bring a lot of traffic, as it can help visitors create a diet plan that best suits their needs.

Whether the goal is to help people lose weight, gain weight, or maintain their current weight, learning how many grams of fats, proteins, and carbohydrates make up most of their calories is incredibly helpful.

Luckily for you, adding your own macro calculator in WordPress is incredibly simple with WPForms. Follow the steps below to get started!

### Step 1: Get the WPForms Pro License

WPForms is the best form builder plugin for WordPress that allows you to create all types of [calculator forms](https://wpforms.com/templates/category/calculator-forms/). It comes with [2,100+ WordPress form templates](https://wpforms.com/templates/) for every industry, including health and fitness websites.

If you want to create a macro calculator by following the steps in this guide, you’ll require the [WPForms Pro license](https://wpforms.com/wpforms-lite-vs-pro/), which also offers other premium features like conditional logic, form reports, advanced integrations, and more.

[![the wpforms homepage](https://wpforms.com/wp-content/uploads/2024/01/WPForms-1400-Templates.png "The WPForms Homepage")](https://wpforms.com/)

Once you’ve purchased the Pro license, simply install and activate the WPForms plugin on your site. For more details, check out this step-by-step guide for instructions on [how to install a plugin in WordPress](http://www.wpbeginner.com/beginners-guide/step-by-step-guide-to-install-a-wordpress-plugin-for-beginners/).

### Step 2: Activate the Calculations Addon

The next step is to install the [Calculations Addon](https://wpforms.com/features/calculations-addon/), which will allow you to create customizable formulas for counting macros, such as:

- Proteins
- Carbohydrates
- Fats
- Daily calorie intake

To get started with installing the addon, head to your WordPress dashboard, and from the sidebar, navigate to **WPForms » Addons**.

![add new addon wpforms](https://wpforms.com/wp-content/uploads/2024/01/add-new-addon-wpforms.png "WPForms Addons")

From here, type “Calculations” into the Search Addons Field. Then, click on the **Install Addon** button, followed by the **Activate** button.

![activate calculations addon](https://wpforms.com/wp-content/uploads/2023/10/Activate-Calculations-Addon.png "Activate Calculations Addon")

Great job! We’ll now show you how to create your macro calculator from scratch with the required formulas.

### Step 3: Create Your Macro Calculator

It’s now time to build your macronutrients calculator. From your WordPress dashboard, go to **WPForms** and click on **Add New**.

![add new form](https://wpforms.com/wp-content/uploads/2023/12/add-new-form-updated.png "Add New Form")

In the next page, you will be required to give your form a name. Go ahead and type in whatever sounds good in the **Name Your Form** field.

![name your calculator form](https://wpforms.com/wp-content/uploads/2024/02/name-your-calculator-form.png "Name Your Calculator Form")

Great job! Now, scroll down a bit, and select **Calculator » Fitness** to view a list of suitable professionally-designed calculator templates.

![select fitness calculator category](https://wpforms.com/wp-content/uploads/2024/02/select-fitness-calculator-category.png "Select Fitness Calculator Category")

Here you’ll find several health and fitness-related calculators, including the ‘[If It Fits Your Macros Calculator Template](https://wpforms.com/templates/if-it-fits-your-macros-calculator-form-template/)‘ which is relevant to our use-case.

Simply hover your mouse over the template and click on the **Use Template** button to proceed with customizing the form to your needs.

[![use macros calculator form template](https://wpforms.com/wp-content/uploads/2024/02/use-macros-calculator-form-template.png "Use Macros Calculator Form Template")](https://wpforms.com/templates/if-it-fits-your-macros-calculator-form-template/)

Once you select your template, you’ll be redirected to the form builder screen. Here you can see currently available **Fields** on the left side of this screen.

![WPForms fields menu](https://wpforms.com/wp-content/uploads/2023/09/WPForms-fields-menu.png "WPForms Fields Menu")

On the right side, you’ll see a preview of your form that you can customize. Since we’re using a template, the fields will be added automatically.

![macros calculator form preview](https://wpforms.com/wp-content/uploads/2024/02/macros-calculator-form-preview.png "Macros Calculator Form Preview")

You’re almost there! With the template, you should be good to do, but let’s also see how you can customize your Macros Calculator further.

### Step 4: Customize the Macros Calculator Form

Most of the work is already done for you once the form template loads. You’ll find the following fields are already in the form:

- **Name** for record-keeping purposes.
- **Email** to send nutrition-related information.
- **Gender** for calculations on physiological needs.
- **Age** to determine metabolic rates that influence daily calorie intake.
- **System (Imperial/Metric)** to decide on the preferred measuring system.
- **Height** that can be entered in feet and inches or centimeters.
- **Weight** that can be entered in pounds or kilograms.
- **Activity Level** with choices like Sedentary, Light, Moderate, Very Active.
- **BMR Formula** to calculate the amount of calorie intake (2 options).
- **Goal** with choices such as Lose Weight, Maintain, or Gain Weight.
- **Calories Per Day** that is auto-calculated based on user-selections.
- **Carbohydrates** for assessing daily carbohydrate requirement.
- **Proteins** to estimate the protein required for a balanced diet.
- **Fats** to understand the fats required and complete the macro profile.

All fields come equipped with accurate formulas that help calculate the calories required per day through two different BMR methods:

- **Mifflin-St. Jeor —** Estimates the daily calorie needs of an individual, factoring in their weight, height, age, and sex and adjusting it based on their Total Daily Energy Expenditure (TDEE).
- **Harris-Benedict Revised —** Similar to the Mifflin-St. Jeor, this BMR also follows the same principle to calculate the macro ratio. The choice between the two depends on personal or professional preferences.

You can change the template in other ways to fit the needs of your business if you want to feel creative about how you use it.

For example, you can change the formulas or get rid of the “Submit” button. Here are the steps you need to take to make these changes.

#### Change the Formulas

From basic arithmetic operations to more complex formulas, the Calculations Addon can be used to create some amazing calculators.

Since we’re using a template, all the calculations will be added automatically, but you can change them or [add your own using this cheatsheet](https://wpforms.com/calculations-formula-cheatsheet/)!

You’ll need to add one of the supported fields that work with this to your form. We’ve marked the fields that work below:

- Single Line Text
- Paragraph Text
- Number
- Hidden
- Single Item

To change the calculation, click on any supported field and navigate to the **Field Options** tab inside the form builder.

![select field to change calculations](https://wpforms.com/wp-content/uploads/2024/02/select-field-to-change-calculations.png "Select Field To Change Calculations")

All you have to do now is click on the **Advanced** tab and change any calculations as they seem fit, under the **Formula** editor.

![change calculation](https://wpforms.com/wp-content/uploads/2024/02/change-calculation.png "Change Calculation")

If you want to ensure the syntax and formulas are correct, click on the **Validate Formula** link. If everything is fine, a green checkmark should show up.

![validate formula](https://wpforms.com/wp-content/uploads/2024/02/validate-formula.png "Validate Formula")

#### Remove Submit Button

You can also help users calculate their macronutrient intake with a stand-alone calculator, which doesn’t need a form submit action.

Just navigate to **WPForms » Tools** from your WordPress dashboard. Then, click on the **Code Snippets** tab.

![code snippets tab](https://wpforms.com/wp-content/uploads/2023/10/code-snippets-tab.png "Code Snippets Tab")

Now, type the name of the snippet you want to find (hide submit button) into the **Search Snippets** field and click the **Install Snippet** button.

![Install hide submit button snippet](https://wpforms.com/wp-content/uploads/2023/11/Install-hide-submit-button-snippet.png "Install Hide Submit Button Snippet")

After that, simply paste the `wpf-calc-form` CSS into your form builder’s **Submit Button CSS Class** to make the code work.

![add css class submit button](https://wpforms.com/wp-content/uploads/2023/11/add-css-class-submit-button.jpg "Add CSS Class Submit Button")

And that’s it! You can now publish the macros calculator on your website, which will help you drive more traffic and engagement.

### Step 5: Publish Your Macronutrients Calculator

Once you’ve customized your macros calculator to include all your desired features, don’t forget to press the **Save** button.

![Save the form](https://wpforms.com/wp-content/uploads/2023/04/Save-the-Form.png "Save Form")

After that, click on the **Embed** button. You can now choose to publish your form to an existing page or create a new page.

![Choose where you'd like to embed your form](https://wpforms.com/wp-content/uploads/2016/12/Embed-Button-Modal.png "Embed Form")

If needed, you can also use the [block editor to style your form](https://wpforms.com/how-to-style-wpforms-using-the-block-editor/) further before publishing it on your WordPress website.

Once everything seems good to go, simply click on the **Publish** button at the top right corner of the page!

![publish macronutrients calculator](https://wpforms.com/wp-content/uploads/2024/02/publish-macronutrients-calculator.png "Publish Macronutrients Calculator")

You’ve now successfully created a macronutrients form, which you can use to attract more leads for those concerned about high protein and low carb diets, muscle gain and bodybuilding, and the list goes on!

### FAQs about Macronutrient Calculators

Looking for answers to your questions? Check out some of the most frequently asked questions we receive about macro calculators!

#### How do I calculate my custom macros?

To figure out your personal macro needs, start by determining your daily calorie requirement. This is based on your activity level, goals (like fat loss or gaining weight), and basic body composition. Once you know your calorie target, divide these calories among carbs, proteins, and fats to create an appropriate dietary or meal plan.

#### What formulas do macro calculators use?

Macro calculators often use formulas like the Mifflin-St. Jeor Equation to estimate your basal metabolic rate (BMR), then adjust for your activity level to find your total daily energy expenditure (TDEE) to lose/build muscle, body fat, or body weight.

Your TDEE gives the number of calories needed to maintain your current weight. From there, calculators apply your goals (weight loss, weight gain, or maintain weight) and the desired macro split (40% carbs, 30% protein, 30% fats) for a flexible diet plan.

#### Can I customize a macro calculator?

You can create a tailored macro calculator using WPForms Pro and the Calculations Addon. This powerful combo lets you build a form where users input their details like weight, height, age, physical activity level, and goals.

The calculator then uses these inputs to compute and display personalized macro recommendations. It’s a fantastic tool for nutritionists, fitness coaches, or anyone looking to offer custom nutrition advice online.

### Next, Learn How to Create a Price Calculator for Your Website

Looking for a solution that lets you create order forms with automatic price, shipping, and tax calculations? Check out this guide to learn[ how to create a price calculator for your website using WPForms](https://wpforms.com/how-to-create-a-price-calculator-for-your-website/)!

[Create Your WordPress Form Now](https://wpforms.com/pricing/)

Ready to build your form? Get started today with the easiest WordPress form builder plugin. [WPForms Pro](https://wpforms.com/pricing) includes lots of free templates and offers a 14-day money-back guarantee.

If this article helped you out, please follow us on [Facebook](https://facebook.com/wpforms) and [Twitter](https://twitter.com/easywpforms) for more free WordPress tutorials and guides.

**Categories:** WordPress Tutorials

**Tags:** calculations addon, custom calculator, macro calculator, macronutrients, wpforms pro

---

