Start a project

Tool 79 of 100 · Numbers

Number Base Converter

Convert any integer between binary, hex, decimal and other bases, flip individual bits, see signed and unsigned values and byte order, and take a float apart.

Number Base Converter at a glanceIllustration: 1, A number; 2, processed in your browser; 3, Every base + bits.Number Base Converter0xB2 · 1781A number</>3Every base + bits2In yourbrowser
1 A number 2 processed on your device 3 Every base + bits

Number Base Converter

Integer

BaseValue

Bits and bytes

Click a bit to flip it.

ViewValue

Bitwise and arithmetic

IEEE 754 floating point

sign exponent mantissa

PartValue

01

What it does

Converts numbers of any size between bases 2 to 36, with two's complement, a clickable bit grid, bitwise maths and IEEE 754 breakdowns.

  • Bases 2 to 36 with BigInt, so no size limit
  • Two's complement at 8 to 128 bits
  • Clickable bit grid and big- or little-endian bytes
  • AND, OR, XOR, NOT, shifts and wrapping arithmetic

02

Private by design

Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

03

What you get

Values in every base and a float breakdown, with a Copy and a Download button on every result.

  • Binary
  • Hex
  • IEEE 754
  • Bitwise

Why it matters

Developers meet number bases constantly: hex colours and memory addresses, binary flags, octal file modes, and protocols that pack values into bytes in one order or the other. Most converters stop at 53 bits, where JavaScript numbers lose precision.

This converter uses BigInt, so any size is exact, and shows the same value as signed and unsigned at fixed widths with its bytes in both orders. The float section shows why 0.1 + 0.2 isn't 0.3: it gives the exact value a float really stores.

How it works

  1. InputA number in any base
  2. In your browserExact big-integer maths
  3. OutputBases, two's complement, bytes and floats

Where it fits in a designer's workflow

  1. Plan
  2. Design
  3. Build
  4. Test
  5. Launch
Debugging protocols, colours and bit flags.

By the numbers

  1. 0.1 → 0.1000000014901161232-bit, 0x3DCCCCCD
  2. 0.1 → 0.164-bit, 0x3FB999999999999A
  3. 0.5 → 0.564-bit, 0x3FE0000000000000
  4. 16777217 → 1677721632-bit, 0x4B800000
Stored by this tool with the browser's own IEEE 754 conversion. 0.1 has no exact binary form, so 32-bit storage is off by about 1.5 × 10⁻⁹; and 16,777,217 is the first whole number a 32-bit float can't hold. Source: MDN: number encoding.
Show the numbers as a table
ValueBitsHexStored as
0.1323DCCCCCD0.10000000149011612
0.1643FB999999999999A0.1
0.5643FE00000000000000.5
16777217324B80000016777216

How to use it

  1. Type a number; 0x, 0b and 0o prefixes are detected.
  2. Pick the width and whether it's signed.
  3. Click bits to flip them, or try a bitwise operation.
  4. Type a decimal or raw bits in the float section.

FAQ

Why does -1 show as 255?

In 8 bits, two's complement stores -1 as 11111111, which read as unsigned is 255.

What's the difference between >> and >>>?

>> (arithmetic) copies the sign bit as it shifts, so negative numbers stay negative. >>> (logical) fills with zeros.

Why can't 0.1 be stored exactly?

Floats are binary fractions, and 0.1 has no finite binary form. The nearest float64 is 0.1000000000000000055511151231257827…

Is there a size limit?

Not for integers: they use BigInt. Very large numbers just take longer to display.

Work with me

Want a site that gets these right?

I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

All developer tools · Back to leej.uk