Number Base Converter

Convert between binary, octal, decimal, hex with bitwise operation preview.

Used for two's-complement, masking, and bit display. Inputs may use 0b, 0o, 0x prefixes; underscores allowed.

Decimal (unsigned)
42
Decimal (signed, 32-bit)
42
Hex
0x00 00 00 2A
Octal
0o52
Binary (32-bit)
0b0000 0000 0000 0000 0000 0000 0010 1010
0
0
0
0
28
0
0
0
0
24
0
0
0
0
20
0
0
0
0
16
0
0
0
0
12
0
0
0
0
8
0
0
1
0
4
1
0
1
0
0

Set bits (popcount): 3

Bitwise operation preview

Adec 12 · 0x00 00 00 0C
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
Bdec 10 · 0x00 00 00 0A
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
Resultdec 8 · 0x00 00 00 08
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0

About Number Base Converter

Number Base Converter translates an integer between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Type a value in any of the four input boxes and the others update simultaneously. Negative numbers and arbitrarily large integers are supported (the tool uses BigInt under the hood, so 64-bit and larger values do not overflow).

Reach for it whenever you are reading bytes by hand: decoding a Unix file mode (`0755` ↔ `rwxr-xr-x` shape), interpreting a hex memory dump in decimal, converting a binary bit-mask into hex for a config file, or sanity-checking a colour value (`#ff8800` is `255, 136, 0`). It is bidirectional and instantaneous; no submit button, no API call. For per-line transformations across a list of numbers, use this tool one value at a time, or compose with Filter Lines by Regex to extract numbers from text first.

Examples

Input
decimal: 255
Output
binary:  11111111
octal:   377
hex:     FF

All four representations of the same value. The hex output uses uppercase by default; the toggle switches to lowercase.

Frequently asked questions

What is the largest number it supports?

Effectively unbounded. The tool uses JavaScript's BigInt, which has no fixed bit width — values with thousands of digits convert in milliseconds.

How are negative numbers handled?

A leading `-` in any base is preserved across conversions, so `-255` decimal is `-FF` hex and `-11111111` binary. Two's-complement representation (where -255 in 32-bit hex is `FFFFFF01`) is not applied — that requires fixing the bit width, which this tool does not do.

Can I convert fractional numbers?

No. The tool is integer-only by design. Floating-point base conversion is ambiguous (terminating in one base, repeating in another) and rarely the right answer for the contexts where developers reach for a base converter.

Does it accept a `0x` or `0b` prefix?

Yes — `0x` for hex and `0b` for binary are recognised on input and stripped automatically, so you can paste a value straight from source code.