Convert between binary, octal, decimal, and hexadecimal
Numbers can be written in many bases — binary (base 2), octal (8), decimal (10), hexadecimal (16) — but they all describe the same value. Programmers move between them constantly: hex for memory addresses and color codes, binary for bit-flag flags, decimal for everything else.
This converter lets you type a number in any of the four bases and instantly see it in the others. Bidirectional, real-time, and entirely client-side.
Decimal: 255Binary: 11111111
Octal: 377
Hexadecimal: FFHexadecimal: 1A2B3CDecimal: 1715004
Octal: 6425474
Binary: 000110100010101100111100JavaScript safe integers — 2^53 - 1, about 9.007 × 10^15 in decimal. Beyond that, precision degrades. For arbitrary-precision needs (large hashes, RSA-sized integers), use a BigInt-aware tool or a programming language that supports it natively.
Yes for decimal input — it just shows the sign. Binary and hex display the natural-number representation, not two's complement, so -5 doesn't become FFFFFFFB. If you need two's complement for fixed-width integers, that's a separate concept.
Integers only. Floating-point representation across bases (especially binary) gets weird fast — 0.1 in decimal is a non-terminating binary fraction. For float internals, use a dedicated IEEE 754 visualizer.
Convention to disambiguate: 0x1A is hex, 1A on its own could be confusing. C, JavaScript, Python all accept the 0x prefix. Binary uses 0b in newer language standards. This tool omits prefixes since the field already identifies the base.
There's no concept of width here — the number is just the number. Two's complement (FFFF = -1 in 16-bit signed) is a CPU/data-type convention; this converter shows the value as a non-negative integer in each base.