Skip to content

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.

Copy all vectors asJSON CSV

Core vectors

Includes the 2^53 boundary (where plain JavaScript numbers start rounding) and the 64-bit edges. Inputs show their source base.

InputDecimalHexOctalBinary
0(dec)0000
1(dec)1111
11111111(bin)255FF37711111111
377(oct)255FF37711111111
255(dec)255FF37711111111
755(oct)4931ED755111101101
FF(hex)255FF37711111111
4095(dec)4095FFF7777111111111111
177777(oct)65535FFFF1777771111111111111111
37724000000(oct)4283432960FF5000003772400000011111111010100000000000000000000
9007199254740991(dec)90071992547409911FFFFFFFFFFFFF3777777777777777771111111111111111111111111111111111111111…
9007199254740992(dec)9007199254740992200000000000004000000000000000001000000000000000000000000000000000000000…
FFFFFFFFFFFFFFFF(hex)18446744073709551615FFFFFFFFFFFFFFFF17777777777777777777771111111111111111111111111111111111111111…
10000000000000000(hex)184467440737095516161000000000000000020000000000000000000001000000000000000000000000000000000000000…

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.

DecimalHexBits
340282366920938463463374607431768211455FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF128
115792089237316195423570985008687907853269984665640564039457584007913129639935FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF256
100000000000000000000000000000000000000000000000000446C3B15F9926687D2C40534FDB564000000000000167

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.

WidthValueStored pattern (hex)Reads back as
8-bit-10xFF-1
signed max0x7F127
signed min0x80-128
16-bit-10xFFFF-1
signed max0x7FFF32767
signed min0x8000-32768
32-bit-10xFFFFFFFF-1
signed max0x7FFFFFFF2147483647
signed min0x80000000-2147483648
64-bit-10xFFFFFFFFFFFFFFFF-1
signed max0x7FFFFFFFFFFFFFFF9223372036854775807
signed min0x8000000000000000-9223372036854775808
128-bit-10xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF-1
signed max0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF170141183460469231731687303715884105727
signed min0x80000000000000000000000000000000-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.