Hamming error-correcting code
Encode data with a Hamming(7,4) code and automatically correct single-bit errors.
Hamming error-correcting code
Hamming code adds a small number of parity bits to a block of data so a single flipped bit can be detected and repaired automatically, with no retransmission needed. This tool implements the classic Hamming(7,4) scheme: every 4 bits of data become a 7-bit codeword carrying 3 parity bits, encoded or decoded entirely in your browser.
Switch direction with the Direction option. Encode turns your data into codewords; Decode & correct takes codewords — possibly with one flipped bit per block, as if picked up over a noisy line — and recovers the original 4 data bits, reporting how many blocks needed a correction. The two directions are inverses, so a swap turns encoded output straight back into decodable input. Data format sets whether the plain-data side is text (UTF-8 bits) or a raw string of 0s and 1s; Codeword format writes each 7-bit codeword as binary digits or as a compact 2-digit hex byte. Batch mode treats each line as an independent record, so you can encode or decode many short messages at once with totals for the whole set.
Short binary input is padded with zero bits to a full 4-bit block before encoding; decoding drops any leftover bits that can't complete a byte when rebuilding text. CRLF and LF line endings in batch mode are treated the same way. If a codeword isn't 7 valid binary digits or a hex byte in range, or binary input holds anything but 0 and 1, the tool names the exact line and what's wrong instead of guessing.
Everything runs locally — your data is never uploaded. Copy the result, download it as a .txt file, or send the output back into the input to encode a message and then decode it in two steps to see the correction happen.