SimplyCalculated.org

Number Base Converter

Type a number in any base from 2 to 36 and see the same value instantly in binary, octal, decimal, and hexadecimal — with negative numbers and fractions fully supported.

100% private: everything is processed in your browser's memory — nothing you enter is uploaded to a server, logged, or stored.

Number Base Converter

Digits 0–9 then A–Z are valid up to base 36. Lowercase letters and a leading minus sign are accepted, and fractional numbers convert up to 12 decimal places.

Binary (Base 2)

11111111

Octal (Base 8)

377

Decimal (Base 10)

255

Hexadecimal (Base 16)

FF

How Base Conversion Works

Every number system you will meet is a place-value system: the value of a digit depends on where it sits in the numeral. In decimal, the number 255 really means 2 × 100 + 5 × 10 + 5 × 1 — that is, 2 × 10² + 5 × 10¹ + 5 × 10⁰. The base of a number system is simply the number that each position is multiplied by. Replace the 10s with 2s and you get binary; with 16s, hexadecimal. The largest digit available is always one less than the base: base 10's biggest digit is 9, base 2's is 1, and base 16's is F, or 15 (because we run out of digits after 9 and borrow letters). Bases beyond 16 keep borrowing letters all the way to Z, which is digit 35 in base 36.

Base Name Digits Example
2 Binary 0 1 11111111 = 255
8 Octal 0–7 377 = 255
10 Decimal 0–9 255
16 Hexadecimal 0–9 A–F FF = 255

Converting in the direction you already understand is easy: to read a numeral written in another base, expand it into its place values and add them up. Converting the other way — writing a decimal number in a new base — uses the opposite operation: repeatedly divide by the target base and collect the remainders from last to first. The calculator implements both directions under the hood, using whatever base you select as the input and always producing binary, octal, decimal, and hexadecimal as output.

Once a base exceeds ten, letters enter the digit set: A is ten, B is eleven, and so on. Base 36 — the largest this converter accepts — uses all ten digits and all twenty-six letters, which is why it is the classic choice for compressing identifiers: a six-character base-36 string can represent about 2.2 billion distinct values. Most day-to-day work never strays past hexadecimal, but the ability to parse and produce any base 2–36 means the same tool covers binary puzzles, color math, and custom encoding schemes without modification.

Step-by-Step Worked Examples

These examples mirror the calculator's defaults, so you can follow along and confirm every digit.

  1. 255 decimal in binary, by repeated division: 255 ÷ 2 = 127 remainder 1; 127 ÷ 2 = 63 remainder 1; 63 ÷ 2 = 31 remainder 1; 31 ÷ 2 = 15 remainder 1; 15 ÷ 2 = 7 remainder 1; 7 ÷ 2 = 3 remainder 1; 3 ÷ 2 = 1 remainder 1; 1 ÷ 2 = 0 remainder 1. Reading the remainders upward gives 11111111 — eight ones, exactly what a byte of all-set bits looks like.
  2. 255 decimal in hexadecimal, faster: 255 ÷ 16 = 15 remainder 15. Fifteen is digit F, so the numeral is FF. This compactness is why hex is the shorthand of choice for bytes, color codes, and memory addresses.
  3. Reading hex back: FF in base 16. Expand the place values: F × 16¹ + F × 16⁰ = 15 × 16 + 15 × 1 = 240 + 15 = 255. Every base works this way — the rightmost position is always the base raised to the power zero, which is 1.
  4. Binary with a fraction: 1010.101 in base 2 expands to 1×8 + 0×4 + 1×2 + 0×1 + 1×0.5 + 0×0.25 + 1×0.125 = 10.625 decimal. Fractions are just negative powers of the base: the first place right of the point is base⁻¹, the second is base⁻², and so on.
  5. 42 decimal in binary, the non-obvious case: 42 ÷ 2 = 21 remainder 0; 21 ÷ 2 = 10 remainder 1; 10 ÷ 2 = 5 remainder 0; 5 ÷ 2 = 2 remainder 1; 2 ÷ 2 = 1 remainder 0; 1 ÷ 2 = 0 remainder 1. Read upward: 101010. Spot-check with place values: 32 + 8 + 2 = 42. The pattern of alternating ones and zeros is typical for numbers that are not powers of two.

The division algorithm works for any target base and any starting value — there is nothing special about 255. Enter any number, pick any input base, and the calculator performs the same expansion in reverse while converting to all four programming bases at once.

Where Base Conversion Shows Up in Real Life

Base conversion is not a classroom exercise — it appears constantly in code, configuration, and debugging. Hexadecimal is the default notation for memory addresses, Unicode code points, and the six-digit color codes in CSS (#FF8800 is a shade of orange). Octal survives in Unix chmod masks like 0755 and some legacy protocols. Binary is what the CPU actually sees, so bitwise operations and flags are usually reasoned about in binary or hex. Even outside programming, base conversion shows up in MAC addresses, IPv6 literals, and serial numbers. A converter that renders every common base at once lets you move between these notations without re-typing values and without the mental arithmetic that invites transcription errors.

Conversion & Reference Tables

Numbers 0–15 in All Four Bases

Decimal Binary Octal Hex
0000
1111
21022
31133
410044
510155
611066
711177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F

Powers of Two and Sixteen

Power 2ⁿ 16ⁿ In hex
0111
121610
24256100
3840961000
41665,53610000
5321,048,576100000
66416,777,2161000000
7128268,435,45610000000
82564,294,967,296100000000

Troubleshooting & Common Mistakes

Digits Outside the Selected Base

The most common error is typing a digit the chosen base cannot represent — a 2 in binary, an 8 in octal, or a G in hexadecimal. The converter flags these with a specific error message rather than guessing, because a single wrong digit changes the entire value. If you see "Invalid digit," check both the number and the selected base: the fix is usually deleting one character or switching the base dropdown.

Reading the Four Result Tiles

All four tiles always show the same underlying value — the input number rendered in each base. If the input base matches one of the four output bases, that tile naturally echoes your input; typing FF in base 16 shows FF in the hex tile and 255 in the decimal tile, so the relationship between the two notations is visible at a glance. The decimal tile is the one to check when you need a ground-truth number, and the binary tile when you need to inspect individual bits.

Leading Zeros Are Harmless

Inputs like 00001111 in binary are perfectly valid — the leading zeros contribute nothing and are dropped from the results. The same applies to decimal input like 0255. This also means results never carry leading zeros, so the binary output of 255 is 11111111, not 0000000011111111, even though the latter is how the value sits in a 16-bit register.

Fractions May Not Terminate

A fraction that terminates cleanly in one base can repeat forever in another — 1/10 decimal is an infinite pattern in binary, while 1/8 binary terminates instantly. The converter caps output at 12 fractional digits, so repeating values are truncated, not rounded. When exactness matters, use fractions whose denominator is a power of the target base, or accept the documented precision limit.

Very Large Numbers

  • Numbers up to roughly 9 quadrillion (2⁵³) convert exactly; beyond that, JavaScript's floating-point math limits precision.
  • Long binary results wrap onto multiple lines inside the result tiles rather than being cut off.
  • For typical programming values — bytes, colors, addresses — precision is never an issue.

Copy-Paste Formatting

Pasted text sometimes carries invisible formatting or a trailing newline. The converter trims surrounding whitespace automatically, so " FF " and "FF" parse identically — but a stray character like a comma or space in the middle of the number is still a real digit error in most bases. If a paste fails validation, look for a comma, an em dash, or a non-breaking space hiding between digits.

Frequently Asked Questions

How do I convert hex to binary quickly by hand?
Each hexadecimal digit maps to exactly four binary digits, so you can convert digit by digit: 0 → 0000, 1 → 0001, … 9 → 1001, A → 1010, B → 1011, C → 1100, D → 1101, E → 1110, F → 1111. For example, 7F becomes 0111 1111, or 1111111 once the leading zero is dropped. The reverse is just as easy: group the binary digits in fours from the right and translate each group to one hex digit.
What bases can this converter handle?
Any base from 2 to 36. Bases above 10 use the letters A–Z for digits, so base 16 (hexadecimal) uses A–F and base 36 — the largest supported — uses all ten digits plus all 26 letters. You choose the input base with the dropdown, and the result is always shown in the four programming bases: binary, octal, decimal, and hexadecimal.
Why does 0.1 in decimal become a long string in binary?
Because 0.1 is not a terminating binary fraction. Binary fractions can only represent sums of powers of one half, so 1/10 expands to the infinitely repeating pattern 0.0001100110011001… Our converter computes up to 12 fractional digits and stops, which is why 0.1 decimal shows as 0.000110011001 in binary. Fractions whose denominator is a power of two — like 0.5 or 0.25 — convert exactly.
Is the converter case-sensitive?
No. Lowercase and uppercase letters are treated identically: typing ff, Ff, or FF in base 16 all produce the same result. The converter simply normalizes your input to uppercase before parsing, so you can type in whatever case feels natural — including text you have pasted from another application.
What happens if I type a digit that does not exist in the selected base?
The converter refuses to guess and shows a clear error naming the offending character and the base, for example "Invalid digit “G” for base 16." The four result tiles switch to dashes until you fix the input. Guessing would silently produce a wrong number, which is worse than asking you to correct a single character.
Does the converter handle negative numbers and decimals?
Both. A leading minus sign is preserved through every base, so −12 in decimal becomes −1100 in binary and −C in hexadecimal. Fractional numbers are converted with a precision cap of 12 fractional digits, and the decimal point is carried through: 10.625 in decimal is 1010.101 in binary and A.A in hexadecimal.
Why do I need base conversions at all?
Different bases are different lenses on the same number, and each one makes certain facts obvious. Binary reveals how a computer stores values and which bits are set; hexadecimal is the compact shorthand used in memory addresses and color codes; octal survives in Unix file permission modes; decimal is what people think in. Converting between them is routine for anyone reading code, network addresses, or low-level data.

Formula last verified August 22, 2026 against our published methodology .