UnitConv
Number Base

Number Base Converter

Convert between binary, octal, decimal, and hexadecimal with real-time bit pattern visualization

Input

IEEE 754 Floating Point

About this tool

The number base converter is a free tool for developers and students that converts between binary, octal, decimal, and hexadecimal in real time. It also visualizes the bit pattern, the two's-complement representation, and even the internal IEEE 754 layout of floating-point numbers. It is ideal for learning programming, debugging bit operations, reading color codes or memory addresses, and preparing for computer-science exams where you need to understand how machines store numbers.

How to use

  1. 1 Select the base of your input number (binary, octal, decimal, or hex).
  2. 2 Type the value into the input field (hexadecimal also accepts A-F).
  3. 3 Conversions to every base appear together, along with the bit pattern and two's complement.
  4. 4 To inspect a decimal's IEEE 754 form, enter it in the floating-point field.

How it works

A number base tells you how many digits represent a single place. Decimal uses ten digits (0-9), binary uses two (0 and 1), and hexadecimal uses sixteen (0-9 and A-F). Each place has a weight that is the base raised to 0, 1, 2, and so on from the right. For example, binary 1011 = 1x8 + 0x4 + 1x2 + 1x1 = 11. Hexadecimal FF = 15x16 + 15 = 255, which is the maximum value of one color channel in an RGB color. Computers work entirely in binary internally, so octal and hex are used as compact, human-readable shorthand. Negative numbers are stored as two's complement, and decimals are encoded in IEEE 754 form, split into a sign, an exponent, and a mantissa.

Frequently asked questions

Why is hexadecimal used so often in programming?

Because four binary digits map exactly to one hex digit, hex lets you write long binary values compactly and read them easily. It is common in color codes and memory addresses.

What is two's complement?

It is a way to represent negative numbers by inverting every bit and adding one. This lets a single adder circuit perform subtraction too, keeping hardware simple.

Why does hexadecimal FF equal 255?

F represents 15 in decimal, and the second digit has a weight of 16, so FF = 15x16 + 15 = 255, the largest value that fits in eight bits.

What are the sign, exponent, and mantissa in IEEE 754?

The sign gives positive or negative, the exponent scales the magnitude, and the mantissa holds the significant digits. Together they approximate a real number in binary.

Related tools and uses

Hexadecimal is closely tied to the color code converter. For character codes, see the ASCII converter, and for bit widths and data sizes, try the data-storage unit converter as well.