Every converter on this site is checked against independently generated reference results before release. This page explains how.
Approach
- We wrote a separate reference implementation in Python, using its own integer and string routines, for each conversion.
- We generated 955 test cases covering ordinary values, edge cases, very large numbers, fractions, negatives and multi-byte characters.
- We ran the same cases through the JavaScript used on the site and compared every output exactly. All 955 matched.
What the tests cover
| Area | Examples checked |
|---|---|
| Text to binary | ASCII, accents, Euro sign, emoji (1 to 4 UTF-8 bytes), separators, 7-bit and 8-bit |
| Binary to text | Spaced, unbroken, comma and 0b input; wrong lengths; invalid characters; invalid UTF-8 |
| Decimal and binary | Zero, powers of 2, numbers beyond 64 bits, negatives, fractions |
| Hex and binary | Upper and lower case, 0x prefixes, leading zeros |
| Calculator | Add, subtract, multiply, divide, AND, OR, XOR, negative results |
| Two’s complement | Boundaries for 4 to 64 bits, overflow detection |
Design choices that affect accuracy
- Whole numbers use arbitrary-precision integers, so there is no 53-bit or 64-bit rounding.
- Binary fractions are converted exactly; repeating fractions are cut at 32 bits and labelled as rounded.
- Text uses UTF-8, the same encoding as the modern web.
- Errors name the problem instead of returning a wrong answer.
Found a problem?
Tell us at info@binaryconverterpro.com with the input you used. Confirmed bugs are added to the test set so they cannot return.
