nrtechstudio.com

Number Base Converter Pro

Convert numbers between binary, octal, decimal, hexadecimal and any base 2–36 — all at once, with step-by-step solutions. Plus a bitwise calculator, two's complement converter and ASCII code lookup for programmers.

✓ 100% private — runs entirely in your browser, nothing is uploaded

01 Base converter

Type a number in any base — every base updates live. Prefixes 0b, 0o, 0x are auto-detected, and arbitrarily large integers work.

Underscores allowed as separators: 1111_0000. Fractions: 10.75
Fractions convert with up to 12 digits after the point (e.g. 0.1 decimal → 0.000110011001… in binary — repeating, like floating point).

Popular conversions, all handled above: hex to decimal · decimal to hex · binary to decimal · decimal to binary · binary to hex · hex to binary · octal to decimal · decimal to octal · binary to octal · octal to binary · hex to octal · octal to hex — or any base to any base (2–36).

02 Step-by-step solution

Every conversion above, shown the way you would do it by hand — positional expansion into decimal, then repeated division out of decimal.

→ To decimal (positional expansion)

Type a number above to see the steps.

→ From decimal (repeated division)

Type a number above to see the steps.

03 Bitwise calculator

AND, OR, XOR, NOT and shifts on integers in any base. Results are masked to the selected bit width — just like fixed-width CPU registers.

04 Two's complement converter

Encode a signed decimal as a two's complement bit pattern, or decode a pattern back to its signed and unsigned values.

Signed vs unsigned ranges

WidthSigned minSigned maxUnsigned max

05 Character code lookup

Type one character to see its code in every base. Boundary: this converts character codes between number bases — for turning whole text strings into hex or base64 (text encoding), use a dedicated text encoder instead.

ASCII table 0–127

06 Reference tables

Binary ↔ hexadecimal nibble table

Every hex digit is exactly 4 bits — memorize this table and you can read hex as binary at sight.

BinaryDecimalHex

Powers of 2

PowerDecimalHexCommon name

Common constants

DecimalHexOctalBinaryMeaning

07 Worked examples

Example 1 — 255 in every base

255 is the largest unsigned 8-bit value. Repeated division: 255÷2 leaves remainders 1,1,1,1,1,1,1,1 → 11111111₂. In octal: 255÷8 = 31 r7, 31÷8 = 3 r7, 3÷8 = 0 r3 → 377₈. In hex: 255÷16 = 15 r15 → FF₁₆.

Example 2 — 0xDEAD to decimal

Positional expansion with D=13, E=14, A=10:

Example 3 — −5 as 8-bit two's complement

Start from +5 = 00000101, invert every bit → 11111010, add 1 → 11111011. Check: 11111011₂ = 251 unsigned; 251 − 256 = −5 signed. ✓

08 Frequently asked questions

How do I convert binary to decimal?

Use positional expansion: write each bit's place value (powers of 2) and add them up. For example, 1011 in binary = 1×8 + 0×4 + 1×2 + 1×1 = 8 + 0 + 2 + 1 = 11 in decimal. Read the bits from right to left as 2⁰, 2¹, 2², 2³ and multiply each bit by its place value. The converter above shows every step automatically when you enter a binary number.

How do I convert decimal to binary?

Use repeated division by 2 and read the remainders bottom-up. For example, 13 in decimal: 13÷2=6 r1, 6÷2=3 r0, 3÷2=1 r1, 1÷2=0 r1 → remainders 1,0,1,1 read bottom-up give 1101 in binary. Check: 8+4+0+1=13. The step-by-step panel above performs this division chain for any number and any target base.

How do I convert hexadecimal to decimal?

Multiply each hex digit by its place value (powers of 16) and add. Digits A–F count as 10–15. For example, 0x2F = 2×16 + 15×1 = 32 + 15 = 47 in decimal. A longer example: 0xDEAD = 13×4096 + 14×256 + 10×16 + 13 = 57005. The expansion steps are shown automatically in the converter above.

How do I convert decimal to hexadecimal?

Divide repeatedly by 16 and read the remainders bottom-up, writing 10–15 as A–F. For example, 255 in decimal: 255÷16=15 r15 (F), 15÷16=0 r15 (F) → FF in hexadecimal. Larger example: 57005÷16 gives remainders 13,10,14,13 → D,E,A,D → 0xDEAD. Use the step-by-step section above to see the full division chain.

What is 0xFF in decimal?

0xFF is 255 in decimal. Each F is 15, so 15×16 + 15 = 240 + 15 = 255. 0xFF is the maximum value of one unsigned byte (8 bits all set: 11111111 in binary, 377 in octal). It appears constantly in programming — for example as a bitmask or the alpha channel in colors like #FFFFFF.

What is 255 in binary?

255 in binary is 11111111 (eight 1s). Since 255 = 128+64+32+16+8+4+2+1, every one of the 8 bit positions is set. In octal it is 377 and in hexadecimal it is FF. It is the largest value that fits in an unsigned 8-bit byte.

What does 0x mean in front of a number?

0x is the conventional prefix marking a hexadecimal (base-16) literal, used in C, Python, JavaScript, Rust and most other languages — 0xFF means hex FF, i.e. 255. Related prefixes: 0b for binary (0b1010 = 10) and 0o for octal (0o17 = 15) in Python and newer JavaScript. A plain leading 0 (like 017) means octal in C but is best avoided because it is easy to misread. This converter auto-detects 0b, 0o and 0x prefixes.

Why do programmers use hexadecimal?

Hexadecimal is a compact shorthand for binary: each hex digit maps to exactly 4 bits, so one byte is always exactly two hex digits (0x00–0xFF). Long binary strings like 1101111010101101 become the much more readable 0xDEAD. It is used for memory addresses, color codes (#FF5733), bitmasks, UUIDs and debugging raw bytes — anywhere humans need to read binary conveniently.

How many bits are in one hexadecimal digit?

One hexadecimal digit holds exactly 4 bits (a nibble), because 16 = 2⁴. That is why hex lines up so neatly with binary: 0x0–0xF covers 0000–1111, and every byte (8 bits) is two hex digits. Octal digits, by comparison, hold 3 bits each, which is why octal was popular on older 12/24/36-bit machines and hex won on 8-bit-byte machines.

How do I convert a decimal fraction to binary?

Multiply the fraction by 2 repeatedly and read off the integer parts top-down. For example, 0.625: 0.625×2=1.25 → 1, 0.25×2=0.5 → 0, 0.5×2=1.0 → 1, giving 0.101 in binary. Not every decimal fraction terminates in binary — 0.1 becomes the repeating 0.0001100110011…, the reason floating-point numbers like 0.1 + 0.2 are not exactly 0.3 in most languages. This converter shows up to 12 fractional digits.

What is two's complement and how does it work?

Two's complement is how almost all modern CPUs store signed integers. To negate a number: invert every bit (one's complement) and add 1. For example, -5 in 8 bits: 5 = 00000101 → invert → 11111010 → add 1 → 11111011. The top bit acts as the sign bit, zero has a single representation, and addition/subtraction work identically for signed and unsigned values — which is why hardware uses it. The two's complement panel above encodes and decodes 8/16/32/64-bit values.

What is the difference between one's complement and two's complement?

One's complement negates by flipping every bit (5 = 00000101 → -5 = 11111010); two's complement flips the bits and adds 1 (-5 = 11111011). One's complement has two zeros (+0 = 00000000 and −0 = 11111111) and needs end-around-carry in addition, so modern hardware universally uses two's complement, which has a single zero and reuses the same adder circuit for signed and unsigned math.

How do bitwise AND, OR and XOR work?

They compare numbers bit by bit: AND gives 1 only where both bits are 1; OR gives 1 where either bit is 1; XOR gives 1 where the bits differ. Example with 0xF0 (11110000) and 0xCC (11001100): AND = 0xC0 (11000000), OR = 0xFC (11111100), XOR = 0x3C (00111100). NOT flips every bit within the chosen width. Shifts move bits left (×2 per position) or right (÷2), with logical shift filling zeros and arithmetic shift preserving the sign bit. Try them in the bitwise calculator above.

What is the difference between logical and arithmetic right shift?

A logical right shift always fills the vacated top bits with 0, so it treats the value as unsigned. An arithmetic right shift replicates the sign bit, preserving negativity for two's complement numbers. Example in 8 bits: 11111011 (−5) shifted right by 1 logically gives 01111101 (125, wrong for signed math), arithmetically gives 11111101 (−3, correct floor of −5÷2). In C and Java, >> on signed integers is arithmetic; >>> is the logical shift.

How do I convert between hex and ASCII?

Look up each byte's character code: the character 'A' is code 65, which is 0x41 in hex, 101 in octal and 1000001 in binary. This tool converts single character codes between bases and includes the full ASCII table (codes 0–127) with control-character names. Note the boundary: this is number-base conversion of character codes — for converting whole text strings to hex or base64 (text encoding), use a dedicated text encoder instead.

What is the largest number an 8-bit, 16-bit or 32-bit integer can hold?

Unsigned: 8-bit holds 0–255 (0xFF), 16-bit 0–65,535 (0xFFFF), 32-bit 0–4,294,967,295 (0xFFFFFFFF). Signed (two's complement): 8-bit holds −128 to 127, 16-bit −32,768 to 32,767, 32-bit −2,147,483,648 to 2,147,483,647. Overflow wraps around silently in most languages — 255 + 1 in an unsigned byte becomes 0. The two's complement section above shows the exact range for any width.

09 Notes & comparison

How this differs from RapidTables / calculator.net: those converters handle one pair of bases per page and show only the answer. This tool converts to all bases at once (binary, octal, decimal, hex, base-36 + any custom base 2–36), shows step-by-step working, handles fractions and arbitrarily large integers, and adds programmer tools (bitwise ops, two's complement, ASCII codes) — all client-side with no page reloads.

Methodology

All integer arithmetic uses arbitrary-precision integers (JavaScript BigInt), so values of any size convert exactly — there is no 32-bit or floating-point rounding on the integer part. Fractions convert with up to 12 digits after the point using exact rational arithmetic (numerator/denominator as big integers), then truncate. Bitwise operations mask results to the selected width (8/16/32/64 bits), matching fixed-width register behavior. No data leaves your browser: there are no network requests, analytics scripts or cookies.

Scope boundary

This is a number-base converter: numbers between numeral systems. It is not a text encoder — converting whole strings to hex/base64 or hashing text are different tools with different intents.

Free tool by NRTechStudio