Interactive web calculators for Bitcoin mining energy economics.
A collection of calculators that help users evaluate the economics of Bitcoin mining for space heating and solar energy monetization. Compare mining heating costs against traditional fuels and analyze solar mining vs net metering.
For usage documentation, equations, and guides, see docs.exergyheat.com.
Evaluate the economics of using Bitcoin mining hardware for space heating.
- Compare against natural gas, propane, heating oil, wood pellets, electric resistance, and heat pumps
- Calculate COPe (economic coefficient of performance)
- Multi-country support (US states and Canadian provinces)
- Interactive heat maps for regional visualization
Compare monetizing excess solar energy via Bitcoin mining vs traditional net metering.
- Solar production estimates via NREL PVWatts API
- Three input modes: Estimate from ZIP, Known Production, or Excess Only
- Net metering comparison with configurable rates
- Monthly revenue breakdown charts
- PDF report generation
- Real-time Bitcoin Data — Live BTC price from CoinGecko, network hashrate and transaction fees from Mempool.space
- Three-Knob Override System — Model any scenario by adjusting BTC price, hashvalue/hashrate, and transaction fee %
- Transaction Fee Modeling — Fee % slider (0-99%) to explore different fee environments
- Solar Production Estimates — NREL PVWatts integration for location-specific solar data
- Miner Presets — Quick-select popular mining heaters (Heatbit, Avalon, Bitaxe, etc.)
- Custom Miner Input — Enter your own power consumption and hashrate
- Bill Calculators — Derive rates from utility bills
- Dark Mode — Light and dark themes
- Mobile Responsive — Works on any device
- Node.js 18+
- npm (comes with Node.js)
# Clone the repository
git clone https://github.com/exergyheat/webapp-calculators.git
cd webapp-calculators
# Install dependencies
npm install| Variable | Required | Description |
|---|---|---|
VITE_NREL_API_KEY |
For solar calculator | NREL API key for PVWatts solar estimates. Get one free at developer.nrel.gov |
Create a .env file in the project root:
VITE_NREL_API_KEY=your_api_key_hereThe solar calculator will use fallback estimates if no API key is configured.
# Start development server
npm run devThe app will be available at http://localhost:5173
| Command | Description |
|---|---|
npm run dev |
Start development server with HMR |
npm run build |
TypeScript check + production build |
npm run lint |
Run ESLint |
npm run preview |
Preview production build locally |
npm test |
Run unit tests with Vitest |
# Build for production
npm run build
# Preview production build locally
npm run previewThe build output will be in the dist/ folder.
src/
├── api/ # External API clients
│ ├── bitcoin.ts # CoinGecko (price), Mempool.space (hashrate, fees)
│ └── solar.ts # NREL PVWatts, Zippopotam geocoding
├── calculations/ # Core calculation logic
│ ├── hashrate.ts # COPe, hashvalue, arbitrage calculations
│ ├── solar.ts # Solar mining revenue, net metering comparison
│ └── index.ts # Barrel exports
├── components/ # Reusable UI components
│ ├── Layout.tsx # Page layout with header/footer
│ ├── InputField.tsx # Input component with validation
│ ├── SelectField.tsx # Dropdown selector
│ ├── ResultCard.tsx # Result display cards
│ ├── SmartTooltip.tsx # Viewport-aware tooltips
│ ├── StateHeatMap.tsx # Interactive regional heat map
│ ├── DualAxisChart.tsx # Monthly revenue & generation chart
│ └── ThemeToggle.tsx # Dark mode toggle
├── contexts/ # React Context providers
│ └── ThemeContext.tsx # Theme provider
├── data/ # Static data
│ └── fuelPrices.ts # Regional fuel prices & energy data
├── pages/ # Route pages
│ ├── Home.tsx # Landing page
│ ├── HashrateHeating.tsx # Hashrate heating calculator
│ └── SolarMonetization.tsx # Solar monetization calculator
├── pdf/ # PDF report generation
├── test/ # Unit tests (Vitest)
├── App.tsx # Route configuration
├── main.tsx # React entry point
└── index.css # Tailwind base styles
| Technology | Purpose |
|---|---|
| React 18 | UI framework |
| TypeScript | Type safety |
| Vite | Build tool & dev server |
| Tailwind CSS | Styling |
| React Router | Routing |
| Axios | HTTP client |
| Lucide React | Icons |
| Recharts | Charts |
| React Simple Maps | Interactive regional maps |
| Vitest | Unit testing |
All APIs are free (NREL requires a free API key):
| API | Data | Rate Limits |
|---|---|---|
| CoinGecko | Bitcoin price (USD) | ~50 req/min |
| Mempool.space | Network hashrate, difficulty, transaction fees (144-block average) | Generous |
| NREL PVWatts | Solar production estimates | Requires API key |
| Zippopotam | ZIP code geocoding | Free, no key |
Bitcoin network metrics (hashvalue, hashprice) are calculated from CoinGecko price and Mempool.space network data, including transaction fees.
Regional fuel pricing and efficiency data in src/data/fuelPrices.ts:
| Data | Source |
|---|---|
| US Electricity Rates | EIA State Electricity Profiles |
| US Natural Gas Prices | EIA Natural Gas Data |
| US Propane/Heating Oil | EIA Heating Oil & Propane |
| Canada Electricity | GlobalPetrolPrices |
| Canada Natural Gas | Canadian Gas Association |
| Canada Propane | Natural Resources Canada |
| Canada Heating Oil | Statistics Canada |
| Fuel BTU Content | EIA Energy Units |
| Equipment Efficiencies | Industry standard AFUE/COP ratings |
The project includes unit tests using Vitest:
# Run all tests
npm test
# Run tests in watch mode
npm test -- --watchTests cover:
- Hashrate heating calculations (COPe, fuel comparisons, BTU conversions)
- Solar mining calculations (kWh-to-BTC conversion, net metering comparison)
- Bitcoin network calculations (fee %, hashvalue, block subsidy, three-knob override logic)
- PDF report generation
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Live Calculator: calc.exergyheat.com
- Documentation: docs.exergyheat.com — Equations, guides, calculation details
- Community: support.exergyheat.com — Questions, feature requests, support
- Website: exergyheat.com
- Issues: GitHub Issues