Calculators · Gutenberg

Profit Margin Calculator block for WordPress

Calculate profit margin, markup, selling price and gross profit for any product or service.

Get Blockenberg

Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.

Get Blockenberg

What it actually does

Calculate profit margin, markup, selling price and gross profit for any product or service.

Inspector panels on this block: Calculator Settings, Display Options, Sizing. Those titles come from index.js, not from a shared template.

Behavior controls: “Default Mode” options: Margin % (Cost → Price), Markup % (Cost → Price), Revenue (Revenue + Cost).

Where to find it

Gutenberg inserter → Calculators → search “Profit Margin Calculator” (block name `blockenberg/margin-calculator` in block.json). Style it in the sidebar after insert.

How to use Profit Margin Calculator block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Profit Margin Calculator”, insert it. Category: Calculators.
  3. Configure inspector controls that exist on this block. Open Calculator Settings. Set “Default Mode”, “Currency Symbol”, “Default Cost ($)”, “Default Margin / Markup (%)”.
  4. Check the published page. The view script reads HTML data attributes: data-key, data-mode, data-opts. The block editor preview may not run the same view script.

Inspector controls from this block’s code

ControlWhat the code does
Default ModeSelect control; the chosen value is saved on the block. Options: Margin % (Cost → Price); Markup % (Cost → Price); Revenue (Revenue + Cost). block.json default: margin. Saved as `defaultMode`.
Currency SymbolText field in the inspector. block.json default: $. Saved as `currency`.
Default Cost ($)Text field in the inspector. block.json default: 50. Saved as `defaultCost`.
Default Margin / Markup (%)Text field in the inspector. block.json default: 40. Saved as `defaultMargin`.
Default Revenue ($)Text field in the inspector. block.json default: 100. Saved as `defaultRevenue`.
Show Breakdown BarOn/off toggle in the inspector. On by default. Saved as `showBar`.
Show Markup %On/off toggle in the inspector. On by default. Saved as `showMarkup`.
Show Margin Health ScaleOn/off toggle in the inspector. On by default. Saved as `showMarginScale`.
Max Width (px)Numeric range control in the inspector. Range 400–1200. block.json default: 680. Saved as `contentMaxWidth`.

What the front-end script actually does

When this is the right block

Notes from the implementation

viewScript: this folder’s frontend.js is enqueued on the front end for this block.

FAQ

How do I add the Profit Margin Calculator block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Profit Margin Calculator”. It sits under Calculators. After insert, open Calculator Settings and set “Default Mode”, “Currency Symbol”, “Default Cost ($)”, “Default Margin / Markup (%)”.

Does Profit Margin Calculator need a server or extra plugin?

No. After Blockenberg is active, the view script runs in the browser with the values you saved on the block.

Is the Profit Margin Calculator Gutenberg block free?

Yes. Profit Margin Calculator ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.

Can I style Profit Margin Calculator to match my theme?

Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Calculator Settings, Display Options, Sizing).

Related calculators blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Profit Margin Calculator from the Gutenberg inserter.

Get Blockenberg