Binary/Hex/Decimal Converter
Convert a decimal number into its binary, octal, and hexadecimal representations. Includes bit count, byte size, and ASCII character lookup.
Computers store every number using the binary (base-2) system, but binary strings get long and hard to read quickly, so programmers commonly translate them into octal (base-8) or hexadecimal (base-16) for shorthand -- both are convenient because 8 and 16 are powers of 2, so each octal digit maps cleanly to exactly 3 binary bits and each hex digit maps cleanly to exactly 4. This calculator takes a decimal number and converts it into all four representations at once: binary (grouped in 4-bit nibbles for readability), octal, decimal, and hexadecimal (using standard 0-9, A-F digits). It also reports the number of bits required to represent the value and the number of bytes that rounds up to, since real storage is always allocated in whole bytes. If the value falls in the printable ASCII range (32-126), the calculator shows the corresponding character -- useful for character-encoding work, since ASCII assigns each printable character (letters, digits, punctuation) a specific decimal code in that range. It also flags whether the number is an exact power of 2, a property that matters constantly in computing because memory sizes, buffer allocations, and network addressing are frequently sized to powers of 2 for alignment and efficiency reasons.
Convert
Results
How to Use This Calculator
- Enter the decimal Input Number (e.g., 255) — the calculator converts from base 10.
- Read the Binary output grouped in nibbles (4-bit groups) for easy reading — useful for bit-masking.
- Check the Hexadecimal output (0x prefix) for use in color codes, memory addresses, and protocols.
- Review Bits and Bytes to understand the storage size required for the value.
- The ASCII Character field shows the printable character for that code point (useful for character encoding work).
What each input means
- Input Number (decimal)
- Enter a decimal number to convert.
How this is calculated
Formula
Decimal to binary: divide by 2, track remainders. Hex uses base-16 (0-9, A-F). Octal uses base-8 (0-7).Worked example, using the default values
- Identify Input ParametersInput Number (decimal) = 255 = 1 input(s) provided
- Calculate BinaryBinary = paddedBinary1111 1111 = 1111 1111
- Calculate OctalOctal = `0o${octal0o377 = 0o377
- Calculate DecimalDecimal = `0x${hex255 = 255
Engine last updated . Checked against 2 independently-derived tests — how we verify calculators.
Frequently Asked Questions
Why does the binary output group digits into blocks of 4?
Grouping binary digits into 4-bit nibbles makes long binary strings much easier to read and matches how each nibble corresponds to exactly one hexadecimal digit. This is a standard convention in computing documentation and hardware datasheets, not something specific to this calculator.
How many bits are needed to represent a given decimal number?
The bit count grows with the size of the number -- as the decimal value increases, the number of bits required to represent it in binary increases as well (though not for every single increment, since a fixed bit count can represent a whole range of values before the next bit becomes necessary). Larger input values never need fewer bits than smaller ones.
Why does the ASCII character field sometimes show 'N/A'?
Only decimal values from 32 to 126 correspond to printable ASCII characters (letters, digits, punctuation, and space). Values outside that range are either non-printable control codes (0-31, 127) or fall beyond the standard 7-bit ASCII table entirely, so the calculator reports "N/A" rather than an invalid or misleading character.
What makes a number a 'power of 2' in this calculator's check?
A power of 2 is any value produced by repeatedly doubling from 1 (1, 2, 4, 8, 16, 32, and so on) -- in binary, these numbers always have exactly one bit set to 1. Powers of 2 matter in computing because memory addressing, buffer sizes, and data structures are frequently chosen to align with them for efficiency.
Related Calculators
The questions that sit next to this one — chosen by subject, including calculators filed under a different category.
Password Strength Calculator
Check how strong your password could be based on length and character types. See estimated time to crack.
Technology & ComputingDownload Time Calculator
Calculate how long it takes to download a file at various internet speeds. Compare download times across different connection speeds.
Technology & ComputingNumber Converter Suite
Convert binary, hex, decimal, colors, ASCII, and signed integers.
Number TheoryNumber Base Converter
Convert numbers between any base (2-36). Enter a number in one base and convert to another.
Math & StatisticsUltimate Calculator
Scientific calculator, graphing, and unit conversions — all in one.
More in Technology & Computing.