An Intelligent, Educational Unit Conversion Tool with Real-World Context
Unit Converter Pro is a completely redesigned unit conversion application that goes beyond simple conversions. It provides educational insights, real-world comparisons, and beautiful visualizations to make unit conversion more meaningful and engaging. The application offers multiple interfaces including a modern web app, desktop GUIs, and a CLI, catering to various user preferences and use cases.
Unlike typical unit converters, this application:
- Provides Context: See how your conversions relate to real-world objects (e.g., "100 meters is about the length of a football field")
- Teaches History: Learn the fascinating origins of different units
- Visualizes Data: Interactive charts show the relationship between units
- Remembers Your Work: Full conversion history with favorites
- Works Offline: Progressive Web App with service worker caching
- Respects Your Preferences: Beautiful dark mode, keyboard shortcuts, and customizable interface
- 9 Unit Categories: Length, Weight, Temperature, Volume, Area, Speed, Time, Digital Storage, and Currency
- 80+ Units: Comprehensive coverage of metric, imperial, and other unit systems
- Real-Time Currency: Live exchange rates for 36 major world currencies
- Instant Conversion: Real-time conversion as you type
- Quick Conversions: One-click access to common unit conversions
- Batch Operations: Convert to multiple units simultaneously
- Modern UI: Completely redesigned with Tailwind CSS 3.x
- Smooth Animations: Delightful micro-interactions and transitions
- Dark Mode: Eye-friendly dark theme with system preference detection
- Responsive Design: Works perfectly on desktop, tablet, and mobile
- Keyboard Shortcuts: Power user features for efficiency
- Copy to Clipboard: One-click result copying
- Real-World Comparisons: Understand measurements through everyday examples
- Historical Context: Learn the origins and evolution of units
- Visual Comparisons: Interactive charts powered by Chart.js
- Conversion History: Track and learn from past conversions
- Favorites System: Save frequently used conversions for quick access
- Progressive Web App: Install as a native app on any device
- Offline Support: Works without internet (except currency conversions)
- API Architecture: RESTful API ready for Vercel deployment
- Modular Design: Clean separation of concerns
- Extensible: Easy to add new units and categories
- Metric: Millimeter (mm), Centimeter (cm), Meter (m), Kilometer (km)
- Imperial: Inch (in), Foot (ft), Yard (yd), Mile (mi)
- Metric: Milligram (mg), Gram (g), Kilogram (kg), Metric Ton (ton)
- Imperial: Ounce (oz), Pound (lb), Stone (stone)
- Celsius (°C), Fahrenheit (°F), Kelvin (K)
- Metric: Milliliter (ml), Liter (l)
- US Units: Gallon (gal), Quart (qt), Pint (pt), Cup (cup), Fluid Ounce (fl_oz)
- Cooking: Tablespoon (tbsp), Teaspoon (tsp)
- Metric: Square Millimeter (mm²), Square Centimeter (cm²), Square Meter (m²), Square Kilometer (km²)
- Imperial: Square Inch (in²), Square Foot (ft²), Square Yard (yd²)
- Land: Acre, Hectare
- Meters per Second (m/s), Kilometers per Hour (km/h)
- Miles per Hour (mph), Knot, Mach
- Millisecond (ms), Second (s), Minute (min), Hour (hr)
- Day, Week, Month, Year
- Bit, Byte, Kilobyte (KB), Megabyte (MB)
- Gigabyte (GB), Terabyte (TB), Petabyte (PB)
- 36 major world currencies with real-time exchange rates
- Cached rates for better performance
- Python 3.8+
- Node.js 14+ (for building Tailwind CSS)
- pip (Python package manager)
- npm (Node package manager)
- Clone the repository:
git clone https://github.com/yourusername/unit-converter.git
cd unit-converter
- Install dependencies:
# Python dependencies
pip install -r requirements.txt
# Node.js dependencies
npm install
- Build CSS:
npm run build:css
- Run the application:
# Development mode (with hot reload)
npm run dev
# Or production mode
python app.py
- Open in browser:
Navigate to
http://localhost:5000
The web application provides the full feature set with a modern, responsive interface:
- Select a category (e.g., Length, Weight, Currency)
- Enter a value in the "From" field
- Select source and target units
- See instant results with:
- Converted value
- Real-world comparisons
- Historical context
- Visual chart
- Quick conversions to other common units
python gui.py
Simple, lightweight desktop interface.
python gui_qt.py
More advanced desktop interface with additional features.
Perfect for quick conversions:
python cli.py <value> <from_unit> <to_unit>
# Examples:
python cli.py 100 m ft # Convert 100 meters to feet
python cli.py 72 fahrenheit celsius # Convert temperature
python cli.py 50 USD EUR # Convert currency
Ctrl/Cmd + S
: Swap unitsCtrl/Cmd + C
: Copy result to clipboardCtrl/Cmd + H
: Toggle conversion historyCtrl/Cmd + D
: Toggle dark modeCtrl/Cmd + B
: Show batch conversion (all units)Ctrl/Cmd + Shift + S
: Share conversion
This application is optimized for deployment on Vercel with serverless functions.
- Push your code to GitHub
- Go to Vercel Dashboard
- Click "New Project"
- Import your GitHub repository
- Vercel will auto-detect the configuration
- Click "Deploy"
# Install Vercel CLI
npm i -g vercel
# Deploy
vercel
# Follow the prompts
Your app will be available at https://your-project-name.vercel.app
/
├── api/ # Serverless functions
│ ├── categories.py # GET /api/categories
│ ├── units.py # GET /api/units
│ ├── convert.py # POST /api/convert
│ └── quick-conversions.py
├── static/ # Static assets
│ ├── css/ # Compiled Tailwind CSS
│ ├── manifest.json # PWA manifest
│ └── service-worker.js
├── templates/ # Flask templates (local dev)
├── index.html # Main app (Vercel)
├── converter.py # Core conversion logic
├── app.py # Flask app (local dev)
└── vercel.json # Vercel configuration
GET /api/categories
Returns all available conversion categories.
GET /api/units?category={category}
Returns units for a specific category.
POST /api/convert
Content-Type: application/x-www-form-urlencoded
value=100&from_unit=m&to_unit=ft
Performs unit conversion with educational context.
GET /api/quick-conversions?value={value}&unit={unit}
Returns common conversions for the given value and unit.
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the GNU General Public License v3.0 (GPL-3.0). See the LICENSE file for details.
- Real-time currency data: forex-python
- UI Framework: Tailwind CSS
- Interactivity: Alpine.js
- Visualizations: Chart.js
- Icons: Native emoji sets
- Deployment: Vercel
- Add more unit categories (Energy, Pressure, etc.)
- Implement unit conversion formulas visualization
- Add conversion precision settings
- Create mobile apps (React Native)
- Add API rate limiting
- Implement user accounts for cloud sync
- Add more languages
- Create browser extension
Made with ❤️ by developers who believe unit conversion should be more than just numbers.