All Rounder Tools Blogger-Best blog for blogger: Binary to Text converter Tool with colorful styling and all its features use any free library...

Wednesday, September 25, 2024

Binary to Text converter Tool with colorful styling and all its features use any free library...

 

Binary to Text Converter

Binary to Text Converter

Converted Text

* { box-sizing: border-box; margin: 0; padding: 0; } body { font-family: Arial, sans-serif; background: linear-gradient(135deg, #f3f4f6, #e2e8f0); color: #333; display: flex; justify-content: center; align-items: center; height: 100vh; } .container { background: #ffffff; border-radius: 8px; padding: 20px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1); width: 90%; max-width: 600px; text-align: center; } h1 { color: #4A90E2; } textarea { width: 100%; height: 100px; margin: 10px 0; padding: 10px; border: 2px solid #4A90E2; border-radius: 4px; font-size: 16px; resize: none; } textarea:focus { border-color: #2E86C1; outline: none; } button { background-color: #4A90E2; color: white; border: none; border-radius: 4px; padding: 10px 20px; cursor: pointer; font-size: 16px; transition: background-color 0.3s; } button:hover { background-color: #357ABD; } document.getElementById("convertButton").addEventListener("click", function() { const binaryInput = document.getElementById("binaryInput").value; const textOutput = document.getElementById("textOutput"); // Split the input by spaces and convert each binary to decimal const binaryArray = binaryInput.split(' '); let text = ''; binaryArray.forEach(binary => { // Check if the binary is valid (should be 8 bits) if (/^[01]{8}$/.test(binary)) { const charCode = parseInt(binary, 2); text += String.fromCharCode(charCode); } else { text += '?'; // Append a placeholder for invalid binary } }); textOutput.value = text; });

No comments:

Post a Comment