Home Unit Conversion Number Base Converter

Number Base Converter

Convert numbers between decimal, binary, octal, hexadecimal and Roman numerals, with the conversion explained step by step.

Advertisement

How it works

Every number system has a base. Decimal (base 10) uses digits 0 to 9, binary (base 2) uses 0 and 1, octal (base 8) uses 0 to 7, and hexadecimal (base 16) uses 0 to 9 and the letters A to F. Computers run on binary, and programmers often read hexadecimal because one hex digit is exactly four binary digits. Roman numerals use letters for fixed values, written largest to smallest, with a smaller letter before a larger one meaning subtraction, like IV for 4.

Advertisement

Formula

In base b, the digits xyz are worth x × b² + y × b + z.
To go from decimal to another base, divide by the base repeatedly and read the remainders from last to first.
Roman: M = 1000, D = 500, C = 100, L = 50, X = 10, V = 5, I = 1.

Example

Example in plain words. The decimal number 255.

In binary: 255 = 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1, so 11111111.

In octal: 255 ÷ 8 = 31 remainder 7, then 31 ÷ 8 = 3 remainder 7, so 377.

In hexadecimal: 255 = 15 × 16 + 15, so FF.

In Roman numerals: 200 + 50 + 5 = CCLV.

Frequently asked questions

Why do programmers like hexadecimal?

One hex digit is exactly 4 binary digits, so FF is a full byte (11111111). Screen colors like #FF8800 are hexadecimal too.

Is there a Roman zero?

No. Roman numerals have no zero, and the standard form stops at 3,999 (MMMCMXCIX), so larger numbers show a dash.

Advertisement

Related calculators

Length Converter

Convert between millimeters, centimeters, meters, kilometers, inches, feet, yards, miles and nautical miles.

Weight Converter

Convert between milligrams, grams, kilograms, metric tons, ounces, pounds and stone.

Volume Converter

Convert between milliliters, liters, cubic meters and US kitchen units: teaspoons, tablespoons, fluid ounces, cups, pints, quarts and gallons.

Temperature Converter

Convert between Celsius, Fahrenheit and Kelvin.