Unit Converter

Free Binary, Hex & Decimal Converter

Convert between binary, octal, decimal and hexadecimal with live sync. Type in any base and all others update instantly. Includes bit-level display and 8/16/32/64-bit range indicators.

Live sync 100% offline BigInt precision Bit view

Convert

BIN Binary
0 1
0b
OCT Octal
0 – 7
0o
DEC Decimal
0 – 9
HEX Hexadecimal
0 – 9 A – F
0x
Options
Quick values

Bit view

Binary representation
0
Bit length
1
Bytes
1
Digits (hex)
1
8 / 16 / 32 / 64-bit ranges
Type Range Fits
Tip: Type in any base — the other three update automatically. Prefixes like 0x, 0b, 0o are accepted. Values use BigInt, so precision stays exact even for 64-bit and larger numbers.

About Number Bases

A number base (or radix) tells you how many distinct digits a counting system uses before it rolls over to a new column. The familiar decimal system uses base 10 — ten digits, 0 through 9. Computers work with base 2 because electronic switches have two states. Hexadecimal (base 16) and octal (base 8) are compact shorthand for binary: one hex digit represents exactly 4 binary bits, and one octal digit represents 3.

The four bases

BaseNameDigitsPrefixUsed by
2Binary0 10bLogic gates, CPU instructions
8Octal0–70oUnix file permissions, legacy systems
10Decimal0–9(none)Everyday arithmetic
16Hexadecimal0–9 A–F0xMemory addresses, colours, byte dumps

Small numbers across bases

DecimalBinaryOctalHex
0000
1111
410044
81000108
10101012A
15111117F
16100002010
25511111111377FF
256100000000400100
1024100000000002000400
655351111111111111111177777FFFF

Common integer ranges

TypeBitsUnsigned rangeSigned range
Byte80 to 255−128 to 127
Short160 to 65,535−32,768 to 32,767
Int320 to 4,294,967,295−2,147,483,648 to 2,147,483,647
Long640 to 18,446,744,073,709,551,615−9,223,372,036,854,775,808 to 9,223,372,036,854,775,807

Why hexadecimal

Hex is popular because 4 binary bits map cleanly to 1 hex digit. A byte (8 bits) is exactly 2 hex digits — 11111111 becomes FF. That makes hex far more readable than raw binary while remaining trivially convertible. When you see #FF5733 as a colour, that is three bytes (red, green, blue) written as 6 hex digits. When you see a memory address like 0x7FFF5FBFF8C0, that is 8 bytes in hex — a 64-bit pointer.

Why octal still matters

Octal remains common in Unix because file permissions are traditionally written as three or four octal digits. chmod 755 means: owner gets read+write+execute (4+2+1=7), group gets read+execute (4+1=5), others get read+execute (4+1=5). Each octal digit encodes 3 permission bits (rwx). It is a compact and still-relevant notation.

Two's complement for negative numbers

Computers represent negative integers using two's complement: the most significant bit (MSB) is the sign bit, 0 for positive and 1 for negative. To negate a number, invert all bits and add 1. This tool shows the magnitude of negative numbers in the standard way (with a minus sign), not as two's complement bit patterns — that is a different, though related, representation worth knowing about.

Common use cases

Colour Codes

Convert RGB decimal values to hex for CSS colours.

Embedded Systems

Read register values, bitmasks and hardware addresses.

Unix Permissions

Convert chmod octal permissions to readable bits.

Debugging

Interpret hex dumps and memory addresses.

Networking

Convert IP addresses, MAC addresses and subnets.

Education

Learn how binary, octal and hex relate to each other.

Privacy and accuracy

This binary/hex/decimal converter runs entirely in your browser using the native BigInt type. Numbers are handled with full arbitrary precision, so a 100-digit decimal converts to hex without any loss. Nothing is uploaded, stored or logged.

Frequently Asked Questions

How do I convert binary to decimal?
Each binary digit represents a power of 2 based on its position from the right. So 1010 = (1×8) + (0×4) + (1×2) + (0×1) = 8 + 2 = 10. This tool does the conversion automatically — just type the binary value and the decimal appears instantly in the Decimal field.
How do I convert hex to decimal?
Each hex digit is worth a power of 16. So FF = (15×16) + (15×1) = 240 + 15 = 255. For longer values, keep multiplying by 16 for each position. Type the hex value into the Hex field and the decimal updates live.
Is this converter free?
Yes. It is 100% free, requires no sign-up, and runs entirely in your browser. No length limits, no watermarks, no premium tier.
Is my input sent to a server?
No. All conversions happen locally in JavaScript. Nothing is uploaded, stored or logged — safe for confidential values like cryptographic keys and licence numbers.
Does it handle very large numbers?
Yes. Values are parsed and formatted using JavaScript's BigInt type, which supports arbitrary precision. There is no 32-bit or 64-bit ceiling — a 500-digit decimal converts to hex without any loss of precision.
What is the 0x / 0b / 0o prefix for?
These are standard prefixes used in programming languages to disambiguate number literals. 0x means hexadecimal (e.g. 0xFF = 255), 0b means binary (e.g. 0b1010 = 10), 0o means octal (e.g. 0o755 = 493). The prefix is optional on input — this tool accepts both FF and 0xFF.
Can I convert negative numbers?
Yes. Prefix a value with a minus sign (e.g. -255) and the other bases will show the negative form too. The bit display shows the magnitude; two's complement representation is a separate notation and not shown here.
What is the maximum bit length shown?
The bit display pads to the next multiple of 8 bits (a byte boundary) up to any length. For very large numbers, the display wraps over multiple lines but the value stays exact. The 8/16/32/64-bit range table highlights which standard integer types can hold the value.
Why do hex digits use letters A to F?
Because hexadecimal needs 16 distinct symbols, but we only have 10 numeric digits (0–9). The letters A, B, C, D, E and F are used as single-digit symbols for the values 10, 11, 12, 13, 14 and 15 respectively. This is a universally adopted convention across programming languages.
How is octal used in file permissions?
Unix file permissions use three bits per class of user (owner, group, others), for a total of 9 bits. Each 3-bit group is exactly one octal digit 0–7, so permissions fit neatly into three octal digits. chmod 755 means owner has read+write+execute (4+2+1=7), group has read+execute (4+1=5), others have read+execute (4+1=5).

Related Converters

Done!