Decimal / Binary / Hex Converter

Runs in browser Utilities

Type a value in any of the four fields and the others update live, with a bit grid, two's complement view and byte grouping for 8/16/32/64-bit widths.

Privacy: This tool runs entirely in your browser. Your input never leaves your device.
Loading tool…

How to use Decimal / Binary / Hex Converter

  1. Type a value in any field — the others update immediately.
  2. Choose a bit width to see the register representation.
  3. Toggle bits or use Negate / Shift to explore the encoding.

Decimal / Binary / Hex Converter features

  • Four synchronised fields: decimal, binary, octal, hexadecimal
  • Click bits in the grid to toggle them
  • 8/16/32/64-bit register view with two's complement and signed/unsigned readings
  • Big-endian and little-endian byte order
  • Popcount, lowest set bit and bits-needed
  • Negate and shift actions, digit grouping, uppercase hex

Decimal / Binary / Hex Converter example

Negative number in 8 bits

Input:

Decimal −42, width 8

Output:

Two's complement 11010110 (0xD6), as unsigned 214

Frequently asked questions about Decimal / Binary / Hex Converter

How do I use the synchronised fields?

Type in any of the decimal, binary, octal or hexadecimal boxes — the other three update as you type. You can also toggle individual bits in the grid.

What does the bit width do?

It selects an 8, 16, 32 or 64-bit register view for the two's complement, unsigned/signed interpretations and byte order. "Auto" picks the smallest width that holds the value.

How are negative numbers shown?

The main fields show a minus sign; the register view shows the two's complement bit pattern at the selected width, plus what that pattern means as an unsigned integer.

What do the little-endian bytes mean?

They show the byte order used in memory by x86/ARM processors, which is the reverse of the human-readable (big-endian) hex string.

Technical notes

All four fields parse into a BigInt (parseBigInt), so 64-bit values like 0xFFFFFFFFFFFFFFFF stay exact where Number loses precision above 2^53; the view stops at 256 bits. Prefixes are accepted only in their own field (0x in hex, 0b in binary, 0o in octal), and underscores, commas and spaces are ignored. Auto width picks the smallest of 8/16/32/64 bits that holds the value signed or unsigned, so 200 stays 8-bit and −129 needs 16.

The register view wraps modulo 2^width (integerView), not clamping: 300 in 8 bits shows 00101100 = 44 plus an overflow warning; 'As signed' reinterprets that pattern. Popcount and lowest set bit also use it, so −1 has eight set bits at 8 bits, while 'Bits needed' counts the magnitude, no sign bit. Shift right is arithmetic (−5 >> 1 = −3); toggling bits keeps negative values signed but reads non-negative ones as unsigned.