Decabit code
Encode and decode the 10-bit constant-weight Decabit telecommand code.
Decabit code
Decabit is the constant-weight 10-bit telecommand code once used in electricity network ripple control and remote metering: each decimal digit from 0 to 9 is a unique pattern of exactly two set bits among ten, so a single flipped bit is always detectable. This tool encodes text, hex or byte data into that Decabit bit pattern, and decodes Decabit code back into readable text, hex or bytes, which is useful for studying the historical scheme, testing telecontrol equipment, or exploring a code with a fixed number of set bits. Decabit's own digit assignment is not published openly, so this tool uses the documented 2-of-10 constant-weight code with digits ordered by their set-bit positions; it will not match a specific vendor's table.
Choose a direction to encode or decode, then pick the input and output format independently: text, hex, or a space-separated list of byte values. Keep zero padding to encode every byte as a fixed three-digit codeword group, which is closer to the historical format and makes byte boundaries predictable; turn it off to drop leading-zero digits and shorten the result. Wrapping breaks a long Decabit code into lines of the width you choose without ever splitting a codeword, so the output stays valid however it is wrapped.
Invalid input is rejected with a specific message: a hex string with an odd number of digits or a character outside 0-9 and a-f, a byte value outside 0-255, or a Decabit codeword that isn't a genuine two-of-ten pattern. Long input is supported up to the site's 10 MB output limit, and CRLF or LF line breaks in the source text are encoded byte-for-byte, so nothing is silently normalized away.
Everything runs locally in your browser. No text, hex or byte data you paste here is ever uploaded or stored on a server. Copy the result, download it as a .txt file, clear the panel, or send the output straight back into the input to decode what you just encoded.