Examples:

Binary: 01000001 → String: “A”

Binary: 0100100001101001 → String: “Hi”

Binary: 00110001 00110010 00110011 → String: “123”

🔴 LIVE CONVERSION
let cleanBinary = input; if (autoClean) { // Remove all non-binary characters cleanBinary = input.replace(/[^01]/g, ”); } else { // Remove only common separators but validate strictly cleanBinary = input.replace(/[\s\n\r]/g, ”); if (!/^[01]*$/.test(cleanBinary)) { throw new Error(‘Invalid binary characters found. Enable auto-clean or provide valid binary.’); } } if (cleanBinary.length === 0) { output.value = ”; stats.innerHTML = ”; return; } if (strictMode && cleanBinary.length % 8 !== 0) { throw new Error(‘Binary string must be divisible by 8 bits (complete bytes).’); } // Pad with leading zeros if not divisible by 8 and not in strict mode if (cleanBinary.length % 8 !== 0) { const padding = 8 – (cleanBinary.length % 8); cleanBinary = ‘0’.repeat(padding) + cleanBinary; showMessage(`Warning: Added ${padding} leading zero(s) to complete byte boundary.`, ‘warning’); } let result = ”; switch (encoding) { case ‘utf8’: result = binaryToStringUTF8(cleanBinary, showNonPrintable); break; case ‘ascii’: result = binaryToStringASCII(cleanBinary, showNonPrintable); break; case ‘latin1’: result = binaryToStringLatin1(cleanBinary, showNonPrintable); break; case ‘utf16’: result = binaryToStringUTF16(cleanBinary, showNonPrintable); break; default: result = binaryToStringUTF8(cleanBinary, showNonPrintable); } output.value = result; // Calculate statistics const binaryLength = cleanBinary.length; const byteCount = binaryLength / 8; const stringLength = result.length; const nonPrintableCount = (result.match(/\[[01]+\]/g) || []).length; stats.innerHTML = `
Binary: ${binaryLength} bits
Bytes: ${byteCount}
String: ${stringLength} chars
Encoding: ${encoding.toUpperCase()}
`; if (nonPrintableCount > 0) { stats.innerHTML += `
Non-printable: ${nonPrintableCount}
`; } if (input.trim()) { showMessage(‘Binary converted to string successfully!’, ‘success’); } } catch (error) { showMessage(‘Error: ‘ + error.message, ‘error’); output.value = ”; stats.innerHTML = ”; } } function binaryToStringUTF8(binary, showNonPrintable) { const bytes = []; for (let i = 0; i < binary.length; i += 8) { bytes.push(parseInt(binary.substr(i, 8), 2)); } try {