Hex Calculator
Number Base Converter
RGB Color Converter
Show the math
What Your Result Means
- Number Base Conversions: All four fields show the same value in different number systems. Type into any field and the others update instantly. Hexadecimal uses A–F for values 10–15.
- Color Preview: When you enter a 6-digit hex color code (like #FF5733), the swatch shows the actual color and the RGB field shows the red, green, and blue components as 0–255 values.
How This Calculator Works
You type a number in any base and the tool parses it using standard positional notation, converts to a decimal integer internally, then re-expresses it in hex, binary, and octal. The color converter splits a 6-character hex string into three 2-character pairs, parses each as base-16 to get red, green, and blue values between 0 and 255.
Quick Questions
Why is hexadecimal so common in computing?
Each hex digit maps exactly to 4 binary bits, making it a compact shorthand. One byte (8 bits) is always two hex digits. This makes hex far more readable than long binary strings for tasks like examining memory or defining colors.
How do hex color codes work?
A hex color like #FF5733 is three pairs: FF (red = 255), 57 (green = 87), 33 (blue = 51). Each pair ranges from 00 (none) to FF (maximum intensity), giving over 16 million possible colors.
What is the difference between this and the Binary Calculator?
Both convert between number bases. This tool adds an RGB color converter and starts from hex, while the Binary Calculator includes binary arithmetic (addition and subtraction). Use whichever fits your primary task.
Can I enter lowercase hex digits?
Yes. The tool accepts both uppercase (A–F) and lowercase (a–f) hex digits. Output is always displayed in uppercase for consistency.
Sources
- Wikipedia — Hexadecimal (base-16 numbering and digit table)
- Wikipedia — Web Colors (hex color code format and named colors)
- MDN Web Docs — CSS Color Values (hex, RGB, and other color formats)
Method & review
Estimate only. Results reflect your inputs and standard formulas. Double-check important decisions independently.