inyourbrowser.com

Decimal to binary converter

Enter a decimal number to instantly convert it to binary (base 2). The output also shows hex and octal representations for a complete picture.

BIN–
OCT–
DEC–
HEX–

INPUT BASE

All bases shown simultaneously.

Runs entirely in your browser

Worked example

Divide by 2 and keep the remainders: 45 gives 1, 0, 1, 1, 0, 1. Read them from last to first: 101101.

How it works

The input is checked digit by digit and turned into a JavaScript BigInt, then written out with BigInt.prototype.toString(base), so large values stay exact. All four bases are computed simultaneously from the same input value, so you can see binary, octal, decimal, and hex at a glance.

Processing runs in your browser

All conversion runs in your browser tab. Our servers are not involved at any point.

Related operations

For converting between data sizes like KB and MB, try the byte converter. To compute MD5 or SHA hashes from values, use the hash generator. For working with file permission bits, see the chmod calculator.

Frequently asked questions

Why is binary important in computing?
Computers operate on binary because electronic circuits naturally have two states, on (1) and off (0). Understanding binary is fundamental to low-level programming, networking, and hardware.
How many binary digits does a decimal number need?
The number of bits needed is ⌈log₂(n + 1)⌉. For example, decimal 255 needs 8 bits (11111111), and 256 needs 9 bits (100000000).
How do I convert decimal to binary by hand?
Divide by 2 repeatedly and read the remainders from last to first. 45 leaves 1, 0, 1, 1, 0, 1, so it is 101101.
Is the binary output padded to 8 or 32 bits?
The output has no leading zeros: 5 shows as 101, not 00000101. Pad it to the width your byte or register needs.

Last reviewed September 30, 2026

Other pages for this tool

Related tools

Byte converter
Convert between bytes, KB, MB, GB and TB in both decimal (SI) and binary (IEC) units.
Chmod calculator
Click permission bits to get the numeric (755) and symbolic (rwxr-xr-x) notation instantly.
CIDR / subnet calculator
Calculate network address, broadcast, host range and usable hosts from any CIDR block.
Color converter
Convert HEX, RGB, and HSL color values instantly. Live preview swatch included.
Roman numeral converter
Convert between Roman numerals and Arabic numbers. Supports 1 to 3,999.