Number Base Converter

Type a number into any box and the others follow — binary, octal, decimal, hex or any base from 2 to 36. Everything stays on your device. ← Workbench

Details

How the boxes read your input

Any box accepts any base. Each box has its own base, but a 0x, 0b or 0o prefix always wins — paste 0x2a into the decimal box and it is read as hex 2a. Without a prefix, the box's own base applies, and the digits must fit it: the binary box takes 0 and 1 only, the hex box takes 0–9 and a–f (case doesn't matter).

Spaces and underscores are ignored, so FF 00, ff_00 and ff00 are the same number — handy for pasting grouped output. A leading + or sign works everywhere.

The math is exact. Numbers are handled as arbitrary-precision integers, so a 1000-digit decimal converts correctly instead of silently rounding through a float. Inputs up to about 4000 digits are accepted; longer ones are refused rather than mis-read.

Bits and bytes describe the magnitude: how many binary digits it needs and how many bytes that fills.

Two's complement is how computers store negative integers in a fixed width. The rows show what the same number looks like in 8, 16, 32 and 64 bits: its unsigned bit pattern in hex, and what that pattern reads as when interpreted as signed. −1, for example, is ff in 8 bits, ffff in 16, and so on. Numbers outside a width's range (−128…127 for 8 bits) simply don't fit and are marked as such.

Everything runs locally in your browser — there are no network requests at all.