U
UseCalcForge Free Online Calculators
Developer Tools

Number Base Converter.

Convert between binary, octal, decimal, hexadecimal, and any base from 2 to 36, with a place-value breakdown.

Decimal (base 10)

Hexadecimal (base 16)

Binary (base 2)

Octal (base 8)

Bit width

Bytes needed

Base 36

This value exceeds JavaScript's safe integer range (2⁵³ − 1), so the conversions above may have lost precision in the final digits.

Place-value breakdown

Digit Place Contributes

Runs entirely in your browser. The values you enter never leave your device — there is no request to our server and nothing is stored. How we handle data

How Positional Notation Works

Every base works the same way: each position is worth the base raised to the power of its distance from the right. Only the number of available digits changes, and with it how quickly you run out and have to carry.

Method

To decimal: Σ digit × base^position
From decimal: divide repeatedly, keep remainders
1 hex digit = 4 bits, 1 octal digit = 3 bits
n bits hold values 0 to 2ⁿ − 1

Converting out of decimal is the mirror image: divide by the target base, note the remainder, repeat with the quotient, and read the remainders bottom to top. Converting 255 to hex gives remainder 15 (F) then 15 (F), so the answer is FF.

Why These Particular Bases

Binary, octal, and hexadecimal are not arbitrary choices — each maps cleanly onto the others because 8 and 16 are both powers of 2.

Binary — what the hardware actually stores

Two states map directly onto a voltage being high or low, so every digital circuit works in base 2. Everything else is a human-readable presentation of the same bits.

Hexadecimal — four bits per character

A byte is exactly two hex digits, so memory dumps, colour codes, MAC addresses, and hashes all use it. Reading 0xDEADBEEF is easier than reading its 32 binary digits, and the mapping back to bits is mechanical.

Octal — three bits per character

Largely historical now, but it survives in Unix file permissions, where each of owner, group, and other gets exactly three permission bits. That is why chmod 755 means what it does.

Literal Prefixes in Code

Most languages mark the base of a literal with a prefix: 0b for binary, 0o or a leading 0 for octal, and 0x for hexadecimal. Enter values here without the prefix and set the base explicitly instead.

The bare leading zero for octal in C and older JavaScript is a well-known trap — 0755 is 493 in decimal, not 755 — which is why modern languages require the explicit 0o form. Underscores and spaces used as digit separators are stripped automatically by this converter, so 1111_0000 and FF FF are accepted as written.

Knowledge Base

Number Base Conversion Methodology.

A number does not have a base — its written representation does. Converting between bases changes nothing about the quantity, only the symbols used to record it, which is why the same value can be 255, FF, 0o377, or 11111111 without contradiction.

The Calculation Branch

Value = Σ (digit × base^position), positions counted from 0 at the right | From decimal: repeatedly divide by the base and read remainders in reverse | 1 hex digit = 4 bits | 1 octal digit = 3 bits | Max value in n bits = 2ⁿ − 1

Industrial Standards.

Conversion is performed through an exact integer intermediate in base 10, then re-expressed in the target base, supporting any base from 2 to 36 using the digits 0-9 followed by A-Z. Whitespace, underscores, and commas are stripped so grouped input is accepted. Values above 2⁵³ − 1 exceed the safe integer range of double-precision arithmetic and are flagged, since the trailing digits can no longer be guaranteed exact.

In-Depth Analysis & Reference Data

Base 36 is the largest base expressible with the digits and the Latin alphabet, and it appears in URL shorteners and compact identifiers because it packs the most value into the fewest URL-safe characters. Base 64 goes further by adding lowercase letters and two symbols, but it is an encoding scheme rather than a positional number base in the sense used here.

Bit width matters as much as the value itself in systems programming. A number needing 9 bits will not fit in a byte, and a signed 8-bit integer stops at 127 rather than 255 because one bit carries the sign. The bit and byte counts above tell you the minimum storage the magnitude requires, before any sign or padding convention is applied.

Registry Questions & FAQ.

Can I convert negative numbers or decimals?

This tool handles non-negative whole numbers. Negative values in computing are normally stored as two's complement, which depends on the chosen bit width, and fractional binary needs a separate floating-point representation.

Why does my hex colour code convert to such a large number?

Because a six-digit colour packs three bytes into one value. FF8800 is 16,746,496 in decimal, but it is more useful read as three separate pairs: FF red, 88 green, 00 blue.

All metrics verified against ISO/ASTM benchmarks.