deftools.io Developer Tools

Number Base Converter

Convert numbers between binary, octal, decimal, and hexadecimal with arbitrary precision. BigInt-powered exact conversion for 256-bit values and UUIDs.

Binary
Octal
Decimal
Hex
Quick Conversions

About this tool

The Number Base Converter translates values between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16) simultaneously. Integer conversions use BigInt for arbitrary precision — 256-bit hashes and UUIDs convert exactly.

Switch to Float (IEEE 754) mode to dissect any decimal number into its 32-bit single-precision representation: the sign bit, the 8-bit biased exponent, and the 23-bit mantissa. The dissector detects special cases — NaN (quiet vs signaling), ±Infinity, ±0, and subnormal numbers — and shows the raw hex encoding, bit layout with color-coded fields, and the mantissa value with its implicit leading 1.

Integer example: enter FF with From Base = Hex → 11111111 (binary), 377 (octal), 255 (decimal).
Float example: enter 3.14 → sign 0, exponent 10000000 (biased 128 → actual 1), mantissa 10010001111010111000011, raw hex 0x4048F5C3.

FAQ

What is the largest number I can convert?

There is no practical limit for integers. The converter uses arbitrary-precision BigInt arithmetic, so even 256-bit or 512-bit values convert exactly without rounding. For floats, only single-precision (32-bit) IEEE 754 is shown — values outside the representable range (±3.4×10³⁸) round to ±Infinity.

What is IEEE 754 single precision?

It is the 32-bit floating-point format almost every computer uses for <code>float</code> in C and <code>Float32</code> in JavaScript typed arrays. A value is encoded as 1 sign bit + 8 exponent bits (biased by 127) + 23 mantissa bits. The exponent values 0 and 255 encode special cases: ±0, subnormals, ±Infinity, and NaN.

Why does 0.1 look so strange in the bit layout?

0.1 is not exactly representable in binary floating-point — just like 1/3 is not exact in decimal. The nearest 32-bit approximation has a repeating binary fraction that gets truncated to 23 bits. This is a well-known property of IEEE 754, not a bug in the tool.

What is a subnormal number?

When the exponent bits are all zero but the mantissa is non-zero, the number is subnormal (also called denormalized). These fill the gap between zero and the smallest normal value (~1.18×10⁻³⁸). The implicit leading 1 becomes 0, and the exponent is fixed at −126, allowing graceful underflow at the cost of precision.

Where can I inspect IEEE 754 floats in more detail?

Use the <a href="/float-inspector">Float Inspector (IEEE 754)</a> tool for dedicated floating-point analysis — it shows the exact decimal value, neighboring floats, ULP gaps, and supports both single (32-bit) and double (64-bit) precision. The base converter here gives a quick 32-bit dissection; the Float Inspector gives you the full diagnostic picture.

More developer tools

Copied!