A professional-grade technical diving gas calculator — open source, offline-capable, and built by a technical diver.
DiveBlendr is a Progressive Web App for planning technical dives. It handles gas mixing, MOD/END calculations, gas density warnings, and CNS% estimation — all running locally in your browser with no server required. Install it on your phone and use it offline at the dive site.
Built by a JJ-CCR / TDI MOD 2 technical diver who wanted transparent, community-verifiable tools. Every calculation is open source — if the math is wrong, you can fix it.
- MOD (Maximum Operating Depth) — for any gas mix at any PPO₂ limit
- Trimix blending — partial pressure fills for O₂/He/N₂ mixes
- Nitrox blending — optimal oxygen percentage for target depth
- END (Equivalent Narcotic Depth) — N₂-only (IANTD/GUE) or N₂+O₂ (NOAA/DCIEM) models
- Gas density analysis — temperature-corrected, with Mitchell & Vrijdag warning thresholds
- CNS% estimate — single-dive oxygen toxicity using NOAA exposure table
- Open Circuit Nitrox
- Open Circuit Trimix
- CCR (Closed Circuit Rebreather) Nitrox diluent
- CCR Trimix diluent
- SAC Calculator — Surface Air Consumption rate
- Bottom Time Calculator — gas consumption and dive time planning
- Tank Pressure Testing — pressure testing and safety factors
- Marine Conditions — tides, current, and visibility for dive sites
- Real gas physics via Van der Waals equations (not ideal gas approximations)
- Conservative rounding: O₂ rounds down, He rounds up, N₂ rounds down
- User-configurable PPO₂ and gas density limits
- Severity-based visual warnings (blue / yellow / red)
- Installable on iOS, Android, macOS, and Windows
- Fully offline after first load — all calculations work with no internet
No account, no signup, no data sent to any server.
git clone https://github.com/SerRodneyRich/Diveblendr.git
cd Diveblendr
npm install
cp .env.example .env.local # optional — see note below
npm run dev
# Open http://localhost:3000All gas calculations work without any API keys. The .env.local keys are
only needed for analytics, contact form, and PWA push features. For calculation
work, skip .env.local entirely.
npm run build # production static export
npm run lint # ESLint checksClean build (when stale cache causes issues):
rm -rf .next && npm run build| Layer | Technology |
|---|---|
| Framework | Next.js 15 (App Router, output: export) |
| Language | TypeScript — strict mode, no any in calc code |
| Styling | Tailwind CSS v4 |
| Runtime | React 19 |
| PWA | @ducanh2912/next-pwa |
| Testing | Playwright (E2E) |
| Deployment | Vercel (static CDN) |
The app is a fully static export — no server-side rendering, no API routes at runtime. It can be hosted on any CDN or served from a file system.
These rules are non-negotiable and must be preserved in all contributions:
| Value | Direction | Reason |
|---|---|---|
| O₂ fraction | Round down | Prevents false safety margin at depth |
| He fraction | Round up | Ensures minimum narcotic protection |
| N₂ fraction | Round down | Conservative by design |
Implemented in src/utils/safeRounding.ts.
| Mode | Default | Source |
|---|---|---|
| OC working | 1.4 ATA | NOAA / TDI |
| OC deco | 1.6 ATA | NOAA / TDI |
| CCR setpoint | 1.3 ATA | TDI MOD 2 |
- Warning: 5.7 g/L — Mitchell & Vrijdag (2016)
- Critical: 6.2 g/L — DAN research
All gas mixing calculations use Van der Waals real gas corrections. Ideal gas approximations are not acceptable for blending at pressure.
src/
├── app/ # Next.js App Router pages
│ ├── calculator/ # Main gas calculator
│ ├── marine-conditions/ # Dive site conditions
│ ├── bottom-time/ # Gas planning
│ ├── photo-correction/ # Underwater photo tools
│ └── tank-test/ # Pressure testing
├── components/ # React components (45+)
├── contexts/ # localStorage-backed React Contexts
│ ├── PreferencesContext # Dive mode, safety limits, custom tanks
│ ├── UnitsContext # Metric / imperial
│ ├── AccessibilityContext
│ └── FavoritesContext # Saved locations
└── utils/ # Core calculation libraries
├── realGasBlending_v3 # Gas mixing engine (Van der Waals)
├── endModCalculations # MOD, END, gas density, CNS%
├── safeRounding # Conservative rounding
└── vanDeWaalsPhysics # Real gas physics
See CONTRIBUTING.md for the full guide.
The short version:
- Report a bug — open an Issue with the exact gas mix, depth, and what you expected vs. what DiveBlendr calculated
- Fix something — fork, branch, change, PR. Calculation changes must cite a diving standard (NOAA, TDI, IANTD, PADI, GUE)
- Propose a feature — use Discussions before writing code
- MOD 3+ trimix (beyond 100 m) — the author's cert level is MOD 2
- Decompression algorithm integration (VPM-B, Bühlmann)
- E2E test coverage (Playwright is set up, tests are sparse)
- Metric/imperial edge cases
DiveBlendr is a planning and educational tool. All calculations must be verified with certified dive planning software and your instructor before use in actual diving operations. Technical diving requires proper training and certification. The authors accept no responsibility for decisions made based on these calculations.
Gas calculation PRs are reviewed against NOAA, TDI, IANTD, and PADI standards before merging.
DiveBlendr was built by hand by a working technical diver. Claude Code (Anthropic's AI coding assistant) has been used to augment development, audit calculations, review pull requests, and maintain code quality. Claude now actively assists with issues, discussions, and PRs — providing a second set of eyes for accountability on safety-critical calculation changes.
This means when you open an issue or PR, responses and reviews may come from the maintainer working alongside Claude. All merges are approved by the human maintainer.
GNU General Public License v3.0 — free to use, study, and fork. Any derivative work must also be open source under the same license. Commercial exploitation without releasing source is not permitted.
Built by a technical diver, for technical divers. The math is open — if you see something wrong, fix it.