Skip to main content
SiteIndex
DeveloperReady to use

Number Base Converter

Convert non-negative integers between binary, decimal, and hexadecimal.

Guide

Interactive workspace

No account required
Number Base Converter

Binary (base 2)

11111111

Octal (base 8)

377

Decimal (base 10)

255

Hexadecimal (base 16)

FF

Base 10 → base 2: 11111111

112816413211618141211
Step-by-step conversion

Positional expansion in base 10: 2×10^2 + 5×10^1 + 5×10^0 = 255

Decimal to base 2, divide by the target base and read remainders from bottom to top:

  1. 255 ÷ 2 = 127 remainder 1
  2. 127 ÷ 2 = 63 remainder 1
  3. 63 ÷ 2 = 31 remainder 1
  4. 31 ÷ 2 = 15 remainder 1
  5. 15 ÷ 2 = 7 remainder 1
  6. 7 ÷ 2 = 3 remainder 1
  7. 3 ÷ 2 = 1 remainder 1
  8. 1 ÷ 2 = 0 remainder 1
Batch convert

Convert a list of numbers in the selected input base, one value per line.

Quick reference (0–255)

DecimalBinaryHexOctal
0000
81000810
101010A12
16100001020
25511111111FF377

Hex is useful for compact byte values and memory addresses. Octal is used in Unix permissions (for example, 755). Binary can be grouped into fours to convert to hexadecimal.

Common questions: Base 16 uses digits 0–9 and A–F. Octal 755 represents file permissions. Prefixes 0b, 0o and 0x select binary, octal and hexadecimal automatically.

How to use it

  1. Enter a non-negative integer in the source base.
  2. Choose From base 2, 10, or 16.
  3. Choose the destination base and review any validation error.
What is Number Base Converter?

Convert non-negative integers between binary, decimal, and hexadecimal.

How it works

SiteIndex converts a single number between binary, decimal, and hexadecimal. The Advanced panel converts a whole list of numbers in the same base at once.

Common number base conversions

Examples use decimal, binary, hexadecimal, and octal.

Common number base conversions
DecimalBinaryHexadecimalOctal
0000
81000810
101010A12
16100001020
25511111111FF377

Base 16 is a compact way to write byte values and memory addresses. Unix file permissions use octal; 755 is a common permission value. To convert binary to hexadecimal, group binary digits in sets of four and map each group to one hex digit. Prefixes 0b, 0o, and 0x indicate binary, octal, and hexadecimal input.

Common uses
  • Convert a single value while debugging code.
  • Convert a list of memory addresses or byte values in bulk.
  • Check a hexadecimal value's decimal equivalent quickly.
Limitations
  • Integers must fit JavaScript's safe integer range; negative, fractional, and arbitrary-precision values are unsupported.
Frequently asked questions
Does this support negative numbers?
No, only non-negative integers are supported in both single and batch modes.
What is hexadecimal used for?
Hexadecimal (base 16) compactly represents binary data, byte values, and memory addresses. One hex digit represents four binary bits.
Why do programmers use octal for chmod permissions?
Each octal digit represents three permission bits. For example, chmod 755 means owner read/write/execute and group/other read/execute.
How do I convert binary to hexadecimal quickly?
Starting from the right, group binary digits into sets of four and convert each group to one hexadecimal digit. Pad the leftmost group with zeros if needed.

Related tools