Przejdź do treści
Liczbnik
Current for 2026Methodology

Number base converter

Enter a number and select its input base (binary, octal, decimal or hexadecimal). The calculator instantly converts the value to all four number systems. An essential tool for developers, computer science and electronics students.

Na tej stronie

How we convert number bases

Each digit in base b represents a power of b. To convert to decimal: sum each digit × b^position. To convert from decimal: divide repeatedly by the target base and read the remainders from last to first. The calculator uses JavaScript's parseInt and toString methods.

Example calculation

Decimal 255: input base = 10, value = 255. Results: binary = 11111111, octal = 377, hexadecimal = FF. Enter FF with base 16 to get the same values in reverse.

Frequently asked questions

What is a number system?

A number system is a set of symbols and rules for writing numbers. The most common is decimal (base 10). Binary (2), octal (8) and hexadecimal (16) are widely used in computing.

How does binary work?

Binary uses only 0 and 1. Each position represents a power of 2 (from right: 2⁰, 2¹, 2², …). Example: 1010₂ = 0×1 + 1×2 + 0×4 + 1×8 = 10.

What is hexadecimal used for?

Hex uses digits 0–9 and letters A–F (A=10 … F=15). One byte (8 bits) = exactly two hex digits, so hex gives a compact way to write binary data. Example: 255₁₀ = FF₁₆.

To convert any base to decimal: multiply each digit by the corresponding power of the base and sum. To convert decimal to another base: divide repeatedly by the target base and collect remainders.

Octal (base 8) uses digits 0–7. Each octal digit equals exactly 3 binary bits. Example: 377₈ = 011 111 111₂ = 255₁₀.

Divide the decimal number by 2 and record remainders. Read remainders from last to first. Example: 13 → 1101₂.

A byte is 8 bits (binary digits) and stores values 0–255 (00000000₂ to 11111111₂), equivalent to two hex digits (00₁₆ to FF₁₆).

#RRGGBB encodes red, green and blue components as pairs of hex digits (00–FF, i.e. 0–255 decimal). Example: #FF0000 = pure red.

Electronic components (transistors) have two stable states: on (1) and off (0). Binary representation is noise-resistant and supports logical and arithmetic operations with simple circuits.

In memory addresses (hex), bitmasks and flags (bin/hex), colour coding (hex), network protocols (MAC and IP addresses in hex), microcontroller programming and binary data debugging.

Results are indicative. The calculator handles integers — fractional numbers may produce imprecise results.

  • GCD and LCM Calculator

    Calculate GCD (greatest common divisor) and LCM (least common multiple) of two numbers. Free online calculator.