Skip to content

Number System Converter

Convert between Binary, Octal, Decimal, Hexadecimal, and Roman numerals instantly

Calculator Details

Decimal (Base 10):42See results ↓

The number system the value is written in

Enter decimal number (digits 0-9)

Quick Reference:

  • • Binary: Only 0 and 1 (e.g., 1010)
  • • Octal: Digits 0-7 (e.g., 377)
  • • Decimal: Digits 0-9 (e.g., 255)
  • • Hex: 0-9, A-F (e.g., FF)
  • • Roman: I, V, X, L, C, D, M (e.g., XLII)

Your Results

Decimal (Base 10): 42

Decimal (Base 10)

42

Standard base-10 number

Conversion Details

Input Value

42

Original value in decimal

Input Base

Decimal

Source number system

Decimal Value

42

Intermediate conversion to base-10

Detailed Breakdown

42 in every number system
Number systemValueSymbols
Decimal (base 10) (your input)42Digits 0–9
Binary (base 2)101010Digits 0 and 1
Octal (base 8)52Digits 0–7
Hexadecimal (base 16)2ADigits 0–9 and A–F
Roman numeralsXLIII, V, X, L, C, D, M

How This Calculator Works

How Number Systems Work

Different number systems use different bases to represent numbers. The base determines how many unique digits are available and the value of each position. The converter first reads your value as an exact whole number, then writes it out in every other system.

Your conversion

42 (base 10) = 4×10^1 + 2×10^0
= 42 (decimal)
42 = 101010 (binary) = 52 (octal) = 2A (hex)

1. Binary (Base 2)

Uses: 0, 1
Example: 1010₂ = (1×8) + (0×4) + (1×2) + (0×1) = 10₁₀

Position values: ...128, 64, 32, 16, 8, 4, 2, 1

Binary is the foundation of all computer systems. Each digit represents a power of 2, and only 0 or 1 can appear in each position.

2. Octal (Base 8)

Uses: 0, 1, 2, 3, 4, 5, 6, 7
Example: 52₈ = (5×8) + (2×1) = 42₁₀

Position values: ...512, 64, 8, 1

Octal is useful for representing binary numbers more compactly. Each octal digit represents exactly 3 binary digits.

3. Decimal (Base 10)

Uses: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Example: 42₁₀ = (4×10) + (2×1) = 42₁₀

Position values: ...1000, 100, 10, 1

Decimal is the standard number system humans use daily. It likely developed because we have 10 fingers.

4. Hexadecimal (Base 16)

Uses: 0-9, A-F (where A=10, B=11, C=12, D=13, E=14, F=15)
Example: 2A₁₆ = (2×16) + (10×1) = 42₁₀

Position values: ...4096, 256, 16, 1

Hexadecimal is widely used in computing to represent colors (#FF0000), memory addresses, and binary data compactly. Each hex digit represents exactly 4 binary digits.

5. Roman Numerals

I=1, V=5, X=10, L=50, C=100, D=500, M=1000

Example: XLII = (50-10) + 1 + 1 = 42
Subtractive rules: IV=4, IX=9, XL=40, XC=90, CD=400, CM=900

Roman numerals were used in ancient Rome and are still used today for clock faces, book chapters, and movie sequels. Standard Roman numerals only represent 1-3999.

Frequently Asked Questions

Why do computers use binary instead of decimal?

Computers use binary because digital circuits have two stable states: on (1) and off (0). This corresponds to electrical signals being present or absent. Binary is the most reliable and simplest system for electronic circuits to represent and process information.

What is hexadecimal used for?

Hexadecimal is used extensively in programming and computing for representing: (1) Colors in web design (#FF0000 for red), (2) Memory addresses in debugging, (3) Binary data in a more compact form (each hex digit = 4 binary digits), (4) MAC addresses and IPv6 addresses in networking.

How do I convert between binary and hexadecimal?

To convert binary to hex: group binary digits into sets of 4 from right to left, then convert each group to its hex equivalent (0000=0, 0001=1, ..., 1111=F). For hex to binary: replace each hex digit with its 4-digit binary equivalent. Example: 1010 1111₂ = AF₁₆

Why does Roman numeral system use subtractive notation like IV for 4?

Subtractive notation (placing a smaller value before a larger one) makes Roman numerals more compact and easier to read. Without it, 4 would be IIII, 9 would be VIIII, etc. The subtractive rule only applies in specific cases: IV (4), IX (9), XL (40), XC (90), CD (400), and CM (900).

What is the relationship between octal and binary?

Each octal digit represents exactly 3 binary digits. This makes octal useful for representing binary numbers more compactly. For example, binary 101 010 111 = octal 527. This 3-to-1 relationship makes conversion between octal and binary straightforward.

Why are there no Roman numerals for numbers above 3999?

Standard Roman numerals use M (1000) as the largest symbol. To represent 4000+, you would need additional symbols or notation like a vinculum (overline) to multiply by 1000. This calculator only supports standard Roman numerals (1-3999) for simplicity and historical accuracy.

What does "base" mean in a number system?

The base (or radix) is the number of unique digits available in a number system. It also determines the value of each position. Binary has base 2 (digits 0-1), decimal has base 10 (digits 0-9), hexadecimal has base 16 (digits 0-F). Each position represents base^position.

Can I convert negative numbers or decimals?

This calculator converts whole numbers from 0 up (Roman numerals from 1 to 3,999). Negative numbers require a sign representation (like two's complement in binary). Decimal fractions require fractional parts in each base (e.g., 0.5₁₀ = 0.1₂). These advanced conversions require different techniques.

What are some real-world uses of different number systems?

Binary: Computer processors, digital electronics, Boolean logic. Octal: Unix file permissions (chmod 755), older computer systems. Decimal: Everyday counting, money, measurements. Hexadecimal: Web colors, memory dumps, cryptography, network protocols. Roman: Clock faces, chapter numbers, copyright years in movies.

How large a number can I convert?

Up to 64 digits in the base you choose. Every digit is kept exactly (the conversion uses arbitrary-size integers), so FFFFFFFFFFFFFFFF in hex converts to 18446744073709551615 without the rounding ordinary calculator numbers suffer above 9,007,199,254,740,991.

Why is my Roman numeral rejected?

Only standard Roman numerals are accepted, written the way the subtractive rules produce them: IIII is rejected because 4 is IV, VX because 5 is V, IC because 99 is XCIX. The message tells you the standard form of the value you typed.

Converts whole numbers from 0 up (up to 64 digits) between binary, octal, decimal and hexadecimal exactly, and to standard Roman numerals from 1 to 3,999. Not included: negative numbers (two's complement), fractions, other bases and Roman numerals above 3,999 (vinculum notation).

Number System Converter: Binary, Octal, Decimal, Hex and Roman Numerals

By FindMySum · Last reviewed

A number system converter rewrites a whole number in a different base without changing its value. Forty-two is the same quantity whether you write it as 42 in decimal, 101010 in binary, 52 in octal, 2A in hexadecimal or XLII in Roman numerals. This converter takes a value in any of those five systems and shows it in all the others at once. The four positional systems follow one rule, so once you see how it works you can check any conversion by hand; Roman numerals follow different rules, which explains their limits.

How positional number systems work

In a positional system, each digit is multiplied by a power of the base, and the power depends on the digit's position, counting from 0 on the right. In decimal, 352 means 3 × 10² + 5 × 10¹ + 2 × 10⁰. The same rule works in any base:

SystemBaseDigitsCommon use
Binary20 and 1How computers store everything
Octal80 to 7Unix file permissions
Decimal100 to 9Everyday counting
Hexadecimal160 to 9, A to FColours, memory addresses, byte values

Hexadecimal needs six extra digits, so it borrows letters: A is 10, B is 11 and so on up to F for 15.

To convert from another base to decimal, multiply each digit by its place value and add. To convert from decimal to another base, divide by the base repeatedly and keep the remainders; read them from last to first. The converter works with exact whole-number arithmetic, so it keeps every digit for values up to 64 digits long instead of rounding them the way ordinary floating-point numbers do above 2⁵³.

Worked example: the calculator's defaults

The converter opens with the decimal value 42.

To binary, divide by 2 and note each remainder:

  1. 42 ÷ 2 = 21, remainder 0
  2. 21 ÷ 2 = 10, remainder 1
  3. 10 ÷ 2 = 5, remainder 0
  4. 5 ÷ 2 = 2, remainder 1
  5. 2 ÷ 2 = 1, remainder 0
  6. 1 ÷ 2 = 0, remainder 1

Reading the remainders from the bottom up gives 101010. Check it the other way: 32 + 8 + 2 = 42.

To octal: 42 ÷ 8 = 5 remainder 2, and 5 ÷ 8 = 0 remainder 5, so the result is 52 (5 × 8 + 2 = 42).

To hexadecimal: 42 ÷ 16 = 2 remainder 10, and 10 is written A, so the result is 2A (2 × 16 + 10 = 42).

To Roman numerals: 42 is 40 + 2. Forty is written XL (10 before 50) and 2 is II, giving XLII.

Shortcuts between binary, octal and hex

Because 8 = 2³ and 16 = 2⁴, you can convert binary to octal or hex without going through decimal. Group the bits from the right in threes for octal or fours for hex, and convert each group on its own. Take the year 2026, which the converter shows as binary 11111101010:

  • Fours for hex: 111 1110 1010 → 7, E, A → 7EA
  • Threes for octal: 11 111 101 010 → 3, 7, 5, 2 → 3752
  • Roman: MMXXVI

This is why programmers like hexadecimal: each hex digit stands for exactly four bits, so two hex digits describe one byte, and a long binary pattern becomes short enough to read.

How Roman numerals are built

Roman numerals are additive, not positional. Seven symbols carry fixed values (I = 1, V = 5, X = 10, L = 50, C = 100, D = 500, M = 1,000), and you add them up from largest to smallest. The modern standard form adds six subtractive pairs, where a smaller symbol written before a larger one is subtracted: IV (4), IX (9), XL (40), XC (90), CD (400) and CM (900). Only I, X and C are subtracted, and only from the next two larger symbols.

The converter accepts only numerals written in this standard form. It rejects variants such as IIII, which appears on many clock faces, and IC for 99, telling you the standard spelling instead. Standard numerals stop at 3,999 (MMMCMXCIX) because there is no symbol above M; larger values were written with a bar over a numeral to multiply it by 1,000, a convention the converter doesn't use. There is also no Roman numeral for zero, so for 0 or anything above 3,999 the Roman result shows as not available.

Limits

The converter handles whole numbers from 0 upward. It doesn't convert negative numbers, which computers store using a fixed-width scheme such as two's complement, or fractions, which computers usually store as binary floating-point values under IEEE 754. Values can be up to 64 digits long in the base you type, and every digit of the result is exact.

Using the result

For arithmetic on the converted numbers, the basic calculator works in decimal. Powers of 2 and their logarithms, which tell you how many bits a number needs, are in the exponent and logarithm calculator. For storage sizes, remember the NIST binary prefixes: a kibibyte is 2¹⁰ bytes, a mebibyte 2²⁰ and a gibibyte 2³⁰.

More questions

How do I read a hex colour code like #1E90FF?

Split it into three pairs, one each for red, green and blue, and convert each pair from hexadecimal. 1E is 30, 90 is 144 and FF is 255, so the colour is red 30, green 144, blue 255 on a 0 to 255 scale, a bright blue. Each pair is one byte, which is why colours have exactly six hex digits.

Why does a byte only go up to 255?

A byte is 8 bits, and the largest 8-digit binary number is 11111111, which the converter shows as 255 in decimal, 377 in octal and FF in hexadecimal. Counting from 0, that gives 256 possible values, which is 2 to the power 8. The same pattern holds for any width: n bits hold values from 0 to 2ⁿ − 1.

Does the converter keep leading zeros?

Leading zeros don't change a value, so they are accepted but not kept. Binary 00101010 converts to 42, and the binary result is shown as 101010. If you need a fixed width, such as 8 bits for a byte, add zeros to the left of the result yourself until it is the right length.

What is the difference between a kilobyte and a kibibyte?

A kilobyte (kB) is 1,000 bytes, using the SI prefix kilo. A kibibyte (KiB) is 1,024 bytes, or 2¹⁰. The binary prefixes kibi, mebi and gibi were adopted by the International Electrotechnical Commission in 1998 to end the confusion, and NIST recommends them. The gap grows with size: a gibibyte is about 7.4% larger than a gigabyte.

How do I write a year like 1999 in Roman numerals?

Break it into thousands, hundreds, tens and ones and write each part separately: 1000 is M, 900 is CM, 90 is XC and 9 is IX, giving MCMXCIX. The converter does this for any whole number from 1 to 3,999. A tempting shortcut, MIM (1000 + 999), is not standard, because I may only be subtracted from V and X.

Is hexadecimal input case-sensitive?

No. The letters A to F can be typed in upper or lower case, so 2a and 2A are the same value, 42. The converter always shows hexadecimal results in upper case. Spaces and underscores used to group digits, as in 1010_1010, are ignored.

Sources

This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.

Spotted a wrong result or a bug? Report a problem

May we count your visits with Invoker Analytics? It keeps a random visitor number in your browser. Your calculator inputs are never sent. Privacy policy