advertisement
// bin ↔ oct ↔ dec ↔ hex

Number base converter

Type a number in any base and read it in all the others — binary, octal, decimal and hexadecimal, with no size limit.

advertisement

Reading the same number four ways

A number doesn't change when its base does — only how it's written down. Decimal 255 is FF in hexadecimal (2 digits instead of 3) and 11111111 in binary (the eight bits of one byte, all on). Hex is popular with programmers precisely because each hex digit maps to exactly four bits.

Can I paste prefixed numbers like 0xFF or 0b1010?

Yes — the standard prefixes (0x for hex, 0b for binary, 0o for octal) are recognized when they match the selected base. Spaces and underscores used as digit separators (like 1_000_000) are ignored too.

Is there a maximum size?

No practical one — this converter uses arbitrary-precision arithmetic, so numbers far beyond 64-bit work fine. Whole numbers only, though: fractions aren't supported.

Is my input sent anywhere?

No — this runs entirely in your browser with plain JavaScript. Nothing is uploaded.