Calculate 3D print costs and profits with real measurements – no guesswork!
A powerful web app for 3D printing enthusiasts and businesses. Built with vanilla HTML, CSS, and JavaScript – runs both locally in your browser and on a server for multi-device synchronization.
🌐 Try it online: https://atomique13.github.io/3d-print-cost-analyzer/
- No server required: Open
index.htmldirectly in your browser - Browser Storage: Data persists in browser localStorage
- Single Device: Perfect for quick calculations and testing
- Instant: Zero setup, immediate use
- Multi-Device: Access from any device on your network
- Server Storage: Data saved to
data/data.jsonon the server - Authentication: Simple login system to protect your pricing data
- Docker Ready: Pre-configured containerization for easy deployment
- Live Spreadsheet Interface: Inline editing with instant calculations
- Real-Time Updates: Costs update as you type
- Material Dropdown Selector: Quick-select from 7 preset materials or enter custom materials
- Smart Material Detection: Type a preset name in custom field to auto-switch to dropdown
- Material Density Lookup: Preset densities for common filaments (PLA, ABS, PETG, TPU, PA, ASA, PC)
- Custom Density Override: Adjust material density per job with visual indicators
- Color-Coded Materials: Green for preset materials, orange for custom materials
- Customizable Currency: Set your own currency symbol (defaults to 🦁)
- Automatic Backups: Server mode creates automatic backups every 6 hours (keeps last 5)
- Import Protection: Creates backup before importing JSON data (keeps last 10)
- Smart Backup: Skips backup if imported data is identical to existing data
- Backup Status Display: Shows time since last backup in the UI
- JSON Export/Import: Backup and share your pricing data
- Mobile-Friendly: Responsive design for phone and PC
- Privacy-First: Local mode keeps all data on your device; server mode uses secure session storage
- Secure by Default: Blocks default credentials in production, auto-generates session secrets
- Time parsing and conversion
- Filament length (using material-specific densities)
- Material and electricity costs
- Profit estimation with smart formula
Open https://atomique13.github.io/3d-print-cost-analyzer/ to use the app directly in your browser with localStorage persistence.
- Download or clone the repo
- Open
index.htmlin your browser - Set printer power and electricity price
- Add jobs and fill in details
- View calculated costs and profits
- Data is saved in your browser's localStorage
For Production (Secure):
- Edit
docker-compose.ymlto set custom credentials:AUTH_USERNAME: your_username AUTH_PASSWORD: your_secure_password
- Run:
docker-compose up -d - Open http://localhost:8080 in your browser
- Login with your custom credentials
- Data persists in
data/data.jsonon your host machine
For Local Testing:
- Run:
.\test-local.ps1(Windows) ordocker-compose -f docker-compose.local.yml up - Uses default admin/admin credentials (allowed via ALLOW_DEFAULT_CREDENTIALS flag)
- Open http://localhost:8080 in your browser
Security Features:
- Auto-generates SESSION_SECRET if not provided
- Blocks default admin/admin credentials in production
- Rejects empty passwords
- Shows warning banners when using default credentials
- Session-based authentication protects all endpoints
- Pull:
docker pull ghcr.io/atomique13/3d-print-cost-analyzer:latest - Run:
docker run -p 8080:80 -v ./data:/app/data ghcr.io/atomique13/3d-print-cost-analyzer:latest - Open http://localhost:8080 in your browser
Or use Docker Compose (recommended):
Create a docker-compose.yml file:
services:
3d-print-analyzer:
image: ghcr.io/atomique13/3d-print-cost-analyzer:latest
ports:
- "8080:80"
volumes:
- ./data:/app/data
environment:
- AUTH_USERNAME: your_username
- AUTH_PASSWORD: your_secure_passwordThen run:
docker-compose up -dData Persistence: In server mode, data is stored in data/data.json on your host. Mount the data directory with -v ./data:/app/data to persist data across container restarts and share across devices.
Automatic Backups: Server mode includes two backup systems:
- Auto Backups: Created every 6 hours automatically (keeps last 5)
- Format:
data.json.auto-backup-YYYY-MM-DDTHH-MM
- Format:
- Import Backups: Created before importing JSON data (keeps last 10)
- Format:
data.json.import-backup-YYYY-MM-DDTHH-MM - Skips backup if imported data is identical to existing data
- Format:
- All backups are stored in the mounted
data/folder - Backup status shown in UI with time since last backup
- Printer Power (W): Your 3D printer's wattage
- Electricity Price: Cost per kWh in your area
- Currency Symbol: Customize your currency (max 10 characters, defaults to 🦁)
- Name: Job identifier
- Material: Select from dropdown (PLA, ABS, PETG, TPU, PA, ASA, PC) or choose "Custom..." to enter your own
- Price/kg: Filament cost
- Weight (g): Actual printed weight
- Print Time: Hours:Minutes (e.g., 2:30)
- Dropdown: Quick-select from 7 preset materials
- Custom Entry: Select "Custom..." to type any material name
- Smart Detection: Type "PLA" in custom field → auto-switches to dropdown
- Color Coding:
- 🟢 Green: Preset material with known density
- 🟠 Orange: Custom material using default or custom density
- Preset Densities: Automatic calculation for 7 common materials
- Custom Override: Click ⚙️ gear button next to filament length to set custom density
- Color Indicators:
- 🟢 Green: Using preset density from material library
- 🟠 Orange: Custom density override applied
- 🔵 Blue: Unknown material using PLA default (1.24 g/cm³)
- Add Row: New job entry
- Duplicate: Copy a row
- Delete: Remove row (with confirmation)
- Clear: Reset row inputs (with confirmation)
- Export JSON: Download data
- Import JSON: Load saved data
- PLA: 1.24
- ABS: 1.04
- PETG: 1.27
- TPU: 1.21
- PA (Nylon): 1.14
- ASA: 1.07
- PC: 1.20
- Unknown: 1.24 (PLA default)