How We Test Our Converters

Every converter on this site is checked against independently generated reference results before release. This page explains how.

Approach

  1. We wrote a separate reference implementation in Python, using its own integer and string routines, for each conversion.
  2. We generated 955 test cases covering ordinary values, edge cases, very large numbers, fractions, negatives and multi-byte characters.
  3. We ran the same cases through the JavaScript used on the site and compared every output exactly. All 955 matched.

What the tests cover

AreaExamples checked
Text to binaryASCII, accents, Euro sign, emoji (1 to 4 UTF-8 bytes), separators, 7-bit and 8-bit
Binary to textSpaced, unbroken, comma and 0b input; wrong lengths; invalid characters; invalid UTF-8
Decimal and binaryZero, powers of 2, numbers beyond 64 bits, negatives, fractions
Hex and binaryUpper and lower case, 0x prefixes, leading zeros
CalculatorAdd, subtract, multiply, divide, AND, OR, XOR, negative results
Two’s complementBoundaries 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.