Math

Number Base Converter

Convert numbers between binary, octal, decimal, and hexadecimal.

About this tool

Binary, octal, decimal, and hexadecimal are four ways of writing the same numbers, and converting between them is daily work in programming, networking, and electronics. Hexadecimal in particular appears everywhere from color codes to memory addresses because each hex digit maps to exactly four binary bits.

Enter a number in any of the four bases and this converter shows it in all of them at once. It accepts arbitrarily large whole numbers, validates that every digit is legal for the chosen base, and handles common prefixes like 0x and 0b automatically.

Frequently asked questions

Why is hexadecimal so common in computing?

One hex digit represents exactly four bits, so a byte is always two hex digits. That makes hex a compact, lossless shorthand for binary.

Does this handle very large numbers?

Yes. The conversion uses arbitrary precision integers, so numbers far beyond the usual 53 bit JavaScript limit convert exactly.