Universal Price Per Unit Calculator
Free to download on every platform. Comes pre-installed on BotFone, BotPad and BotFlip — with extra free apps included.
About this app
WHAT IT DOES
This script calculates and displays the price per unit on any e-commerce product page, helping you compare the true value of different products. When you view a product on Amazon, Walmart, Target, Best Buy, or any other shopping site, the script extracts the price and quantity information (like "12-pack," "500ml," "2.5 lbs," or "box of 24") and calculates the price per unit—per item, per ounce, per gram, per pound, per liter, or per square foot. The result is displayed prominently near the price, making it easy to compare value across different sizes and package options. If automatic detection fails, you can manually enter the quantity and unit. The script supports a wide range of unit indicators and works on both desktop and mobile views.
WHERE IT RUNS
The script runs on all websites (*://*/*), making it truly universal. It works on product pages from Amazon, Walmart, Target, Best Buy, eBay, and any other e-commerce site. It supports both desktop and mobile views.
HOW TO USE
After installation, the settings panel appears on the left side of the screen with the gear emoji (⚙️). Open the panel to configure the script:
- The "Enable price per unit calculation" toggle enables or disables the script.
- Choose the unit preference from the dropdown: "Auto (detect from page)," "Metric (kg, g, L, ml)," or "Imperial (lb, oz, sq ft)."
- If automatic detection fails, use the "Manual Entry" section to enter the quantity and unit (e.g., "12" and "pack").
- Click "Refresh calculation" to manually re-scan the page.
The price per unit appears below the product price on supported pages. The script updates dynamically as you navigate between products.
TECHNICAL SECTION — REAL MECHANISM
The script detects product pages by scanning for common price elements using selectors like .a-price .a-offscreen, #price_inside_buybox, .product-price, .price-now, .sale-price, [itemprop="price"], and .a-color-price. The price is extracted using a regex that matches currency amounts. Quantity and unit information is extracted by scanning the product title, description, and specifications for patterns like (\d+)\s*[-–]?\s*(pack|pk|packs), (\d+)\s*(?:-)?\s*(box|case), (\d+)\s*(?:per\s*)?(pound|lbs?|lb), (\d+\.?\d*)\s*(ml|mL|L|l|oz|fl oz|g|kg|lb), and many other unit patterns. The script calculates the price per unit as totalPrice / quantity. The result is inserted as a styled span element near the price element using DOM insertion (parentNode.insertBefore). A MutationObserver watches for DOM changes and re-scans when the user navigates or selects product variations. Manual input fields allow users to override automatic detection.
THE PANEL
The settings panel is built with BotGentz's BGPanel component. It is draggable via its header, allowing you to reposition it anywhere on the screen. The panel snaps to the left edge by default but can be moved freely. Click the gear emoji to collapse the panel into a small bubble, and click the bubble to expand it again. The panel remembers its position per page session. Press the Escape key to quickly close or minimize the panel. The panel includes a status flash bar that provides visual feedback when settings are changed or actions are performed. All settings save automatically via GM_setValue.
PLEASE NOTE
This script requires the free BotGentz browser extension to run. It does not function as a standalone Chrome extension and does not use chrome.* APIs. The script works on most e-commerce sites, but some sites may use non-standard HTML structures that prevent automatic detection. In those cases, you can use the manual entry feature. The unit detection relies on text patterns—if the product description does not clearly state the quantity or unit, the script may not detect it. The script stores only your preferences via GM_setValue. No data is sent externally—all data is stored locally in your browser. The script never reads or writes password fields, hidden inputs, or file inputs. All DOM operations use safe methods (style properties, textContent, appendChild) and never use innerHTML.