The most comprehensive open-source Bitcoin mining profitability calculator.
Plan, simulate, and optimize your Bitcoin mining operation — from a single ASIC to a full-scale farm with solar, cooling, and multi-year forecasting.
🌐 Live: bitcoinminingfarmcalculator.com
- 50+ real ASIC miners — Bitmain, MicroBT, Canaan, Goldshell, and Ebang with verified specs (hashrate, power, efficiency, price, degradation curves)
- Add/remove miners with per-model quantity controls
- Choose between rack-mount or container infrastructure
- Automatic parasitic load calculation (fans, networking, lighting)
- Auto-sized transformer selection based on total kVA demand
- Copper cable cost calculator (length, gauge, price/kg)
- Smart detection of high-amperage circuits (>20A @ 220V threshold)
- Internal wiring and electrical panel cost estimation
- Noise level calculator for regulatory compliance
- Air cooling — industrial exhaust fan sizing with airflow (m³/h), noise, and cost
- Dry cooler / hydro cooling — 26 dry cooler models with full specs (capacity, flow rate, pressure drop, deployment hours)
- Automatic cooler selection based on heat load
- Location-aware ambient temperature via interactive map (Leaflet)
- Ventilation calculations with real thermodynamic formulas
- Panel count, area, and installed kW calculations
- Configurable panel wattage, efficiency, and sun hours
- Effective solar coverage percentage of total farm power
- Cost estimation for solar installation
- Multi-year profitability projections (1–10 years)
- BTC price scenarios with Stock-to-Flow model integration
- Network difficulty and hashrate growth modeling
- Hardware degradation curves (year 1, 2, 3+ rates per miner)
- Mining pool payout scheme comparison (PPS, PPLNS, FPPS, PPS+)
- Interactive charts with Recharts (revenue, costs, cumulative profit, BTC accumulation)
- Live Bitcoin network stats (hashrate, difficulty, block height, mempool)
- Hashprice display (USD/TH/day)
- Total farm metrics: hashrate, power draw, daily/monthly revenue, electricity cost
- Profitability traffic light indicator
- CAPEX breakdown with donut chart
- Electricity cost calculator from monthly utility bill
- Import taxes and customs duties (configurable per country)
- Labor costs (installation, maintenance, management)
- Complete CAPEX vs OPEX breakdown
- Break-even timeline calculation
- Save farm configurations to Supabase (no account required)
- Shareable read-only links for collaboration
- Farm presets and quick-start templates
- Export to PDF
| Technology | Purpose |
|---|---|
| Next.js 15 | React framework (App Router) |
| TypeScript | Type safety |
| Tailwind CSS | Styling |
| Supabase | Database (Postgres) |
| Recharts | Charts and data visualization |
| React Flow | Flow diagrams |
| Leaflet | Interactive maps |
| Zustand | State management |
| Vercel | Deployment |
- Node.js 18+
- npm 9+
- A Supabase project (free tier works)
git clone https://github.com/marceloceccon/bitcoinmining.git
cd bitcoinmining
npm installCopy the example environment file:
cp .env.example .env.localFill in your Supabase credentials:
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-keynpm run devOpen http://localhost:3000.
Run the schema in your Supabase SQL editor:
# The schema file is at:
supabase/schema.sqlThis creates:
miners— ASIC database with 50+ pre-populated minersfarms— saved farm configurationsdry_coolers— 26 dry cooler models with full specificationsair_fans— industrial exhaust fan data
Enable RLS on the farms table and add these policies:
-- Allow anyone to read farms (for shared links)
ALTER TABLE farms ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Allow public read" ON farms
FOR SELECT USING (true);
CREATE POLICY "Allow public insert" ON farms
FOR INSERT WITH CHECK (true);The miners, dry_coolers, and air_fans tables need public SELECT access:
ALTER TABLE miners ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Allow public read" ON miners FOR SELECT USING (true);
ALTER TABLE dry_coolers ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Allow public read" ON dry_coolers FOR SELECT USING (true);
ALTER TABLE air_fans ENABLE ROW LEVEL SECURITY;
CREATE POLICY "Allow public read" ON air_fans FOR SELECT USING (true);Ensure the anon role has the necessary permissions:
GRANT SELECT ON miners TO anon;
GRANT SELECT ON dry_coolers TO anon;
GRANT SELECT ON air_fans TO anon;
GRANT SELECT, INSERT ON farms TO anon;| Variable | Description | Required |
|---|---|---|
NEXT_PUBLIC_SUPABASE_URL |
Your Supabase project URL | Yes |
NEXT_PUBLIC_SUPABASE_ANON_KEY |
Your Supabase anonymous/public key | Yes |
Note: The app includes fallback miner data and works partially without Supabase, but save/load functionality requires a configured database.
- Push your repo to GitHub
- Import the project in Vercel
- Add environment variables in Vercel dashboard
- Deploy — Vercel auto-detects Next.js
docker build -t mineforge .
docker run -p 3000:3000 \
-e NEXT_PUBLIC_SUPABASE_URL=your_url \
-e NEXT_PUBLIC_SUPABASE_ANON_KEY=your_key \
mineforgeThe multi-stage Dockerfile produces a minimal image (~180 MB) using Next.js standalone output. No dev dependencies or source maps in production.
├── app/ # Next.js App Router pages
│ ├── page.tsx # Main calculator page
│ ├── load/ # Shared farm loading route
│ └── layout.tsx # Root layout with metadata
├── components/ # React components
│ ├── FarmBuilder.tsx # Miner selection and quantities
│ ├── EnergyTab.tsx # Solar simulation
│ ├── ForecastCharts.tsx # Profitability projections
│ ├── TemperatureControl.tsx # Cooling system
│ ├── MetricsDashboard.tsx # Real-time metrics
│ └── ui/ # Reusable UI primitives
├── lib/ # Business logic
│ ├── calculations.ts # Core math (power, cooling, costs)
│ ├── forecasting.ts # BTC price & profitability models
│ ├── store.ts # Zustand state management
│ └── supabase.ts # Database client
├── types/ # TypeScript interfaces
├── supabase/ # Database schema
└── public/ # Static assets
Contributions are welcome! See CONTRIBUTING.md for guidelines.
MIT © 2025-2026 Marcelo Ceccon
