One value, every base, exactly
LOCALDecimal 255, hexadecimal FF, octal 377 and binary 11111111 are the same number written four ways, and converting between them by hand is where small mistakes become wrong mask constants and bad register writes. This converter reads a value in any base from 2 to 36 and shows it in binary, octal, decimal and hexadecimal at the same time, with an optional custom base on top. Parsing uses BigInt, so a long identifier or a 128-bit address stays exact instead of drifting once it passes the safe-integer limit. Binary output is split into groups of four bits so a 32-bit word can be read at a glance, and the bit length and hexadecimal byte string are shown beside it. Prefixed input such as 0x, 0b and 0o is detected automatically, spaces and underscores are ignored, and nothing leaves the browser. The converter works with whole numbers only and keeps the minus sign outside the digits.
How it works
- 01
Type a value and let auto mode read it
There is one input field. In auto mode the tool looks at the first two characters: 0x means hexadecimal, 0b means binary and 0o means octal, while anything else is read as decimal. A bare FF is therefore not accepted as hex until you set the base to 16, because auto mode has no prefix to go on. Spaces and underscores are stripped, so a copied memory dump like 0xDEAD_BEEF or a grouped binary string can be pasted straight in. Letters are case-insensitive, which means ff and FF produce identical results.
- 02
Fix the base when the shorthand is missing
Auto mode is convenient but literal: 755 without a prefix is seven hundred fifty-five in decimal, not Unix permissions. When the source format has a known base but no prefix, pick binary, octal, decimal or hex from the selector, or choose a custom base between 2 and 36. Digits run from 0 to 9 and then A to Z, so base 36 uses the whole alphabet. The result updates on every keystroke, which makes it easy to spot the moment a digit becomes invalid for the chosen base.
- 03
Read the four rows as one picture
Binary, octal, decimal and hex are always displayed together. For 255 the rows read 1111 1111, 377, 255 and FF. The binary row is spaced every four bits, so a 16-bit value becomes four clean groups and a 32-bit value eight. Below the rows, the bit length counts the significant bits of the magnitude, and the byte string writes the value as whole hex bytes: 255 is one byte, FF, while 1024 is 04 00 with a bit length of 11. Reading these together is usually faster than converting anything in your head.
- 04
Copy the row you need
Each result row has its own copy button, so you can take the hex without the surrounding labels, or the binary with its nibble grouping intact. Negative input keeps its sign in front: -10 shows binary -1010, octal -12 and hex -A, with the bit length describing the magnitude rather than a two's-complement pattern. Input is limited to 4096 digits. Nothing is stored and no history is kept, so reloading the page starts from an empty field.
When to use it
Debugging bit masks and register values
A register field documented as 0x1F holds 31 in decimal and 0001 1111 in binary; setting bit 5 gives 0x3F, and clearing the low nibble gives 0x10. Hex is the usual notation in datasheets because each hex digit maps to exactly one nibble of four bits, so a 32-bit register is always eight hex digits and never needs counting. Typing the same constant as hex, binary and decimal in one place removes the mental arithmetic where off-by-one mask bugs begin, and the bit length quickly reveals whether a value really fits the field you are writing to.
Unix file permissions
chmod 755 is not decimal seven hundred fifty-five. Each octal digit packs three permission bits — read, write, execute — for owner, group and others in that order. 755 is 111 101 101: full access for the owner, read and execute for the rest. 644 is 110 100 100, the normal choice for files. This tool shows octal 755 as decimal 493 and 644 as decimal 420, and the grouped binary row makes the rwx triples obvious. The three-bit width is not a coincidence: octal is base 8, which is 2 cubed, so one octal digit always covers exactly three binary digits.
Colour values and packed RGB
A CSS colour such as #FF8800 splits into R = FF = 255, G = 88 = 136 and B = 00 = 0. Packed as one 24-bit integer it is 16,746,496, which is the form many APIs and databases store. Converting that decimal back to hex recovers the three channels; each pair of hex digits is one byte, because two hex digits make eight bits. One step in a hex channel is 16 in decimal, which is why eyeballing decimal colour values is unreliable and why theme files use hex. Pay attention to leading zeros: 00 in the blue channel carries meaning and must survive the round trip.
Protocol fields, memory addresses and IDs
Packet captures, firmware logs and hex dumps print addresses and field values in hexadecimal, often next to a byte string such as 04 00. Pasting a 64-bit address like 0x0000_7FFF_FFFF_FFFF into an ordinary calculator silently loses low digits once the value exceeds 2^53, while this converter keeps every character because it parses into BigInt. The byte string beside the result is the value written as whole bytes in most-significant-first order, which matches how dumps usually print lengths and checksums. It is a numeric rendering, not a memory layout, so it does not reorder anything for little-endian machines.
Questions
Why do large numbers stay exact here?
Parsing and formatting use JavaScript BigInt instead of Number. A double represents integers exactly only up to 2^53 − 1, which is 9,007,199,254,740,991; past that point it rounds and the trailing digits quietly change. BigInt has no such ceiling, so a 20-digit decimal ID, a 128-bit value or a 64-bit address converts digit for digit. BigInt is slower, but for a single value typed by hand that cost is invisible.
Can it convert decimal fractions?
No, integers only. A decimal point, a comma or a fraction such as 1/3 is rejected rather than rounded, because many fractions repeat forever in base 2 and have no exact finite binary form. If you need fixed-point work, scale the value to an integer yourself — cents instead of euros, for example — convert that, and carry the scale factor separately. This keeps the result honest instead of hiding a rounding step.
What about two's complement for negative numbers?
It is deliberately not shown. Two's complement depends on a fixed word width: -1 is 11111111 in 8 bits, sixteen ones in 16 bits and thirty-two ones in 32 bits. Without a declared width any two's-complement display would be a guess, and a wrong guess is worse than no guess. This tool prints a minus sign followed by the magnitude, so -10 becomes -1010, -12 in octal and -A in hex. For a hardware register, choose the width in your own tooling and pad accordingly.
Which prefixes does auto mode understand?
0x or 0X means hexadecimal, 0b or 0B means binary, and 0o or 0O means octal. There is no prefix for decimal: anything that does not start with one of those is read as decimal, which is why 0o755 is octal but 755 is decimal. If a prefix was stripped somewhere earlier in your pipeline, set the base manually instead of guessing. A value copied from a language that writes hex as #FF8800 or $FF will also need the prefix changed or the base selected by hand.
What happens with an invalid digit?
The tool stops and names the character, for example “G” is not a valid digit in base 16. That is a deliberate error rather than a silent truncation, because a typo in a mask constant should be visible immediately. The most common cause is pasting a hex value while the selector is still on decimal, so check the base first. Removing spaces and underscores does not hide the problem, since only ignorable separators are folded away.
Is anything uploaded or stored?
Nothing is uploaded. Conversion is plain string parsing and BigInt arithmetic in the current tab. There is no network request, account, database or server-side log, and no copy of the input is kept. You can open the browser's network panel while typing and watch it stay empty, then close the tab and know the value is gone.
Which bases are supported?
Every whole base from 2 to 36. Digits are 0–9 followed by A–Z, the standard convention that yields 36 symbols. Bases above 16 are mostly for compact encodings and puzzles; base 32 and base 36 appear in identifiers and short links. The four common bases always appear as result rows, and the custom row follows whatever base you choose, including unusual ones such as 7 or 24.
How is this different from a programmer calculator?
A programmer calculator works on fixed widths — byte, word, dword, qword — and offers bitwise AND, OR, XOR and shifts. This tool makes the opposite trade: no fixed width and no overflow, with numbers as long as you need, but no bitwise operations and no two's-complement view. It also groups binary output into nibbles and prints the hex byte string, which most calculators do not. Use it to read, check and copy values, then move to a calculator when you actually need to manipulate bits.