Number Base Converter
Convert numbers between binary, decimal, hexadecimal, octal, and any custom base — with bit grouping, signed integers, and step-by-step explanation.
Last updated: March 25, 2026
Used 22K+ timesWhat users say
“The hex-to-RGB breakdown for CSS colors is a feature I use constantly. The bit-grouping display for binary makes reading hardware register values so much faster.”
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is Number Base Converter?
A number base (or radix) defines how many unique digits are used to represent numbers. The familiar decimal system uses base 10 (digits 0–9). Computers internally work exclusively in binary (base 2, digits 0–1) because electronic transistors have exactly two states: on/off. Hexadecimal (base 16, digits 0–9 and A–F) is a compact shorthand for binary — exactly 4 binary bits map to one hex digit, making memory addresses, color codes, and byte values much shorter to write and read.
Octal (base 8, digits 0–7) was historically used in early Unix file permissions (chmod 755) and is still encountered in legacy systems. Understanding number bases is fundamental to reading memory dumps, working with bitwise operations, CSS color codes (#RRGGBB hex), network IP addressing (binary subnet masks), and low-level systems programming. This converter handles all standard bases (2, 8, 10, 16) and any custom base from 2 to 36, with optional 2's complement signed integer representation.
How to Use Number Base Converter
Type a number into any of the four fields (Binary, Octal, Decimal, or Hexadecimal)
All other base representations update instantly as you type — no manual conversion needed
Toggle "Show Bit Groups" to display binary numbers in 4-bit nibble groups (e.g., 1010 1111) or 8-bit byte groups for easier reading
Toggle "Signed Integer" to see the 2's complement representation for the selected bit width (8-bit, 16-bit, 32-bit)
Click "Step-by-Step" to see the full mathematical conversion process explained with each multiplication/division step
Common Use Cases
- Converting CSS hex color codes (#1E90FF) to RGB decimal channel values (30, 144, 255) for programmatic manipulation
- Understanding Unix file permissions: chmod 755 in octal = 111 101 101 in binary = rwx r-x r-x
- Reading memory dump output in hex — converting addresses like 0x7FFE8000 to decimal for comparison
- Debugging bitwise operations: checking what 0b10110011 & 0b11110000 equals in decimal
- Converting network subnet masks: 255.255.255.0 = 11111111.11111111.11111111.00000000 (/24)
- Working with Arduino/embedded systems where hardware registers are documented in binary bit fields
- Converting ASCII character codes (decimal) to their hex representation for HTTP encoding or URL encoding
- Understanding 2's complement negative numbers: how -1 is stored as 0xFF in an 8-bit signed integer
Example Input and Output
Converting the hex color code for "Dodger Blue" to all bases:
Hex input: 1E90FF
(CSS color: #1E90FF — Dodger Blue)Decimal: 1,610,751
Binary: 0001 1110 1001 0000 1111 1111
Octal: 6110377
Hexadecimal: 1E90FF
Breakdown for CSS RGB:
R: 1E hex = 30 decimal
G: 90 hex = 144 decimal
B: FF hex = 255 decimal
→ rgb(30, 144, 255)How This Tool Works
User input in any base field is parsed using parseInt(input, currentBase). The resulting JavaScript Number is converted to all other bases using .toString(targetBase). For binary "bit group" display, the binary string is zero-padded to the next multiple of 4 or 8, then split into groups with spaces. For the step-by-step view, the repeated-division algorithm is simulated step by step and each step's quotient and remainder are rendered as an explanation list.
Technical Stack
Client-Side Processing
All base conversions run in your browser using JavaScript's built-in parseInt() and Number.prototype.toString(). No data is sent to our servers.
JavaScript Built-in Conversion
JavaScript parseInt(string, radix) parses any base: parseInt("FF", 16) = 255, parseInt("1010", 2) = 10, parseInt("17", 8) = 15. Number.prototype.toString(radix) converts to any base: (255).toString(16) = "ff", (10).toString(2) = "1010". BigInt handles numbers beyond Number.MAX_SAFE_INTEGER (2^53): BigInt("0x1FFFFFFFFFFFFF").toString(10) for large conversions.
Bit Width and Overflow
When working with specific hardware registers or data types, bit width matters. An 8-bit unsigned value maximum is 255. If you convert 256 to 8-bit binary, you overflow: 256 mod 256 = 0. Use the "Bit Width" selector to see how a value wraps at 8, 16, 32, or 64 bits — critical for understanding overflow bugs in C, Rust, or assembly code.

