Number Base Converter
Convert between binary, octal, decimal and hexadecimal instantly. Supports digit grouping, 8/16/32-bit padding, two's complement, and signed integers. Free, no signup.
Number Base Converter Tool
Negative value detected. Enable Signed decimal above to see two's complement binary output. Octal and hex do not display negative values in this tool.
How to Use the Number Base Converter
Type in any field
Enter a binary, octal, decimal or hex value into any of the four input fields — all other fields update instantly as you type. Binary accepts 0s and 1s; hex auto-capitalises to A–F.
Toggle digit grouping
Enable Group digits to format binary output in groups of 4 with spaces (e.g. 0101 1010) and hex in groups of 2, making long values much easier to read.
Select bit length
Choose 8, 16 or 32-bit to pad the binary output with leading zeros — useful when working with fixed-width registers, memory addresses, or protocol fields. Auto shows the minimum required bits.
Use the Copy button
Click the Copy button beside any field to send that value to your clipboard — ready to paste directly into your code, terminal, or documentation.
Number Systems in Computing — Why Computers Don't Think in Tens
Why Computers Think in Binary
At its most fundamental level, every computer is a collection of billions of tiny switches called transistors. Each transistor has exactly two states: on or off, conducting or not conducting, representing 1 or 0. This is why binary — the base-2 number system — is the native language of all digital electronics. Unlike humans who evolved with ten fingers and naturally count in base 10, electronic circuits are built around the simplest possible distinction: current flows, or it doesn't.
The mathematics underlying binary computation traces back to Gottfried Wilhelm Leibniz in the 17th century, who described a binary arithmetic system, and later to George Boole, whose Boolean algebra (AND, OR, NOT) gave engineers a formal language to describe logical circuits. By the mid-20th century, John von Neumann and his contemporaries formalised the stored-program computer — a machine where both instructions and data live in the same binary-encoded memory.
Eight bits grouped together form a byte, capable of holding 256 distinct values (0 to 255). This is why file sizes, memory capacities, and network speeds are measured in bytes, kilobytes, megabytes, and so on. Modern CPUs are 64-bit, meaning they process 64 binary digits at a time — allowing them to address over 18 quintillion individual memory locations in a single clock cycle.
Singapore's Smart Nation initiative provides a vivid real-world illustration: the EZ-Link contactless transit card stores your account balance in binary on an RFID chip; the SingPass digital identity system authenticates you using cryptographic keys that are themselves long binary numbers; and every byte of data flowing through the National Digital Identity platform travels as electrical pulses representing 1s and 0s. Binary is not an abstract concept — it is the invisible infrastructure of modern life.
Hexadecimal: The Programmer's Shorthand
Reading raw binary quickly becomes impractical. A 32-bit memory address in binary is 32 characters long — unwieldy to read, type, or verify. Hexadecimal (base 16) solves this elegantly: because 16 is exactly 2 to the power of 4, one hex digit maps perfectly onto four binary digits (a nibble). A 32-bit address shrinks from 32 binary digits to just 8 hex digits.
Programmers encounter hex constantly. RGB colour codes in CSS and design tools use
hex: the RECATOOLS accent colour #E8622A encodes red=232 (0xE8),
green=98 (0x62), blue=42 (0x2A). MAC addresses on your Wi-Fi adapter look like
AA:BB:CC:DD:EE:FF — six pairs of hex bytes identifying your network
interface. URL-encoded characters use hex: the space character becomes %20
because 0x20 is 32 in decimal, which is the ASCII code for space. When debugging at
the byte level — reading memory dumps, packet captures, or binary file headers —
hex is the universal language of low-level programming.
"Every image, video, document and website you've ever seen is ultimately stored as billions of 1s and 0s — binary is the language of all modern computing."
How Base Conversion Works Step by Step
Converting decimal to binary uses repeated division: divide the number by 2, record the
remainder (0 or 1), divide the quotient by 2 again, and continue until the quotient
is zero. Reading the remainders from bottom to top gives the binary representation.
For example, 13 ÷ 2 = 6 R1, 6 ÷ 2 = 3 R0, 3 ÷ 2 = 1 R1, 1 ÷ 2 = 0 R1 →
binary 1101.
Converting binary to decimal uses positional notation: each bit position carries a
power of 2, with the rightmost bit representing 2⁰ = 1. So
11111111 = 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255.
Hex to binary is even simpler: each hex digit maps directly to a four-bit group
(a nibble). F = 1111, A = 1010, so FA = 1111 1010
— no arithmetic required, just a lookup table.
Octal (base 8) was widely used in early Unix systems and remains relevant today:
Unix file permissions are expressed in octal. The familiar chmod 755
means owner has rwx (4+2+1=7), group has r-x (4+0+1=5), others have r-x (5) —
expressed in binary as 111 101 101. Each octal digit maps to exactly
three binary digits, making octal a natural fit for permission triplets.
IPv4 addresses like 192.168.1.1 are human-readable decimal representations of
32-bit binary numbers, where each of the four octets (0–255) corresponds to
one byte of the address.
Negative numbers in binary use two's complement — the standard representation in virtually all modern CPUs. To negate a number: flip all bits, then add 1. For an 8-bit signed integer, the range is −128 to +127. The Year 2038 problem arises because Unix timestamps are stored as 32-bit signed integers and will overflow on 19 January 2038 at 03:14:07 UTC — a direct consequence of fixed-width binary arithmetic and a reminder that number systems have real engineering consequences.
10 Facts About Number Systems in Computing
Binary (base 2) is the foundation of all digital computing — modern CPUs process billions of binary operations per second using transistors as on/off switches.
A byte consists of 8 bits and can represent 256 different values (0–255) — the fundamental unit of digital storage and the basis for file sizes, memory, and network speeds.
Hexadecimal (base 16) uses letters A through F for values 10–15, making it perfectly aligned with 4-bit nibbles — one hex digit equals exactly four binary digits.
The octal system (base 8) was widely used in early computing — Unix file permissions still use octal today: chmod 777 means rwxrwxrwx (all permissions enabled).
IPv4 addresses like 192.168.1.1 are 32-bit binary numbers written in "dotted decimal" — each of the four segments represents one byte (0–255) of the binary address.
The RGB colour #FFFFFF is hexadecimal for red=255, green=255, blue=255 — pure white results when all three channels are at maximum 8-bit intensity simultaneously.
Two's complement lets computers represent negative numbers in binary — to negate a value, flip all bits then add 1. This system enables subtraction using addition circuits alone.
The maximum value of a 32-bit unsigned integer is 4,294,967,295 — relevant to engineers dealing with system timestamps, game scores, network packet counters, and IPv4 address spaces.
Unicode, the standard encoding for all human languages including Chinese, Malay, and Tamil used in Singapore's multilingual digital systems, assigns code points written in hexadecimal.
The Year 2038 problem: Unix timestamps stored as 32-bit signed integers will overflow on 19 January 2038 — a real binary arithmetic issue analogous to the Y2K bug but harder to patch.
Frequently Asked Questions
-
Type your decimal number into the Decimal (green) field and the binary result appears instantly. Manually, divide the number by 2 repeatedly and read the remainders from bottom to top: 13 ÷ 2 = 6 R1, 6 ÷ 2 = 3 R0, 3 ÷ 2 = 1 R1, 1 ÷ 2 = 0 R1 → binary 1101. Enable Group digits to format the result in groups of 4 for easy reading.
-
Hexadecimal (base 16) uses digits 0–9 and letters A–F (for values 10–15). Programmers prefer it because one hex digit maps exactly to 4 binary digits (a nibble), making large binary values far more compact. A 32-bit address that requires 32 binary digits needs only 8 hex digits. Hex appears everywhere in programming: memory addresses, RGB colours (
#E8622A), MAC addresses, and URL encoding (%20for space). -
A byte is exactly 8 bits. This means one byte can hold 2⁸ = 256 different values (0 to 255). All digital storage — from SSD capacity to RAM size to network bandwidth — is measured in bytes or multiples thereof (kilobytes, megabytes, gigabytes). Select the 8-bit button in this converter to see binary output padded to exactly one byte.
-
Two's complement is the standard method for representing negative integers in binary. To negate a number: flip all its bits (one's complement), then add 1. For example, +5 in 8-bit binary is
00000101. Flip all bits:11111010. Add 1:11111011= −5. This system lets CPUs subtract using the same addition circuits, and ensures only one representation of zero. Enable Signed decimal in this converter and enter a negative number to see its two's complement binary form. -
Unix permissions have three groups (owner, group, others), each with three bits (read, write, execute) — totalling 9 bits. Since one octal digit represents exactly 3 binary digits, three octal digits perfectly encode all nine permission bits.
chmod 755means 7=111 (rwx), 5=101 (r-x), 5=101 (r-x) — the owner can read, write and execute; group and others can read and execute only. -
A hex colour like
#E8622Ais three two-digit hex values: E8 = red, 62 = green, 2A = blue. Enter each pair into the Hex field of this converter to get the decimal values: E8 = 232, 62 = 98, 2A = 42. So#E8622A= RGB(232, 98, 42) — the RECATOOLS coral orange. For a full colour conversion including HSL and CMYK, try the RECATOOLS Color Converter. -
A 32-bit unsigned integer can hold values from 0 to 4,294,967,295 (2³² − 1). A 32-bit signed integer (using two's complement) ranges from −2,147,483,648 to +2,147,483,647. Select 32-bit in this converter and enter 4294967295 to see it in all four bases. The signed limit is why Unix timestamps (stored as 32-bit signed integers) will overflow in 2038.
-
Unix systems count time as the number of seconds since 1 January 1970 (the Unix epoch), stored as a 32-bit signed integer. The maximum value of a 32-bit signed integer is 2,147,483,647 — which corresponds to 03:14:07 UTC on 19 January 2038. After that moment, the counter overflows to a large negative number, potentially causing systems that haven't migrated to 64-bit timestamps to malfunction. This is directly analogous to the Y2K issue but in binary arithmetic.
-
This converter uses JavaScript's native
BigInttype, which supports arbitrarily large integers with no precision loss — unlike standard floating-point numbers, which lose accuracy above 2⁵³. You can safely enter values well beyond 32-bit or 64-bit limits and receive exact conversions across all four bases. All conversions happen locally in your browser; no data is sent to any server. -
Valid hexadecimal characters are the digits 0–9 and the letters A through F (or a–f in lowercase). This gives 16 possible values per digit position: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A (=10), B (=11), C (=12), D (=13), E (=14), F (=15). This converter auto-converts lowercase input to uppercase. The letters G–Z and any special characters are not valid hex and will trigger an error message showing which character is invalid.
Related News
You may be interested in these recent stories from our newsroom.
-
NEXTDC Opens Peninsular Malaysia's First Tier IV Data Centre with RM2.8 Billion KL1 Launch in Petaling Jaya
NEXTDC officially opened KL1 in Petaling Jaya on 14 May 2026 — an AUD$1 billion facility that holds Peninsular Malaysia's first Uptime Insti...
-
Indonesia's INA Locks In 30% Annual Allocation for AI and Data Centre Infrastructure
Indonesia's sovereign wealth fund INA has formalised a 30% annual cap on digital sector deployment, anchored by a joint venture with Singapo...
-
Microsoft Build 2026: Project Polaris Cuts Copilot's OpenAI Dependency, Copilot Workspace Ships to GA
Microsoft confirmed at Build 2026 in San Francisco that GitHub Copilot will run on Project Polaris — its own mixture-of-experts coding model...
75 more free tools
Calculators, converters, security tools — no signup.