Skip to content
100% local

Decabit code

Encode and decode the 10-bit constant-weight Decabit telecommand code.

Input
Output

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.

FAQ

What is the Decabit code?
Decabit is a constant-weight 10-bit code that represents each decimal digit with exactly two set bits, historically used in telecommand and remote-metering systems for basic error detection.
What's the difference between keeping and removing padding?
With padding on, every byte becomes a fixed three-digit codeword group covering the full 0-255 range. With it off, leading-zero digits are dropped, so the result is shorter but still decodes back to the same byte.
Why does decoding sometimes show an error?
Decoding checks every 10-bit group against the real Decabit table. A group of the wrong length, or a bit pattern that isn't a valid two-of-ten codeword, is reported with its exact position so you can fix the input.
Does wrapping the output break decoding?
No. Wrapping only inserts line breaks between whole codeword groups (or, for hex output, at any point — hex parsing ignores whitespace), so wrapped output always decodes back correctly.
Is my text uploaded anywhere?
No. Encoding and decoding run entirely in your browser — nothing you type or paste is sent to a server.