Z

Number Base Converter

Convert numbers between binary, octal, decimal and hexadecimal (or any base 2–36).

Runs in your browser — files never leave your device

Binary (base 2)
11111111
Octal (base 8)
377
Decimal (base 10)
255
Hex (base 16)
ff

How it works

Type a value, tell the tool which base you typed it in, and the binary, octal, decimal and hexadecimal forms all update live in the four cards. There is nothing to submit — change the value or the From base and every card recomputes. Empty or unparseable input shows an em dash.

Parsing reads the digits in the base you selected, with a leading minus sign handled separately, and hex digits are case-insensitive: ff and FF both mean 255. Reading stops at the first character that is not a valid digit — 3.75 in decimal parses as 3 — and if the very first character is invalid there is no result. Hexadecimal output is always lowercase.

The classic example: decimal 255 is 11111111 in binary, 377 in octal and ff in hex. The bases line up neatly — each octal digit is exactly three bits and each hex digit exactly four — which is why Unix permissions read naturally in octal: chmod 755 is decimal 493 and binary 111101101, three rwx triplets of 111, 101 and 101 for owner, group and world.

That mapping is where base conversion earns its keep: reading and building permission masks, working out bitmask and flag values for APIs and protocol headers, translating hex color channels or memory offsets, checking what a status byte means bit by bit, and sanity-checking subnet masks. Paste any value from a hex dump and see it in all four bases at once.

Things to know: negative numbers are shown sign-and-magnitude — -255 converts to -11111111 in binary, not the 32-bit two’s-complement pattern 11111111111111111111111100000001 a systems programmer might expect. Enter plain digits without prefixes: a leading 0x is tolerated for hex input, but 0b and 0o are not, and stray characters silently cut parsing short. Values are exact up to 9007199254740991 (2⁵³ − 1, hex 1fffffffffffff); beyond that, floating-point rounding creeps into the last digits.

Frequently asked questions

Which bases are supported?
Input can be binary (base 2), octal (base 8), decimal (base 10) or hexadecimal (base 16), selected with the From base dropdown, and the value is always shown in all four bases side by side. Those four cover day-to-day programming: bit patterns, Unix permissions, ordinary arithmetic and hex constants.
Do I need prefixes like 0x or 0b?
No — enter plain digits and pick the base from the dropdown instead. A leading 0x on hexadecimal input happens to be tolerated, but 0b and 0o are not recognized: parsing stops at the letter, so 0b101 read as binary parses as just 0. Digit-only input is the safe habit.
Does hexadecimal input care about letter case?
No — ff, FF and fF all parse to 255. Converted hexadecimal output is always lowercase; add a 0x prefix or uppercase it yourself if your style guide expects that.
How are negative numbers converted?
As sign and magnitude: the minus sign is kept and the absolute value is converted, so -255 shows as -ff in hex and -11111111 in binary. This is not two’s complement — the 32-bit two’s-complement pattern for -255 would be 11111111111111111111111100000001, which is a storage representation rather than a different number.
What happens to fractions or stray characters?
Parsing stops at the first character that is not a valid digit in the chosen base. So 3.75 in decimal converts as 3, and 129 read as binary converts as 1 (2 is not a binary digit). If even the first character is invalid, the cards show an em dash instead of a result.
What is the largest value it converts exactly?
9007199254740991, which is 2⁵³ − 1 (hex 1fffffffffffff) — the largest integer JavaScript represents exactly. Larger inputs still convert, but the trailing digits may be rounded.
Is my number uploaded?
No — conversion happens instantly in your browser as you type. Nothing is sent to a server, and the same logic powers the ZoolTools mobile app via shared test vectors.