← Back to IPerfect.Net

Protocol Tools

CRC and checksums, byte order and floats, Modbus frames — for embedded and IoT work

CRC & checksum calculator

Every common CRC-8/16/32 and simple checksum at once — Modbus, CCITT, XMODEM, Dallas 1-Wire, Sensirion, Ethernet, STM32 — with the bytes in both orders, ready to append to a frame.

Bytes → number

Paste 2, 4 or 8 bytes (or Modbus registers) to read them as int16/32/64 and float32/64 in every byte order — ABCD, DCBA, BADC, CDAB.

Number → bytes

Type a value to get its bytes in each order, as a C array, and the IEEE 754 bit layout for floats.

Frame builder

Build a Modbus request with its CRC (RTU) or MBAP header (TCP), ready to send from a serial terminal or socket tool.

Addresses are 0-based protocol addresses: holding register 40001 is address 0.

Frame decoder

Paste a request or response to check its CRC, name the exception code, and read the registers as int16, uint16 and float32.

CRC Calculator — Picking the Right Variant

A CRC (cyclic redundancy check) is the error-detection code at the end of most serial and radio frames. "CRC-16" alone is not enough to reproduce one: each variant has its own polynomial, start value, bit order and final XOR. If your result does not match a device, the variant is almost always the reason. This calculator runs all common variants at once so you can spot the one that matches.

CRC-16/MODBUSModbus RTU. Poly 0x8005 reflected, init 0xFFFF. Sent low byte first.
CRC-16/CCITT-FALSEPoly 0x1021, init 0xFFFF. Common in bootloaders and custom protocols.
CRC-8/MAXIMDallas/Maxim 1-Wire devices such as the DS18B20 temperature sensor.
CRC-8/SENSIRIONSensirion SHT3x/SHT4x humidity and SCD30 CO₂ sensors — 0xBEEF gives 0x92.
CRC-32Ethernet, ZIP, PNG. The STM32 hardware CRC unit computes CRC-32/MPEG-2 instead.
XOR / LRCNMEA 0183 GPS sentences use XOR; Modbus ASCII and Intel HEX use LRC.

Check value

Every CRC variant is defined with a check value — its result for the ASCII string 123456789. Click "Check string" in the tool to compare against your own implementation: CRC-16/MODBUS must give 0x4B37 and CRC-32 must give 0xCBF43926.

Bytes to Float — Byte Order Explained

A 32-bit float or integer is four bytes, but devices disagree on their order. Naming the bytes A B C D from most to least significant:

Bytes 41 C8 00 00 as ABCD float32 = 25.0; the same value from a CDAB device arrives as 00 00 41 C8

If a reading looks like a tiny number such as 7.2e-41 or a huge one, the byte order is wrong — paste the bytes here and pick the row that makes sense.

Modbus RTU and TCP Frames

A Modbus RTU request is the slave address, a function code, the data, and a CRC-16/MODBUS sent low byte first. Modbus TCP drops the CRC and the slave address moves into a 7-byte MBAP header: transaction ID, protocol ID (always 0), length, and unit ID.

Example: read 10 holding registers from slave 1, starting at address 0

RTU: 01 03 00 00 00 0A C5 CD
TCP: 00 01 00 00 00 06 01 03 00 00 00 0A

Addresses in the frame are 0-based: holding register 40001 is address 0, 40010 is address 9. When a device answers with the function code plus 0x80 (for example 83), the next byte is an exception code — 02 "Illegal Data Address" usually means the register number is off by one or outside the device's map.

Privacy

All calculations run in your browser. The frames and data you paste are never uploaded.

Other Tools on IPerfect.Net