Base Conversion Test Vectors
Arbitrary-precision reference vectors for checking base-conversion code. Every row on this page is generated at build time by HexConvert's BigInt engine - the same code covered by the project's reference test suite - never typed by hand.
Core vectors
Includes the 2^53 boundary (where plain JavaScript numbers start rounding) and the 64-bit edges. Inputs show their source base.
| Input | Decimal | Hex | Octal | Binary |
|---|---|---|---|---|
| 0(dec) | 0 | 0 | 0 | 0 |
| 1(dec) | 1 | 1 | 1 | 1 |
| 11111111(bin) | 255 | FF | 377 | 11111111 |
| 377(oct) | 255 | FF | 377 | 11111111 |
| 255(dec) | 255 | FF | 377 | 11111111 |
| 755(oct) | 493 | 1ED | 755 | 111101101 |
| FF(hex) | 255 | FF | 377 | 11111111 |
| 4095(dec) | 4095 | FFF | 7777 | 111111111111 |
| 177777(oct) | 65535 | FFFF | 177777 | 1111111111111111 |
| 37724000000(oct) | 4283432960 | FF500000 | 37724000000 | 11111111010100000000000000000000 |
| 9007199254740991(dec) | 9007199254740991 | 1FFFFFFFFFFFFF | 377777777777777777 | 1111111111111111111111111111111111111111… |
| 9007199254740992(dec) | 9007199254740992 | 20000000000000 | 400000000000000000 | 1000000000000000000000000000000000000000… |
| FFFFFFFFFFFFFFFF(hex) | 18446744073709551615 | FFFFFFFFFFFFFFFF | 1777777777777777777777 | 1111111111111111111111111111111111111111… |
| 10000000000000000(hex) | 18446744073709551616 | 10000000000000000 | 2000000000000000000000 | 1000000000000000000000000000000000000000… |
Large-value vectors
128-bit, 256-bit, and 10^50 magnitudes - the values that break float-based and 64-bit converters. Binary/octal forms are complete in the JSON/CSV export.
| Decimal | Hex | Bits |
|---|---|---|
| 340282366920938463463374607431768211455 | FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF | 128 |
| 115792089237316195423570985008687907853269984665640564039457584007913129639935 | FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF | 256 |
| 100000000000000000000000000000000000000000000000000 | 446C3B15F9926687D2C40534FDB564000000000000 | 167 |
Two's-complement vectors
Stored bit patterns (hex) for -1, signed max, and signed min at every supported width, with the value each pattern reads back as.
| Width | Value | Stored pattern (hex) | Reads back as |
|---|---|---|---|
| 8-bit | -1 | 0xFF | -1 |
| signed max | 0x7F | 127 | |
| signed min | 0x80 | -128 | |
| 16-bit | -1 | 0xFFFF | -1 |
| signed max | 0x7FFF | 32767 | |
| signed min | 0x8000 | -32768 | |
| 32-bit | -1 | 0xFFFFFFFF | -1 |
| signed max | 0x7FFFFFFF | 2147483647 | |
| signed min | 0x80000000 | -2147483648 | |
| 64-bit | -1 | 0xFFFFFFFFFFFFFFFF | -1 |
| signed max | 0x7FFFFFFFFFFFFFFF | 9223372036854775807 | |
| signed min | 0x8000000000000000 | -9223372036854775808 | |
| 128-bit | -1 | 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF | -1 |
| signed max | 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF | 170141183460469231731687303715884105727 | |
| signed min | 0x80000000000000000000000000000000 | -170141183460469231731687303715884105728 |
Using these vectors
Feed each input into your converter and compare digit-for-digit - do not compare through a float. If your pipeline uses JavaScript numbers, expect every vector at or above 9007199254740992 to fail; that is the 2^53 precision wall, not a bug in your parser.
How these are produced and verified: methodology & correctness. Try any value live in the universal base converter.