Binary / Hex / Dec / Oct Converter
Convert numbers between decimal, binary, hexadecimal, and octal. Signed mode, digit grouping, instant sync.
Reference table (0–15)
| Dec | Bin | Hex | Oct |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 2 | 0010 | 2 | 2 |
| 3 | 0011 | 3 | 3 |
| 4 | 0100 | 4 | 4 |
| 5 | 0101 | 5 | 5 |
| 6 | 0110 | 6 | 6 |
| 7 | 0111 | 7 | 7 |
| 8 | 1000 | 8 | 10 |
| 9 | 1001 | 9 | 11 |
| 10 | 1010 | A | 12 |
| 11 | 1011 | B | 13 |
| 12 | 1100 | C | 14 |
| 13 | 1101 | D | 15 |
| 14 | 1110 | E | 16 |
| 15 | 1111 | F | 17 |
What is a base converter?
A base converter translates the same integer between positional systems: decimal (base 10), binary (base 2), hexadecimal (base 16), and octal (base 8). Edit any field and the others update instantly.
Use grouping to read long bit strings, optional 0x/0b prefixes for code, and signed mode for two's complement (64-bit). BigInt keeps large values accurate within the supported range.
Everyday examples
Byte value 255
Dec 255 → Bin 11111111, Hex FF, Oct 377 – classic 8-bit max.
Debug port 1337
Dec 1337 → Hex 539 – common in dev jokes and error codes.
Color channel
Hex FF → Dec 255 for CSS or graphics pipelines.
How to use this base converter
Type in any field – decimal, binary, hex, or octal – and the other three update instantly. All math runs locally in your browser.
When is this useful?
Programming
Translate memory addresses, flags, and bitmask values.
Networking
Convert subnet masks and port numbers between bases.
Learning
Check homework or explore how positional notation works.
Common mistakes
Leading zeros in octal
Some languages treat a leading 0 as octal – here octal is explicit base 8 only.
Signed vs unsigned
The same bit pattern can mean different values – enable signed when working with two's complement.
Hex case
Output is uppercase by default; input accepts A–F or a–f.
Sample conversions
Fixed examples – your live converter may add grouping or prefixes.
| Decimal | Binary | Hex | Octal |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 15 | 1111 | F | 17 |
| 255 | 11111111 | FF | 377 |
| 256 | 100000000 | 100 | 400 |
| 1337 | 10100111001 | 539 | 2471 |
Conversion details
- Engine
BigInt for parse and toString(2|8|16|10) – safe beyond Number.MAX_SAFE_INTEGER where allowed - Signed binary
Two's complement on 64 bits; MSB set → negative decimal - Grouping
Display-only spaces every 4/8 bits (binary) or 2 hex digits - Input parsing
Prefixes 0x/0b and grouping spaces are stripped before conversion
Key terms
Base / radix
How many distinct digits a system uses before carrying (2, 8, 10, 16).
Two's complement
Standard way to represent signed integers in binary hardware.
Nibble
Four bits – one hex digit – often grouped for readability.
MAX_SAFE_INTEGER
2^53 − 1 – largest integer JavaScript Number handles exactly; unsigned mode respects this cap.
Frequently Asked Questions
Number bases, ranges, and signed mode explained.
Is data sent to a server?
No. Conversion happens entirely in your browser with BigInt.
What is the maximum value?
Unsigned: up to Number.MAX_SAFE_INTEGER (9,007,199,254,740,991). Signed: 64-bit two's complement range.
Why grouping?
Spaces every 4 or 8 bits (or 2 hex digits) make long values easier to read – they are stripped on input.
Does signed mode affect hex and octal?
Yes – the same underlying integer is shown in all four fields; negative decimals appear as two's complement in binary.
About these results
Converted values follow standard positional notation and the options you select (signed, grouping, prefixes). Bit width, endianness, and language-specific literal rules may differ – always verify against your compiler, protocol, or documentation.