Tools/Encoding & Conversion/Number Base Converter

Number Base Converter

Convert numbers between binary, octal, decimal, hexadecimal, and custom bases.

Input Number

Input Base

Results

Enter a number and click Convert

How to convert hex to decimal by hand

Each hex digit is worth 16n where n is the position from the right (starting at 0). For 0xFF:

F × 16^1 = 15 × 16 = 240
F × 16^0 = 15 × 1  =  15
                    ----
                    255

For 0xDEADBEEF (32-bit integer, classic placeholder value):

D × 16^7 = 13 × 268435456 = 3489660928
E × 16^6 = 14 × 16777216  =  234881024
A × 16^5 = 10 × 1048576   =   10485760
D × 16^4 = 13 × 65536     =     851968
B × 16^3 = 11 × 4096      =      45056
E × 16^2 = 14 × 256       =       3584
E × 16^1 = 14 × 16        =        224
F × 16^0 = 15 × 1         =         15
                            ---------
                            3735928559

Every programming language has built-ins, of course:

// JavaScript
parseInt("DEADBEEF", 16)       // 3735928559
Number("0xDEADBEEF")           // 3735928559
(3735928559).toString(16).toUpperCase()  // "DEADBEEF"

# Python
int("DEADBEEF", 16)            # 3735928559
hex(3735928559)                # '0xdeadbeef'
f"{3735928559:X}"              # 'DEADBEEF'

// C / C++ / Go / Rust
// 0x prefix in source code → compile-time hex literal
int x = 0xDEADBEEF;

When programmers actually use hex, binary and octal

  • Hex for: color codes (#FF6600), byte-level debugging, memory addresses, MD5/SHA hash output, network packets, binary file headers, Ethernet MAC addresses.
  • Binary for: bit flags and bitmasks, explaining bit shifts, hardware registers, file format headers, protocol state machines. Modern CPUs operate on bytes (groups of 8 bits) so you rarely see pure binary outside embedded work.
  • Octal for: Unix file permissions (chmod 755), string escape sequences (\777 in C). Rare outside these two.
  • Decimal for: everything else, obviously. Humans.

Two's complement (how negative integers are stored) is where most people get stuck. -1 in 8-bit is 11111111 (all ones). The top bit is the sign bit in signed integers. Our converter has a two's-complement toggle to visualise both signed and unsigned interpretations.

Frequently Asked Questions

How do I convert binary to decimal, hex or octal online?

Enter a number in any field — binary, octal, decimal or hexadecimal. The other three update instantly. Great for bit-manipulation debugging, assembly coding, network masks or any low-level programming task.

How does the binary-to-decimal conversion work?

Each bit position represents a power of 2. `1011` = 1×8 + 0×4 + 1×2 + 1×1 = 11. The tool walks through the arithmetic visually so you can learn the conversion, not just get the answer.

Can I convert hexadecimal to binary for byte-level debugging?

Yes. Each hex digit maps to exactly four binary bits (0–F → 0000–1111). Paste a hex byte string (`0xDEADBEEF`) and see the full binary representation — useful for reading binary file headers, network packets or memory dumps.

Does it handle negative numbers and two's complement?

Yes. Toggle two's complement mode for signed integer conversion. The tool shows 8-, 16-, 32- and 64-bit representations side-by-side — matches how C/C++/Rust integer types store negative values.

Can I convert between any two number bases (base 2 to base 36)?

Yes. The advanced mode lets you pick any source and target base from 2 to 36, using digits 0–9 then A–Z. Useful for base-32 encodings, base-36 ID shorteners (e.g. short URLs) and custom numeral systems.

Copyright © 2026 BuildStudio. All rights reserved.

Designed and Developed by Webority Technologies

Copied to clipboard