{"id":340,"date":"2025-07-26T14:17:20","date_gmt":"2025-07-26T14:17:20","guid":{"rendered":"https:\/\/vijaypandit.in\/?page_id=340"},"modified":"2025-07-26T14:23:12","modified_gmt":"2025-07-26T14:23:12","slug":"binary-to-text","status":"publish","type":"page","link":"https:\/\/vijaypandit.in\/?page_id=340","title":{"rendered":"Binary to Text"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>Binary to Text Tool<\/title>\n    <style>\n        * {\n            margin: 0;\n            padding: 0;\n            box-sizing: border-box;\n        }\n\n        .gp-binary-to-text-tool {\n            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\n            background-color: #f5f5f5;\n            min-height: 100vh;\n            padding: 20px;\n        }\n\n        .gp-binary-to-text-container {\n            max-width: 1200px;\n            margin: 0 auto;\n        }\n\n        .gp-binary-to-text-header {\n            background: white;\n            padding: 25px;\n            border-radius: 12px;\n            box-shadow: 0 2px 10px rgba(0,0,0,0.1);\n            margin-bottom: 20px;\n            display: flex;\n            align-items: center;\n            gap: 20px;\n        }\n\n        .gp-binary-to-text-icon {\n            width: 80px;\n            height: 80px;\n            background: linear-gradient(135deg, #4285f4, #1a73e8);\n            border-radius: 16px;\n            display: flex;\n            align-items: center;\n            justify-content: center;\n            font-size: 24px;\n            font-weight: 900;\n            color: white;\n            flex-shrink: 0;\n        }\n\n        .gp-binary-to-text-title-section h1 {\n            font-size: 32px;\n            color: #000;\n            font-weight: 900;\n            margin-bottom: 8px;\n        }\n\n        .gp-binary-to-text-title-section p {\n            font-size: 18px;\n            color: #000;\n            font-weight: 700;\n        }\n\n        .gp-binary-to-text-main {\n            display: grid;\n            grid-template-columns: 1fr 1fr;\n            gap: 20px;\n            margin-bottom: 20px;\n        }\n\n        .gp-binary-to-text-section {\n            background: white;\n            border-radius: 12px;\n            padding: 25px;\n            box-shadow: 0 2px 10px rgba(0,0,0,0.1);\n            height: fit-content;\n        }\n\n        .gp-binary-to-text-section h2 {\n            font-size: 20px;\n            color: #000;\n            font-weight: 900;\n            margin-bottom: 15px;\n            display: flex;\n            align-items: center;\n            gap: 10px;\n        }\n\n        .gp-binary-to-text-textarea {\n            width: 100%;\n            height: 300px;\n            border: 2px solid #e0e0e0;\n            border-radius: 8px;\n            padding: 15px;\n            font-family: 'Segoe UI', monospace;\n            font-size: 14px;\n            font-weight: 700;\n            color: #000;\n            resize: vertical;\n            transition: border-color 0.3s ease;\n            line-height: 1.5;\n            word-break: break-all;\n        }\n\n        .gp-binary-to-text-textarea:focus {\n            outline: none;\n            border-color: #4285f4;\n        }\n\n        .gp-binary-to-text-controls {\n            margin-top: 15px;\n            display: grid;\n            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n            gap: 15px;\n        }\n\n        .gp-binary-to-text-control-group {\n            display: flex;\n            flex-direction: column;\n            gap: 8px;\n        }\n\n        .gp-binary-to-text-control-row {\n            display: flex;\n            align-items: center;\n            gap: 8px;\n        }\n\n        .gp-binary-to-text-control-row label {\n            font-weight: 700;\n            color: #000;\n            font-size: 14px;\n            min-width: 80px;\n        }\n\n        .gp-binary-to-text-select {\n            padding: 8px 12px;\n            border: 2px solid #e0e0e0;\n            border-radius: 6px;\n            font-family: 'Segoe UI', sans-serif;\n            font-weight: 700;\n            color: #000;\n            background: white;\n            cursor: pointer;\n            flex: 1;\n        }\n\n        .gp-binary-to-text-checkbox-group {\n            display: flex;\n            align-items: center;\n            gap: 8px;\n            flex-wrap: wrap;\n        }\n\n        .gp-binary-to-text-checkbox-group input[type=\"checkbox\"] {\n            width: 18px;\n            height: 18px;\n            cursor: pointer;\n        }\n\n        .gp-binary-to-text-checkbox-group label {\n            font-weight: 700;\n            color: #000;\n            cursor: pointer;\n            font-size: 14px;\n            min-width: auto;\n        }\n\n        .gp-binary-to-text-button {\n            background: #000 !important;\n            color: white !important;\n            border: none;\n            padding: 12px 20px;\n            border-radius: 8px;\n            font-family: 'Segoe UI', sans-serif;\n            font-weight: 700;\n            font-size: 14px;\n            cursor: pointer;\n            transition: all 0.3s ease;\n            display: flex;\n            align-items: center;\n            gap: 8px;\n            justify-content: center;\n            text-decoration: none;\n        }\n\n        .gp-binary-to-text-button:hover {\n            background: #333 !important;\n            color: white !important;\n            transform: translateY(-2px);\n            box-shadow: 0 4px 12px rgba(0,0,0,0.2);\n        }\n\n        .gp-binary-to-text-button:active {\n            transform: translateY(0);\n        }\n\n        .gp-binary-to-text-button.secondary {\n            background: #666 !important;\n            color: white !important;\n        }\n\n        .gp-binary-to-text-button.secondary:hover {\n            background: #555 !important;\n            color: white !important;\n        }\n\n        .gp-binary-to-text-actions {\n            display: grid;\n            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));\n            gap: 12px;\n            margin-top: 15px;\n        }\n\n        .gp-binary-to-text-stats {\n            background: white;\n            border-radius: 12px;\n            padding: 25px;\n            box-shadow: 0 2px 10px rgba(0,0,0,0.1);\n            margin-bottom: 20px;\n        }\n\n        .gp-binary-to-text-stats h2 {\n            font-size: 20px;\n            color: #000;\n            font-weight: 900;\n            margin-bottom: 15px;\n        }\n\n        .gp-binary-to-text-stats-grid {\n            display: grid;\n            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));\n            gap: 20px;\n        }\n\n        .gp-binary-to-text-stat {\n            text-align: center;\n        }\n\n        .gp-binary-to-text-stat-number {\n            font-size: 32px;\n            font-weight: 900;\n            color: #D97757;\n            display: block;\n            margin-bottom: 5px;\n            transition: all 0.3s ease;\n        }\n\n        .gp-binary-to-text-stat-label {\n            font-size: 14px;\n            font-weight: 900;\n            color: #000;\n        }\n\n        .gp-binary-to-text-description {\n            background: #CBCADC;\n            border-left: 4px solid #D97757;\n            padding: 20px;\n            border-radius: 8px;\n            margin-bottom: 20px;\n        }\n\n        .gp-binary-to-text-description h3 {\n            font-size: 18px;\n            color: #000;\n            font-weight: 900;\n            margin-bottom: 10px;\n        }\n\n        .gp-binary-to-text-description p {\n            font-size: 14px;\n            color: #000;\n            font-weight: 700;\n            line-height: 1.5;\n        }\n\n        .gp-binary-to-text-history {\n            background: white;\n            border-radius: 12px;\n            padding: 25px;\n            box-shadow: 0 2px 10px rgba(0,0,0,0.1);\n            margin-bottom: 20px;\n        }\n\n        .gp-binary-to-text-history h2 {\n            font-size: 20px;\n            color: #000;\n            font-weight: 900;\n            margin-bottom: 15px;\n        }\n\n        .gp-binary-to-text-history-item {\n            background: #f8f9fa;\n            border: 1px solid #e0e0e0;\n            border-radius: 6px;\n            padding: 12px;\n            margin-bottom: 10px;\n            display: flex;\n            justify-content: space-between;\n            align-items: center;\n        }\n\n        .gp-binary-to-text-history-text {\n            font-size: 14px;\n            color: #000;\n            font-weight: 700;\n            flex: 1;\n        }\n\n        .gp-binary-to-text-history-restore {\n            background: #4285f4;\n            color: white;\n            border: none;\n            padding: 6px 12px;\n            border-radius: 4px;\n            font-weight: 700;\n            font-size: 12px;\n            cursor: pointer;\n        }\n\n        .gp-binary-to-text-toast {\n            position: fixed;\n            top: 20px;\n            right: 20px;\n            background: #000;\n            color: white;\n            padding: 12px 20px;\n            border-radius: 8px;\n            font-weight: 700;\n            z-index: 1000;\n            transform: translateX(400px);\n            transition: transform 0.3s ease;\n        }\n\n        .gp-binary-to-text-toast.show {\n            transform: translateX(0);\n        }\n\n        .gp-binary-to-text-pulse {\n            animation: pulse 0.5s ease-in-out;\n        }\n\n        @keyframes pulse {\n            0% { transform: scale(1); }\n            50% { transform: scale(1.1); }\n            100% { transform: scale(1); }\n        }\n\n        .gp-binary-to-text-preview {\n            background: #f8f9fa;\n            border: 1px solid #e0e0e0;\n            border-radius: 6px;\n            padding: 15px;\n            margin-top: 15px;\n            font-family: 'Segoe UI', sans-serif;\n            font-size: 14px;\n            font-weight: 700;\n            color: #000;\n            max-height: 150px;\n            overflow-y: auto;\n            white-space: pre-wrap;\n        }\n\n        .gp-binary-to-text-validation {\n            background: #fff3cd;\n            border: 1px solid #ffc107;\n            border-radius: 6px;\n            padding: 10px;\n            margin-top: 10px;\n            font-size: 12px;\n            font-weight: 700;\n            color: #000;\n        }\n\n        .gp-binary-to-text-validation.valid {\n            background: #d4edda;\n            border-color: #28a745;\n        }\n\n        .gp-binary-to-text-validation.invalid {\n            background: #f8d7da;\n            border-color: #dc3545;\n        }\n\n        .gp-binary-to-text-breakdown {\n            background: #f0f8ff;\n            border: 1px solid #4285f4;\n            border-radius: 6px;\n            padding: 15px;\n            margin-top: 15px;\n            font-family: 'Segoe UI', monospace;\n            font-size: 12px;\n            font-weight: 700;\n            color: #000;\n            max-height: 200px;\n            overflow-y: auto;\n        }\n\n        \/* Mobile Responsive *\/\n        @media (max-width: 768px) {\n            .gp-binary-to-text-tool {\n                padding: 15px;\n            }\n\n            .gp-binary-to-text-header {\n                flex-direction: column;\n                text-align: center;\n                padding: 20px;\n            }\n\n            .gp-binary-to-text-title-section h1 {\n                font-size: 24px;\n            }\n\n            .gp-binary-to-text-title-section p {\n                font-size: 16px;\n            }\n\n            .gp-binary-to-text-main {\n                grid-template-columns: 1fr;\n                gap: 15px;\n            }\n\n            .gp-binary-to-text-section {\n                padding: 20px;\n            }\n\n            .gp-binary-to-text-textarea {\n                height: 250px;\n            }\n\n            .gp-binary-to-text-stats-grid {\n                grid-template-columns: repeat(2, 1fr);\n                gap: 15px;\n            }\n\n            .gp-binary-to-text-actions {\n                grid-template-columns: 1fr;\n            }\n\n            .gp-binary-to-text-controls {\n                grid-template-columns: 1fr;\n            }\n\n            .gp-binary-to-text-control-row {\n                flex-direction: column;\n                align-items: stretch;\n                gap: 5px;\n            }\n\n            .gp-binary-to-text-control-row label {\n                min-width: auto;\n            }\n\n            .gp-binary-to-text-checkbox-group {\n                justify-content: center;\n            }\n        }\n    <\/style>\n<\/head>\n<body>\n    <div class=\"gp-binary-to-text-tool\">\n        <div class=\"gp-binary-to-text-container\">\n            <!-- Header -->\n            <div class=\"gp-binary-to-text-header\">\n                <div class=\"gp-binary-to-text-icon\">01\u2192A<\/div>\n                <div class=\"gp-binary-to-text-title-section\">\n                    <h1>Binary to Text<\/h1>\n                    <p>Convert binary code to readable text with multiple encoding formats and advanced error detection<\/p>\n                <\/div>\n            <\/div>\n\n            <!-- Description with rotating tips -->\n            <div class=\"gp-binary-to-text-description\" id=\"descriptionBox\">\n                <h3>Pro Tip<\/h3>\n                <p id=\"rotatingTip\">Perfect for decoding binary messages, understanding computer data storage, programming education, and cryptography analysis.<\/p>\n            <\/div>\n\n            <!-- Main Content -->\n            <div class=\"gp-binary-to-text-main\">\n                <!-- Input Section -->\n                <div class=\"gp-binary-to-text-section\">\n                    <h2>\ud83d\udd22 Binary Input<\/h2>\n                    <textarea \n                        class=\"gp-binary-to-text-textarea\" \n                        id=\"inputText\" \n                        placeholder=\"Enter binary code here...\n\nSupported formats:\n01001000 01100101 01101100 01101100 01101111\n01001000-01100101-01101100-01101100-01101111\n0100100001100101011011000110110001101111\n01001000,01100101,01101100,01101100,01101111\n\nEach line will be processed separately.\"\n                    ><\/textarea>\n                    \n                    <div class=\"gp-binary-to-text-controls\">\n                        <div class=\"gp-binary-to-text-control-group\">\n                            <div class=\"gp-binary-to-text-control-row\">\n                                <label for=\"encoding\">Encoding:<\/label>\n                                <select class=\"gp-binary-to-text-select\" id=\"encoding\">\n                                    <option value=\"utf8\">UTF-8<\/option>\n                                    <option value=\"ascii\">ASCII<\/option>\n                                    <option value=\"utf16\">UTF-16<\/option>\n                                    <option value=\"latin1\">Latin-1<\/option>\n                                <\/select>\n                            <\/div>\n                            <div class=\"gp-binary-to-text-control-row\">\n                                <label for=\"bitGroup\">Bit Group:<\/label>\n                                <select class=\"gp-binary-to-text-select\" id=\"bitGroup\">\n                                    <option value=\"8\">8-bit bytes<\/option>\n                                    <option value=\"7\">7-bit bytes<\/option>\n                                    <option value=\"16\">16-bit words<\/option>\n                                    <option value=\"auto\">Auto detect<\/option>\n                                <\/select>\n                            <\/div>\n                        <\/div>\n                        \n                        <div class=\"gp-binary-to-text-control-group\">\n                            <div class=\"gp-binary-to-text-control-row\">\n                                <label for=\"separator\">Separator:<\/label>\n                                <select class=\"gp-binary-to-text-select\" id=\"separator\">\n                                    <option value=\"auto\">Auto detect<\/option>\n                                    <option value=\"space\">Space<\/option>\n                                    <option value=\"dash\">Dash (-)<\/option>\n                                    <option value=\"comma\">Comma (,)<\/option>\n                                    <option value=\"newline\">New line<\/option>\n                                    <option value=\"none\">None (continuous)<\/option>\n                                <\/select>\n                            <\/div>\n                            <div class=\"gp-binary-to-text-control-row\">\n                                <label for=\"endianness\">Byte Order:<\/label>\n                                <select class=\"gp-binary-to-text-select\" id=\"endianness\">\n                                    <option value=\"big\">Big Endian<\/option>\n                                    <option value=\"little\">Little Endian<\/option>\n                                <\/select>\n                            <\/div>\n                        <\/div>\n                    <\/div>\n\n                    <div class=\"gp-binary-to-text-controls\">\n                        <div class=\"gp-binary-to-text-checkbox-group\">\n                            <input type=\"checkbox\" id=\"strictMode\" checked>\n                            <label for=\"strictMode\">Strict Mode<\/label>\n                        <\/div>\n                        <div class=\"gp-binary-to-text-checkbox-group\">\n                            <input type=\"checkbox\" id=\"showNonPrintable\">\n                            <label for=\"showNonPrintable\">Show Non-Printable<\/label>\n                        <\/div>\n                        <div class=\"gp-binary-to-text-checkbox-group\">\n                            <input type=\"checkbox\" id=\"ignoreErrors\">\n                            <label for=\"ignoreErrors\">Ignore Errors<\/label>\n                        <\/div>\n                        <div class=\"gp-binary-to-text-checkbox-group\">\n                            <input type=\"checkbox\" id=\"showBreakdown\" checked>\n                            <label for=\"showBreakdown\">Show Breakdown<\/label>\n                        <\/div>\n                    <\/div>\n\n                    <div class=\"gp-binary-to-text-actions\">\n                        <button class=\"gp-binary-to-text-button\" onclick=\"convertBinary()\">\n                            \ud83d\udd04 Convert to Text\n                        <\/button>\n                        <button class=\"gp-binary-to-text-button secondary\" onclick=\"clearInput()\">\n                            \ud83d\uddd1\ufe0f Clear\n                        <\/button>\n                        <button class=\"gp-binary-to-text-button secondary\" onclick=\"undoAction()\">\n                            \u21b6 Undo\n                        <\/button>\n                        <button class=\"gp-binary-to-text-button secondary\" onclick=\"redoAction()\">\n                            \u21b7 Redo\n                        <\/button>\n                    <\/div>\n\n                    <!-- Input Validation -->\n                    <div class=\"gp-binary-to-text-validation\" id=\"inputValidation\">\n                        Enter binary code to see validation status&#8230;\n                    <\/div>\n\n                    <!-- Live Preview -->\n                    <div class=\"gp-binary-to-text-preview\" id=\"livePreview\">\n                        Live preview will appear here&#8230;\n                    <\/div>\n                <\/div>\n\n                <!-- Output Section -->\n                <div class=\"gp-binary-to-text-section\">\n                    <h2>\u2705 Text Output<\/h2>\n                    <textarea \n                        class=\"gp-binary-to-text-textarea\" \n                        id=\"outputText\" \n                        readonly\n                        placeholder=\"Your decoded text will appear here...\"\n                    ><\/textarea>\n\n                    <div class=\"gp-binary-to-text-actions\">\n                        <button class=\"gp-binary-to-text-button\" onclick=\"copyToClipboard()\">\n                            \ud83d\udccb Copy to Clipboard\n                        <\/button>\n                        <button class=\"gp-binary-to-text-button secondary\" onclick=\"downloadResult()\">\n                            \ud83d\udcbe Download\n                        <\/button>\n                        <button class=\"gp-binary-to-text-button secondary\" onclick=\"copyToInput()\">\n                            \u2b05\ufe0f Copy to Input\n                        <\/button>\n                        <button class=\"gp-binary-to-text-button secondary\" onclick=\"validateBinary()\">\n                            \u2713 Validate\n                        <\/button>\n                    <\/div>\n\n                    <!-- Detailed Breakdown -->\n                    <div class=\"gp-binary-to-text-breakdown\" id=\"detailedBreakdown\" style=\"display: none;\">\n                        Detailed character breakdown will appear here&#8230;\n                    <\/div>\n                <\/div>\n            <\/div>\n\n            <!-- Statistics -->\n            <div class=\"gp-binary-to-text-stats\">\n                <h2>\ud83d\udcca Statistics<\/h2>\n                <div class=\"gp-binary-to-text-stats-grid\">\n                    <div class=\"gp-binary-to-text-stat\">\n                        <span class=\"gp-binary-to-text-stat-number\" id=\"totalBits\">0<\/span>\n                        <span class=\"gp-binary-to-text-stat-label\">Total Bits<\/span>\n                    <\/div>\n                    <div class=\"gp-binary-to-text-stat\">\n                        <span class=\"gp-binary-to-text-stat-number\" id=\"validBytes\">0<\/span>\n                        <span class=\"gp-binary-to-text-stat-label\">Valid Bytes<\/span>\n                    <\/div>\n                    <div class=\"gp-binary-to-text-stat\">\n                        <span class=\"gp-binary-to-text-stat-number\" id=\"outputChars\">0<\/span>\n                        <span class=\"gp-binary-to-text-stat-label\">Output Characters<\/span>\n                    <\/div>\n                    <div class=\"gp-binary-to-text-stat\">\n                        <span class=\"gp-binary-to-text-stat-number\" id=\"errorCount\">0<\/span>\n                        <span class=\"gp-binary-to-text-stat-label\">Errors<\/span>\n                    <\/div>\n                    <div class=\"gp-binary-to-text-stat\">\n                        <span class=\"gp-binary-to-text-stat-number\" id=\"printableChars\">0<\/span>\n                        <span class=\"gp-binary-to-text-stat-label\">Printable Chars<\/span>\n                    <\/div>\n                    <div class=\"gp-binary-to-text-stat\">\n                        <span class=\"gp-binary-to-text-stat-number\" id=\"unicodeChars\">0<\/span>\n                        <span class=\"gp-binary-to-text-stat-label\">Unicode Chars<\/span>\n                    <\/div>\n                <\/div>\n            <\/div>\n\n            <!-- Operation History -->\n            <div class=\"gp-binary-to-text-history\">\n                <h2>\ud83d\udcda Operation History<\/h2>\n                <div id=\"historyContainer\">\n                    <p style=\"color: #000; font-weight: 700; text-align: center; padding: 20px;\">No operations performed yet<\/p>\n                <\/div>\n            <\/div>\n        <\/div>\n\n        <!-- Toast Notification -->\n        <div class=\"gp-binary-to-text-toast\" id=\"toast\"><\/div>\n    <\/div>\n\n    <script>\n        \/\/ Global variables\n        let history = [];\n        let historyIndex = -1;\n        let operationHistory = [];\n        \n        \/\/ Rotating tips\n        const tips = [\n            \"Perfect for decoding binary messages, understanding computer data storage, programming education, and cryptography analysis.\",\n            \"Binary code represents all computer data - every character, image, and program is stored as sequences of 1s and 0s.\",\n            \"UTF-8 encoding supports international characters while ASCII only handles basic English characters (0-127).\",\n            \"Strict mode ensures only valid binary digits are processed, while flexible mode attempts to parse imperfect input.\",\n            \"8-bit grouping is standard for most text, but 7-bit ASCII and 16-bit Unicode are also supported.\",\n            \"Auto-detection analyzes your input format and applies the most appropriate conversion settings.\",\n            \"Non-printable characters include control codes and special symbols that don't display as regular text.\",\n            \"Little vs Big Endian determines the byte order - important for multi-byte character encodings.\"\n        ];\n        \n        let currentTipIndex = 0;\n        \n        \/\/ Rotate tips every 5 seconds\n        setInterval(() => {\n            currentTipIndex = (currentTipIndex + 1) % tips.length;\n            document.getElementById('rotatingTip').textContent = tips[currentTipIndex];\n        }, 5000);\n\n        \/\/ Initialize\n        document.addEventListener('DOMContentLoaded', function() {\n            const inputText = document.getElementById('inputText');\n            inputText.addEventListener('input', updateStats);\n            inputText.addEventListener('input', debounce(updateLivePreview, 300));\n            inputText.addEventListener('input', debounce(validateInput, 300));\n            \n            \/\/ Add event listeners for all controls\n            ['encoding', 'bitGroup', 'separator', 'endianness', 'strictMode', 'showNonPrintable', 'ignoreErrors', 'showBreakdown'].forEach(id => {\n                const element = document.getElementById(id);\n                if (element) {\n                    element.addEventListener('change', updateLivePreview);\n                    element.addEventListener('input', debounce(updateLivePreview, 300));\n                }\n            });\n            \n            \/\/ Load sample data\n            inputText.value = `01001000 01100101 01101100 01101100 01101111 00100000 01010111 01101111 01110010 01101100 01100100 00100001\n01000010 01101001 01101110 01100001 01110010 01111001 00100000 01110100 01101111 00100000 01010100 01100101 01111000 01110100`;\n            updateStats();\n            updateLivePreview();\n            validateInput();\n        });\n\n        \/\/ Debounce function\n        function debounce(func, wait) {\n            let timeout;\n            return function executedFunction(...args) {\n                const later = () => {\n                    clearTimeout(timeout);\n                    func(...args);\n                };\n                clearTimeout(timeout);\n                timeout = setTimeout(later, wait);\n            };\n        }\n\n        \/\/ Validate binary input\n        function validateInput() {\n            const inputText = document.getElementById('inputText').value;\n            const validation = document.getElementById('inputValidation');\n            \n            if (!inputText.trim()) {\n                validation.textContent = 'Enter binary code to see validation status...';\n                validation.className = 'gp-binary-to-text-validation';\n                return;\n            }\n\n            const strictMode = document.getElementById('strictMode').checked;\n            const binaryPattern = strictMode ? \/^[01\\s\\-,\\n\\r]+$\/ : \/^[01\\s\\-,\\n\\r.]+$\/;\n            \n            if (!binaryPattern.test(inputText)) {\n                validation.textContent = 'Invalid characters detected! Binary should only contain 0s, 1s, and separators.';\n                validation.className = 'gp-binary-to-text-validation invalid';\n                return;\n            }\n\n            \/\/ Count binary digits\n            const binaryDigits = inputText.replace(\/[^01]\/g, '');\n            const totalChars = inputText.replace(\/\\s\/g, '').length;\n            \n            if (binaryDigits.length === 0) {\n                validation.textContent = 'No binary digits found in input.';\n                validation.className = 'gp-binary-to-text-validation invalid';\n                return;\n            }\n\n            const bitGroup = document.getElementById('bitGroup').value;\n            const expectedBits = bitGroup === 'auto' ? 8 : parseInt(bitGroup);\n            \n            if (binaryDigits.length % expectedBits !== 0) {\n                validation.textContent = `Warning: ${binaryDigits.length} bits is not divisible by ${expectedBits}. Some data may be incomplete.`;\n                validation.className = 'gp-binary-to-text-validation';\n            } else {\n                validation.textContent = `\u2713 Valid binary input: ${binaryDigits.length} bits (${binaryDigits.length \/ expectedBits} bytes)`;\n                validation.className = 'gp-binary-to-text-validation valid';\n            }\n        }\n\n        \/\/ Parse binary input based on settings\n        function parseBinaryInput(inputText) {\n            const separator = document.getElementById('separator').value;\n            const bitGroup = document.getElementById('bitGroup').value;\n            \n            \/\/ Clean input\n            let cleanInput = inputText.trim();\n            \n            \/\/ Split based on separator\n            let binaryGroups = [];\n            \n            switch (separator) {\n                case 'space':\n                    binaryGroups = cleanInput.split(\/\\s+\/);\n                    break;\n                case 'dash':\n                    binaryGroups = cleanInput.split('-');\n                    break;\n                case 'comma':\n                    binaryGroups = cleanInput.split(',');\n                    break;\n                case 'newline':\n                    binaryGroups = cleanInput.split(\/\\n+\/);\n                    break;\n                case 'none':\n                    \/\/ Split into groups based on bit length\n                    const bits = bitGroup === 'auto' ? 8 : parseInt(bitGroup);\n                    const binaryDigits = cleanInput.replace(\/[^01]\/g, '');\n                    for (let i = 0; i < binaryDigits.length; i += bits) {\n                        binaryGroups.push(binaryDigits.substr(i, bits));\n                    }\n                    break;\n                default: \/\/ auto\n                    \/\/ Try to detect separator\n                    if (cleanInput.includes(' ')) {\n                        binaryGroups = cleanInput.split(\/\\s+\/);\n                    } else if (cleanInput.includes('-')) {\n                        binaryGroups = cleanInput.split('-');\n                    } else if (cleanInput.includes(',')) {\n                        binaryGroups = cleanInput.split(',');\n                    } else if (cleanInput.includes('\\n')) {\n                        binaryGroups = cleanInput.split(\/\\n+\/);\n                    } else {\n                        \/\/ Continuous binary - split by bit group\n                        const bits = bitGroup === 'auto' ? 8 : parseInt(bitGroup);\n                        const binaryDigits = cleanInput.replace(\/[^01]\/g, '');\n                        for (let i = 0; i < binaryDigits.length; i += bits) {\n                            binaryGroups.push(binaryDigits.substr(i, bits));\n                        }\n                    }\n                    break;\n            }\n            \n            \/\/ Clean and validate groups\n            return binaryGroups.map(group => group.replace(\/[^01]\/g, '')).filter(group => group.length > 0);\n        }\n\n        \/\/ Convert binary to text\n        function binaryToText(binaryGroups) {\n            const encoding = document.getElementById('encoding').value;\n            const endianness = document.getElementById('endianness').value;\n            const showNonPrintable = document.getElementById('showNonPrintable').checked;\n            const ignoreErrors = document.getElementById('ignoreErrors').checked;\n            \n            let result = '';\n            let breakdown = [];\n            let errors = 0;\n            let printableCount = 0;\n            let unicodeCount = 0;\n            \n            for (let i = 0; i < binaryGroups.length; i++) {\n                let binaryGroup = binaryGroups[i];\n                \n                if (binaryGroup.length === 0) continue;\n                \n                try {\n                    \/\/ Handle endianness for multi-byte\n                    if (endianness === 'little' &#038;&#038; binaryGroup.length > 8) {\n                        \/\/ Reverse byte order for little endian\n                        const bytes = [];\n                        for (let j = 0; j < binaryGroup.length; j += 8) {\n                            bytes.push(binaryGroup.substr(j, 8));\n                        }\n                        binaryGroup = bytes.reverse().join('');\n                    }\n                    \n                    const charCode = parseInt(binaryGroup, 2);\n                    let char;\n                    \n                    switch (encoding) {\n                        case 'ascii':\n                            if (charCode > 127) {\n                                if (ignoreErrors) {\n                                    char = '?';\n                                    errors++;\n                                } else {\n                                    throw new Error(`ASCII value ${charCode} out of range`);\n                                }\n                            } else {\n                                char = String.fromCharCode(charCode);\n                            }\n                            break;\n                        case 'utf16':\n                            char = String.fromCharCode(charCode);\n                            if (charCode > 127) unicodeCount++;\n                            break;\n                        case 'latin1':\n                            if (charCode > 255) {\n                                if (ignoreErrors) {\n                                    char = '?';\n                                    errors++;\n                                } else {\n                                    throw new Error(`Latin-1 value ${charCode} out of range`);\n                                }\n                            } else {\n                                char = String.fromCharCode(charCode);\n                            }\n                            break;\n                        default: \/\/ utf8\n                            char = String.fromCharCode(charCode);\n                            if (charCode > 127) unicodeCount++;\n                            break;\n                    }\n                    \n                    \/\/ Check if character is printable\n                    const isPrintable = charCode >= 32 && charCode <= 126;\n                    if (isPrintable) printableCount++;\n                    \n                    \/\/ Handle non-printable characters\n                    if (!isPrintable &#038;&#038; charCode !== 10 &#038;&#038; charCode !== 13 &#038;&#038; charCode !== 9) {\n                        if (showNonPrintable) {\n                            char = `[${charCode}]`;\n                        } else if (charCode < 32) {\n                            \/\/ Control characters\n                            char = '';\n                        }\n                    }\n                    \n                    result += char;\n                    \n                    \/\/ Add to breakdown\n                    breakdown.push({\n                        binary: binaryGroup,\n                        decimal: charCode,\n                        hex: '0x' + charCode.toString(16).toUpperCase().padStart(2, '0'),\n                        char: isPrintable ? char : `[${charCode}]`,\n                        isPrintable: isPrintable\n                    });\n                    \n                } catch (error) {\n                    errors++;\n                    if (!ignoreErrors) {\n                        throw error;\n                    }\n                    breakdown.push({\n                        binary: binaryGroup,\n                        decimal: 'ERROR',\n                        hex: 'ERROR',\n                        char: '?',\n                        isPrintable: false\n                    });\n                }\n            }\n            \n            return {\n                text: result,\n                breakdown: breakdown,\n                stats: {\n                    errors: errors,\n                    printableCount: printableCount,\n                    unicodeCount: unicodeCount\n                }\n            };\n        }\n\n        \/\/ Update live preview\n        function updateLivePreview() {\n            const inputText = document.getElementById('inputText').value;\n            if (!inputText.trim()) {\n                document.getElementById('livePreview').textContent = 'Live preview will appear here...';\n                return;\n            }\n\n            try {\n                const binaryGroups = parseBinaryInput(inputText.substring(0, 200)); \/\/ Preview first 200 chars\n                const result = binaryToText(binaryGroups.slice(0, 10)); \/\/ Preview first 10 groups\n                \n                let preview = result.text;\n                if (binaryGroups.length > 10) {\n                    preview += '\\n... (showing first 10 groups)';\n                }\n                \n                document.getElementById('livePreview').textContent = preview || '(No visible characters)';\n            } catch (error) {\n                document.getElementById('livePreview').textContent = 'Error: ' + error.message;\n            }\n        }\n\n        \/\/ Main conversion function\n        function convertBinary() {\n            const inputText = document.getElementById('inputText').value;\n            const outputText = document.getElementById('outputText');\n            const breakdownDiv = document.getElementById('detailedBreakdown');\n            \n            if (!inputText.trim()) {\n                outputText.value = '';\n                breakdownDiv.innerHTML = '';\n                breakdownDiv.style.display = 'none';\n                updateStats();\n                showToast('Please enter binary code first!', 'error');\n                return;\n            }\n\n            \/\/ Save to history\n            saveToHistory(inputText);\n            \n            try {\n                const binaryGroups = parseBinaryInput(inputText);\n                const result = binaryToText(binaryGroups);\n                \n                outputText.value = result.text;\n                \n                \/\/ Show detailed breakdown if enabled\n                if (document.getElementById('showBreakdown').checked && result.breakdown.length > 0) {\n                    let breakdownHTML = '<strong>Character Breakdown:<\/strong>\\n\\n';\n                    result.breakdown.forEach((item, index) => {\n                        const status = item.isPrintable ? '\u2713' : '!';\n                        breakdownHTML += `${index + 1}. ${item.binary} \u2192 ${item.char} (Dec: ${item.decimal}, Hex: ${item.hex}) ${status}\\n`;\n                    });\n                    breakdownDiv.textContent = breakdownHTML;\n                    breakdownDiv.style.display = 'block';\n                } else {\n                    breakdownDiv.style.display = 'none';\n                }\n                \n                updateStats(result.stats, binaryGroups.length);\n                \n                \/\/ Add to operation history\n                const operation = {\n                    type: `Binary \u2192 Text (${document.getElementById('encoding').value.toUpperCase()})`,\n                    timestamp: new Date().toLocaleTimeString(),\n                    inputBits: inputText.replace(\/[^01]\/g, '').length,\n                    outputChars: result.text.length,\n                    errors: result.stats.errors,\n                    originalText: inputText\n                };\n                addToOperationHistory(operation);\n                \n                showToast('Binary converted to text successfully!');\n                \n            } catch (error) {\n                outputText.value = '';\n                breakdownDiv.style.display = 'none';\n                updateStats();\n                showToast('Conversion failed: ' + error.message, 'error');\n            }\n        }\n\n        \/\/ Validate binary function\n        function validateBinary() {\n            const inputText = document.getElementById('inputText').value;\n            \n            if (!inputText.trim()) {\n                showToast('Please enter binary code to validate!', 'error');\n                return;\n            }\n\n            try {\n                const binaryGroups = parseBinaryInput(inputText);\n                const result = binaryToText(binaryGroups);\n                \n                let message = `Validation Complete: ${binaryGroups.length} groups processed`;\n                if (result.stats.errors > 0) {\n                    message += `, ${result.stats.errors} errors found`;\n                    showToast(message, 'error');\n                } else {\n                    message += ', no errors detected';\n                    showToast(message);\n                }\n                \n            } catch (error) {\n                showToast('Validation failed: ' + error.message, 'error');\n            }\n        }\n\n        \/\/ Update statistics\n        function updateStats(conversionStats = null, groupCount = 0) {\n            const inputText = document.getElementById('inputText').value;\n            const outputText = document.getElementById('outputText').value;\n            \n            const totalBits = inputText.replace(\/[^01]\/g, '').length;\n            const outputChars = outputText.length;\n            \n            let validBytes = Math.floor(totalBits \/ 8);\n            let errorCount = 0;\n            let printableChars = 0;\n            let unicodeChars = 0;\n            \n            if (conversionStats) {\n                errorCount = conversionStats.errors;\n                printableChars = conversionStats.printableCount;\n                unicodeChars = conversionStats.unicodeCount;\n                validBytes = groupCount;\n            }\n            \n            \/\/ Animate number changes\n            animateNumber('totalBits', totalBits);\n            animateNumber('validBytes', validBytes);\n            animateNumber('outputChars', outputChars);\n            animateNumber('errorCount', errorCount);\n            animateNumber('printableChars', printableChars);\n            animateNumber('unicodeChars', unicodeChars);\n        }\n\n        \/\/ Animate number changes\n        function animateNumber(elementId, newValue) {\n            const element = document.getElementById(elementId);\n            const currentValue = parseInt(element.textContent) || 0;\n            \n            if (currentValue !== newValue) {\n                element.classList.add('gp-binary-to-text-pulse');\n                setTimeout(() => {\n                    element.textContent = newValue;\n                    element.classList.remove('gp-binary-to-text-pulse');\n                }, 250);\n            }\n        }\n\n        \/\/ Copy to clipboard\n        async function copyToClipboard() {\n            const outputText = document.getElementById('outputText').value;\n            if (!outputText) {\n                showToast('Nothing to copy!', 'error');\n                return;\n            }\n            \n            try {\n                await navigator.clipboard.writeText(outputText);\n                showToast('Copied to clipboard!');\n            } catch (err) {\n                \/\/ Fallback for older browsers\n                const textarea = document.getElementById('outputText');\n                textarea.select();\n                document.execCommand('copy');\n                showToast('Copied to clipboard!');\n            }\n        }\n\n        \/\/ Download result\n        function downloadResult() {\n            const outputText = document.getElementById('outputText').value;\n            if (!outputText) {\n                showToast('Nothing to download!', 'error');\n                return;\n            }\n            \n            const blob = new Blob([outputText], { type: 'text\/plain; charset=utf-8' });\n            const url = URL.createObjectURL(blob);\n            const a = document.createElement('a');\n            a.href = url;\n            a.download = 'decoded-text.txt';\n            document.body.appendChild(a);\n            a.click();\n            document.body.removeChild(a);\n            URL.revokeObjectURL(url);\n            \n            showToast('File downloaded!');\n        }\n\n        \/\/ Copy output to input\n        function copyToInput() {\n            const outputText = document.getElementById('outputText').value;\n            if (!outputText) {\n                showToast('Nothing to copy!', 'error');\n                return;\n            }\n            \n            \/\/ Convert text back to binary for input\n            const encoding = document.getElementById('encoding').value;\n            let binaryResult = '';\n            \n            for (let char of outputText) {\n                const charCode = char.charCodeAt(0);\n                const binary = charCode.toString(2).padStart(8, '0');\n                binaryResult += binary + ' ';\n            }\n            \n            document.getElementById('inputText').value = binaryResult.trim();\n            updateStats();\n            updateLivePreview();\n            validateInput();\n            showToast('Text converted back to binary in input!');\n        }\n\n        \/\/ Clear input\n        function clearInput() {\n            const inputText = document.getElementById('inputText');\n            saveToHistory(inputText.value);\n            inputText.value = '';\n            document.getElementById('outputText').value = '';\n            document.getElementById('detailedBreakdown').style.display = 'none';\n            updateStats();\n            updateLivePreview();\n            validateInput();\n            showToast('Input cleared!');\n        }\n\n        \/\/ History management\n        function saveToHistory(text) {\n            if (text && (history.length === 0 || history[history.length - 1] !== text)) {\n                history.push(text);\n                historyIndex = history.length - 1;\n                \n                \/\/ Keep only last 20 entries\n                if (history.length > 20) {\n                    history.shift();\n                    historyIndex--;\n                }\n            }\n        }\n\n        \/\/ Undo action\n        function undoAction() {\n            if (historyIndex > 0) {\n                historyIndex--;\n                document.getElementById('inputText').value = history[historyIndex];\n                updateStats();\n                updateLivePreview();\n                validateInput();\n                showToast('Undo successful!');\n            } else {\n                showToast('Nothing to undo!', 'error');\n            }\n        }\n\n        \/\/ Redo action\n        function redoAction() {\n            if (historyIndex < history.length - 1) {\n                historyIndex++;\n                document.getElementById('inputText').value = history[historyIndex];\n                updateStats();\n                updateLivePreview();\n                validateInput();\n                showToast('Redo successful!');\n            } else {\n                showToast('Nothing to redo!', 'error');\n            }\n        }\n\n        \/\/ Add to operation history\n        function addToOperationHistory(operation) {\n            operationHistory.unshift(operation);\n            \n            \/\/ Keep only last 10 operations\n            if (operationHistory.length > 10) {\n                operationHistory.pop();\n            }\n            \n            updateOperationHistoryDisplay();\n        }\n\n        \/\/ Update operation history display\n        function updateOperationHistoryDisplay() {\n            const container = document.getElementById('historyContainer');\n            \n            if (operationHistory.length === 0) {\n                container.innerHTML = '<p style=\"color: #000; font-weight: 700; text-align: center; padding: 20px;\">No operations performed yet<\/p>';\n                return;\n            }\n            \n            container.innerHTML = operationHistory.map(op => `\n                <div class=\"gp-binary-to-text-history-item\">\n                    <div class=\"gp-binary-to-text-history-text\">\n                        ${op.type} at ${op.timestamp} (${op.inputBits} bits \u2192 ${op.outputChars} chars${op.errors ? `, ${op.errors} errors` : ''})\n                    <\/div>\n                    <button class=\"gp-binary-to-text-history-restore\" onclick=\"restoreFromHistory('${op.originalText.replace(\/'\/g, \"\\\\'\")}')\">\n                        Restore\n                    <\/button>\n                <\/div>\n            `).join('');\n        }\n\n        \/\/ Restore from history\n        function restoreFromHistory(text) {\n            document.getElementById('inputText').value = text.replace(\/\\\\'\/g, \"'\");\n            updateStats();\n            updateLivePreview();\n            validateInput();\n            showToast('Restored from history!');\n        }\n\n        \/\/ Show toast notification\n        function showToast(message, type = 'success') {\n            const toast = document.getElementById('toast');\n            toast.textContent = message;\n            toast.className = `gp-binary-to-text-toast show ${type}`;\n            \n            setTimeout(() => {\n                toast.classList.remove('show');\n            }, 3000);\n        }\n\n        \/\/ Keyboard shortcuts\n        document.addEventListener('keydown', function(e) {\n            if (e.ctrlKey || e.metaKey) {\n                switch (e.key) {\n                    case 'Enter':\n                        e.preventDefault();\n                        convertBinary();\n                        break;\n                    case 'z':\n                        if (e.shiftKey) {\n                            e.preventDefault();\n                            redoAction();\n                        } else {\n                            e.preventDefault();\n                            undoAction();\n                        }\n                        break;\n                    case 'k':\n                        e.preventDefault();\n                        clearInput();\n                        break;\n                }\n            }\n        });\n    <\/script>\n<\/body>\n<\/html>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Binary to Text Tool 01\u2192A Binary to Text Convert binary code to readable text with multiple encoding formats and advanced &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Binary to Text\" class=\"read-more button\" href=\"https:\/\/vijaypandit.in\/?page_id=340#more-340\" aria-label=\"More on Binary to Text\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-340","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/vijaypandit.in\/index.php?rest_route=\/wp\/v2\/pages\/340","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vijaypandit.in\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/vijaypandit.in\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/vijaypandit.in\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vijaypandit.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=340"}],"version-history":[{"count":2,"href":"https:\/\/vijaypandit.in\/index.php?rest_route=\/wp\/v2\/pages\/340\/revisions"}],"predecessor-version":[{"id":344,"href":"https:\/\/vijaypandit.in\/index.php?rest_route=\/wp\/v2\/pages\/340\/revisions\/344"}],"wp:attachment":[{"href":"https:\/\/vijaypandit.in\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}