Memory Address Converter

Convert memory addresses between hex, decimal, binary, and octal. Perform pointer arithmetic with byte/word/dword/qword units and calculate address alignment boundaries.

Address Size:

Base Converter

Decimal

Hexadecimal (0x prefix)

Binary (grouped in 4s)

Octal (0o prefix)

Pointer Arithmetic

Base Address

Offset

Unit

Equation

0x00001000 + 4 × 4 = 0x00001010

0x00001010 (4112)

Address Alignment Calculator

Address

Alignment (bytes)

Not aligned

Alignment Mask

0xFFFFFFF0 (~15)

Aligned Down (floor)

0x00001000

Aligned Up (ceiling)

0x00001010

x86 Memory Map Quick Reference

RegionAddressDescription
x86 Real Mode IVTInterrupt Vector Table (1 KB)
x86 BDABIOS Data Area (256 B)
VGA Text Buffer80×25 text mode video RAM
VGA GraphicsVGA graphics framebuffer (128 KB)
BIOS ROMLegacy BIOS read-only memory (64 KB)
High Memory AreaExtended memory starts at 1 MB
ISA Hole15–16 MB ISA DMA hole (some systems)
x64 Kernel BaseTypical Linux x86-64 kernel start

Click an address to load it into the converter above.

Memory Address Representations

A memory address is a number that identifies a location in a computer's address space. The same address can be expressed in any numeric base, but different bases are preferred in different contexts. Decimal is natural for humans but obscures bit-level structure. Hexadecimal is the universal choice in systems programming because each digit maps to exactly four binary bits, making alignment patterns and address arithmetic immediately visible.

BasePrefixDigitsCommon use
Binary (2)0b0–1Bit manipulation, masks, flags
Octal (8)0o0–7Unix permissions, legacy systems
Decimal (10)none0–9User-facing sizes, offsets
Hex (16)0x0–9, A–FAddresses, registers, color values

Pointer Arithmetic and Alignment Rules

Understanding how C/C++ pointer arithmetic scales is essential for reading disassembly and debugging memory issues. When you write ptr + n in C, the compiler multiplies n by the size of the pointed-to type. On a modern 64-bit system, alignment requirements are:

char / uint8_t

Size: 1 byte

Align: 1 byte

Always aligned

short / uint16_t

Size: 2 bytes

Align: 2 bytes

Word boundary

int / uint32_t

Size: 4 bytes

Align: 4 bytes

Dword boundary

long / uint64_t

Size: 8 bytes

Align: 8 bytes

Qword boundary

The alignment calculator uses the formula aligned_down = addr & ~(N-1) and aligned_up = (addr + N - 1) & ~(N-1). The mask ~(N-1) works only for powers of two — which covers all standard alignment values in hardware.

x86 Memory Map Reference

The x86 real-mode memory map is fixed by IBM PC architecture dating to 1981. Even on modern 64-bit systems, the first megabyte of physical memory retains these legacy assignments for compatibility with BIOS and legacy peripherals. Understanding these addresses is essential for writing bootloaders, operating system kernels, embedded firmware, and bare-metal applications. The VGA text buffer at 0xB8000 is still writable in modern hypervisors and QEMU, making it useful for early-boot debugging before serial or framebuffer output is initialized.

Frequently Asked Questions

Why do programmers use hexadecimal for memory addresses?

Hexadecimal maps cleanly onto binary: each hex digit represents exactly 4 bits (a nibble), so a 32-bit address becomes 8 hex digits and a 64-bit address becomes 16 hex digits. This makes it easy to inspect bit patterns, detect alignment, and spot familiar constants like page boundaries (0x1000) at a glance. Decimal addresses are harder to read because powers of 2 produce irregular decimal numbers. The '0x' prefix is the universally accepted C/C++ and assembly convention to distinguish hex literals from decimal.

What is pointer arithmetic and why is it useful?

Pointer arithmetic lets you navigate memory by adding or subtracting scaled offsets from a base address. A 'word' is 2 bytes, a 'dword' (double word) is 4 bytes, and a 'qword' (quad word) is 8 bytes. When a C pointer of type int* advances by 1, it actually advances by sizeof(int) bytes (typically 4). Understanding this is critical when reading assembly output, debugging memory corruption, writing device drivers, implementing custom allocators, or working with packed binary protocols and file formats.

What does address alignment mean and why does it matter?

An address is N-byte aligned if it is a multiple of N. Modern CPUs access memory most efficiently (and sometimes exclusively) when data is aligned to its natural boundary: a 4-byte int should sit at an address divisible by 4, an 8-byte double at a multiple of 8, and so on. Misaligned accesses can trigger hardware exceptions on strict architectures (ARM, MIPS), cause performance penalties on x86 due to cache-line splits, or silently corrupt data in SIMD operations. Page-aligned allocations (4096 bytes) are required for memory-mapped I/O and virtual memory management.

How does the alignment mask work?

For any power-of-two alignment N, the mask is ~(N-1). For example, 16-byte alignment gives a mask of ~15 = 0xFFFFFFF0 (on 32-bit). Applying this mask with a bitwise AND rounds an address down to the nearest aligned boundary: aligned_addr = addr & mask. To round up (ceiling), use: aligned_up = (addr + N - 1) & mask. These two operations are ubiquitous in allocators, linker scripts, and OS kernel code.

What is the difference between 16-bit, 32-bit, and 64-bit address spaces?

The address size determines the maximum addressable memory. A 16-bit address can reference up to 64 KB (65,536 bytes), which was the limit of early microprocessors like the 8080 and 6502. A 32-bit address space covers 4 GB (2^32 bytes), which was sufficient for desktop computing until the early 2000s. A 64-bit address space theoretically allows 16 exabytes (2^64 bytes), though current x86-64 CPUs use only 48 physical and 57 virtual address bits. The converter clamps values to the selected size to reflect real hardware limits.