Address Range Calculator
Calculate a memory range from start and end addresses, or enter a starting address and byte size to find the final inclusive address. Get exact hexadecimal and decimal boundaries with range size.
What Is an Address Range?
An address range describes a continuous interval of memory locations from a starting address to an ending address. Address ranges are widely used when working with buffers, memory maps, device registers, file mappings, firmware, operating systems, and low-level software.
For an inclusive byte-address range, both the first and last addresses belong to the range. That means the number of addressable byte positions is one greater than the simple difference between the endpoints.
Calculate a Range from End Address or Byte Size
The Address Range Calculator supports the two common directions of memory range calculation.
Address Range from 0x1000 to 0x10FF
Consider an inclusive memory range beginning at 0x1000 and
ending at 0x10FF.
Find an End Address from Start Address and Size
When you already know the number of bytes in a memory block, the last inclusive address is found by adding the size minus one to the starting address.
Why Inclusive Address Ranges Add One
A common address-range mistake is to subtract the start from the end and assume the difference is the number of bytes. That calculation gives the distance between the two addresses, not the number of byte positions when both endpoints are included.
For example, the range from address 100 to address 100 contains one
addressable byte position, even though 100 - 100 = 0.
| Start | End | End − Start | Inclusive Size |
|---|---|---|---|
| 0 | 0 | 0 | 1 byte |
| 0 | 1 | 1 | 2 bytes |
| 100 | 103 | 3 | 4 bytes |
| 0x1000 | 0x10FF | 0xFF | 0x100 = 256 bytes |
Inclusive End Address vs Exclusive End Address
This calculator treats the displayed end address as the last
included byte address. This convention is common in memory-map
documentation where a region may be written as
0x1000–0x1FFF.
Some programming interfaces instead represent ranges using a start address and an exclusive end address. With that convention, the exclusive endpoint is the address immediately after the range.
Calculating Hexadecimal Address Ranges
Hexadecimal is the standard visual format for many memory addresses because it represents binary values compactly. One hexadecimal digit corresponds to four binary bits.
Common power-of-two memory regions also produce easy-to-recognize
hexadecimal boundaries. A 4 KiB block beginning at
0x4000, for example, has 4096 bytes or
0x1000 bytes.
Address Range Examples
| Start | End | Inclusive Size | Size Hex | Exclusive End |
|---|---|---|---|---|
| 0x1000 | 0x10FF | 256 bytes | 0x100 | 0x1100 |
| 0x1000 | 0x1FFF | 4096 bytes | 0x1000 | 0x2000 |
| 0x8000 | 0x80FF | 256 bytes | 0x100 | 0x8100 |
| 0x0000 | 0xFFFF | 65,536 bytes | 0x10000 | 0x10000 |
| 4096 | 5119 | 1024 bytes | 0x400 | 5120 |
Address Ranges in Memory Maps
Memory maps divide an address space into regions assigned to RAM, ROM, flash memory, peripherals, device registers, shared buffers, or reserved areas. Each region is commonly described using a starting address and an ending address or a starting address and length.
The calculator can convert between these two representations. This is useful when documentation supplies boundaries but software expects a byte length, or when a memory allocator provides a base and size but you need the final address.
Calculating Buffer Address Boundaries
Suppose a buffer starts at address 0x200000 and contains
1024 bytes. The last valid byte is not at
0x200000 + 1024. That value points immediately after the
buffer.
Bytes, KiB, MiB, and Address Range Size
Address arithmetic is performed in integer byte positions. Memory sizes are often also described using binary units such as KiB and MiB.
| Unit | Bytes | Hexadecimal Size |
|---|---|---|
| 1 KiB | 1,024 | 0x400 |
| 4 KiB | 4,096 | 0x1000 |
| 64 KiB | 65,536 | 0x10000 |
| 1 MiB | 1,048,576 | 0x100000 |
| 16 MiB | 16,777,216 | 0x1000000 |
Where Address Range Calculations Are Useful
Calculate the exact boundaries and sizes of mapped memory regions.
Work with flash, RAM, peripheral, and memory-mapped register regions.
Find the first and final byte addresses of buffers with known sizes.
Check whether addresses fall near the expected boundaries of an object or memory block.
Translate start/end boundaries into exact region lengths while inspecting binary layouts.
Reason about pages, virtual address regions, segments, and memory allocation boundaries.
Valid and Invalid Address Ranges
In Start + End mode, the end address must be greater than or equal to the start address for a forward inclusive range.
An end address below the start would describe reversed boundaries rather than the normal ascending range used by this calculator.
In Start + Size mode, the byte size must be at least one because an inclusive non-empty range needs at least one addressable position.
Exact Address Range Arithmetic with BigInt
Memory addresses and range lengths are integers, so exact arithmetic is important. JavaScript’s ordinary Number type cannot represent every large integer exactly once values exceed its safe integer precision.
This calculator uses BigInt for addresses, sizes, spans, and
range boundaries. It therefore avoids floating-point rounding during the
calculation.
Hexadecimal results are generated directly from the exact integer values, making the tool useful for both ordinary machine-sized addresses and much larger theoretical integer ranges.
Common Address Range Calculation Mistakes
Forgetting the inclusive +1
For inclusive endpoints, end - start is the span, while
end - start + 1 is the number of byte addresses.
Adding the full size to find the last byte
start + size gives the exclusive endpoint. The final included
byte is start + size - 1.
Mixing decimal and hexadecimal
Select the correct address format before entering the values. A hexadecimal
value such as 1000 does not represent the same integer as
decimal 1000.
Using zero as a range size
A non-empty inclusive range requires at least one byte. A size of zero has no valid inclusive last byte under this calculator’s range convention.
Assuming calculated addresses are mapped
Numerical validity does not prove that a real system has usable memory at those addresses.