mockstack.

Number Base Converter

BINARY · HEX · IEEE 754 ← Developer & Data

Type a number in any row and the others follow, with the working shown below.

Number
Steps
READY RUNS LOCALLY

About the Number Base Converter

Converts numbers between bases and shows the working, and covers the rest of the number-systems syllabus: text as bytes, two’s complement, bitwise operations, IEEE 754 floating point, and parity, Hamming, and CRC error checks.

Every Setting

Bases
Binary, octal, decimal, hex, and any base from 2 to 36 at once. Type in any row. Numbers can be any length, negative, or have a fractional part; a fraction that repeats forever is marked with a line over the repeating digits. Steps shows the working for the conversion you pick: repeated division or multiplication from decimal, digit-by-position sums to decimal, and bit grouping between binary, octal, and hex.
Text
Text to bytes and bytes to text through UTF-8, with the bytes as binary, hex, decimal, or octal. Type on either side. The table lists each character’s code point and bytes.
Two’s Complement
A signed number and its bits at 4, 8, 16, 32, or 64 bits. It also shows the number in sign-magnitude, ones’ complement, and offset binary, what the same bits mean read each way, and the invert-and-add-one working.
Bitwise
AND, OR, XOR, NAND, NOR, XNOR, NOT, shifts, and rotates on two numbers at a fixed width, all at once. Click a row to line up the bits. The arithmetic right shift copies the sign bit in; the logical one shifts in zeros.
Float
How a decimal number is stored in IEEE 754 half, single, or double precision: the sign, exponent, and mantissa bits, the exact value that gets stored, the rounding error, and the gap to the next number. The conversion rounds exactly, to nearest with ties to even, as hardware does. Click bits to flip them, or paste the bits as hex or binary.
Error Checks
Parity bits with a check of a received word; Hamming codes for any number of data bits, with the parity sums and single-bit correction, and an optional extra bit (SECDED) that detects double errors; and CRC, either worked by long division for a generator you choose or computed with standard parameters like CRC-32, CRC-16, and CRC-8, including your own.
ASCII Table
The 128 ASCII codes in decimal, hex, octal, and binary, opened from the toolbar.

Common Questions

Why does 0.1 not fit exactly in binary?
One tenth in binary is 0.0 followed by 0011 repeating forever, like one third in decimal. A float keeps only so many bits, so it stores the nearest value it can. Float mode shows that value in full.
Which CRC-32 is this?
The common one, used by ZIP, PNG, and Ethernet. Its check value, the CRC of the text 123456789, is CBF43926; each standard lists its check value so you can confirm the settings.

Related: Truth Table Generator, Hash Generator, Base64 and URL Encoder.