A Python GUI application for calculation of stock and working dilutions. This tool helps researchers quickly calculate the exact amounts needed to prepare stock solutions from powder and dilute stock solutions to working concentrations.
- ✅ Stock Solution Calculator: Calculate mass of powder needed to prepare stock solutions
- ✅ Working Solution Calculator: Dilute stock solutions to working concentrations
- ✅ Calculation History: Automatically saves all calculations with timestamps
- ✅ Unit Conversions: Support for M, mM, µM, nM (concentration) and L, mL, µL (volume)
- ✅ Solvent Tracking: Record which solvent was used for each preparation
- ✅ User-Friendly GUI: Clean tkinter interface with step-by-step instructions
- ✅ Enhanced history viewer: With selection and filtering
- Serial dilution calculator
- Custom unit preferences
- PDF export with formatted protocols
- PubChem API integration for automatic molecular weight lookup
- Drug identifier support (CAS numbers, catalog numbers, RRID)
- Python: 3.11+
- OS: Windows 11 (tested), likely compatible with macOS/Linux but not yet verified
- Dependencies: Only Python standard library (tkinter)
- Download the latest
.exefile from the Releases page - Double-click to run - no installation needed!
- Note: macOS/Linux users should use Option 2 (run from source)
# Clone the repository
git clone https://github.com/steffiAI/drug-dosage-calculator.git
cd drug-dosage-calculator
# Create virtual environment (recommended)
python -m venv venv
source venv/Scripts/activate # On Windows (Git Bash)
# or
source venv/bin/activate # On macOS/Linux
# Run the application
python main.pyUse this when you need to prepare a stock solution from powder:
- Click "Stock Solution Calculator"
- Enter:
- Drug name
- Molecular weight (g/mol)
- Desired concentration (with unit)
- Desired volume (with unit)
- Solvent type
- Click "Calculate"
- Follow the step-by-step protocol displayed
Example: Prepare 10 mM Staurosporine stock
- Drug: Staurosporine
- MW: 466.54 g/mol
- Target: 10 mM in 1 mL DMSO
- Result: Weigh 4.6654 mg
Use this to dilute stock solutions to working concentrations:
- Click "Working Solution Calculator"
- Enter:
- Drug name
- Stock concentration (with unit)
- Target concentration (with unit - must be lower than stock concentration)
- Desired volume (with unit)
- Solvent type
- Click "Calculate"
- Follow the dilution protocol displayed
Example: Dilute 10 mM stock to 20 µM working solution
- Stock: 10 mM
- Target: 20 µM in 500 µL media
- Result: Add 1 µL stock to 499 µL media (500x dilution)
- Click "View Calculation History" from the main menu
- See all past calculations with timestamps
- Useful for record-keeping and reproducing preparations
drug-dosage-calculator/
├── main.py # Main GUI application
├── src/
│ ├── calculators.py # Core calculation functions
│ └── data_storage.py # History management
├── data/
│ └── calculation_history.json # Saved calculations (auto-generated)
├── README.md
├── LICENSE
└── requirements.txt
To create a standalone .exe file:
# Install PyInstaller
pip install pyinstaller
# Create executable
pyinstaller --onefile --windowed --name "DrugCalculator" main.py
# Find the executable in dist/Contributions are welcome! This project is maintained by a researcher to help other researchers streamline their lab workflows.
Areas for contribution:
- Additional calculator types
- Enhanced UI/UX
- Bug fixes
- Documentation improvements
MIT License - See LICENSE file for details
If you use this tool in your research, please cite:
Strasser, S. (2025). Drug Concentration Calculator - Lab Edition.
GitHub repository: https://github.com/steffiAI/drug-dosage-calculator
- Author: Stefanie Strasser
- GitHub: @steffiAI
- Issues: Report bugs or request features
Built with the goal of making lab work more efficient and reducing calculation errors in drug preparation.
Note: This tool is for laboratory research use only. Always verify calculations independently and follow your institution's safety protocols.