A user-friendly weight converter with a graphical interface that supports conversion between 9 different weight units including metric and imperial systems.
- Convert between 9 weight units
- Real-time conversion as you type
- Swap units with one click
- Clear and intuitive interface
- High precision results (6 decimal places)
- Input validation
- Modern, colorful design
- Language: Pure Python
- Libraries:
tkinter(standard library) - Complexity: Beginner
No external dependencies required!
python main.py- Milligrams (mg) - 1/1000 of a gram
- Grams (g) - Base metric unit
- Kilograms (kg) - 1000 grams
- Metric Tons (t) - 1000 kilograms
- Ounces (oz) - 1/16 of a pound
- Pounds (lb) - Standard US/UK weight
- Stones (st) - 14 pounds (UK)
- US Tons - 2000 pounds
- UK Tons - 2240 pounds
- Enter Value: Type the weight value you want to convert
- Select From Unit: Choose the source unit from dropdown
- Select To Unit: Choose the target unit from dropdown
- View Result: Conversion happens automatically!
- 🔄 Convert: Manual conversion trigger
- ⇄ Swap: Swap from/to units instantly
- 🗑️ Clear: Clear all fields
1 kg = 1000 g
1 lb = 16 oz
1 kg ≈ 2.20462 lb
1 stone = 14 lb
1 metric ton = 1000 kg
- Converts automatically as you type
- No need to click convert button
- Instant feedback
- Quickly reverse conversion direction
- Maintains entered value
- One-click operation
- Results shown to 6 decimal places
- Accurate conversion factors
- Suitable for scientific use
- Tkinter GUI development
- Combobox (dropdown) widgets
- Event binding
- Unit conversion logic
- Dictionary data structures
- Input validation
- State management
All conversions use grams as the base unit:
# Step 1: Convert input to grams
grams = input_value * conversion_factor_from
# Step 2: Convert grams to output unit
output_value = grams / conversion_factor_to| From | To | Multiply by |
|---|---|---|
| kg | lb | 2.20462 |
| lb | kg | 0.453592 |
| oz | g | 28.3495 |
| g | oz | 0.035274 |
| stone | kg | 6.35029 |
- Add more units (carats, grains, etc.)
- Conversion history
- Favorite conversions
- Copy result to clipboard
- Keyboard shortcuts
- Dark mode theme
- Export conversion table
- Scientific notation support
- Use Tab key to navigate between fields
- Decimal values are supported
- Very large/small numbers handled accurately
- Swap button useful for reverse calculations
Open source for educational purposes.