Modbus RTU CRC-16 Calculator
Generate Modbus RTU CRC-16 checksums in exact Lo-Byte / Hi-Byte serial wire order, build test frames for Function Codes 03/06/16, or validate captured RS-485 packets.
Modbus RTU PDU / ADU Hex Input
Enter Slave ID + Function Code + Data bytes in hex (without CRC, or paste a full captured frame to verify)
Slave 1, Function 03, Start 0x0000, Qty 10 → CRC C5 CD
Accepts space-separated (01 03 00 00 00 0A), comma/0x-prefixed, or continuous hex strings.
IEC 61131-3 Structured Text CRC-16 Implementation
CRC := 16#FFFF;
FOR idx := 0 TO FrameLen - 1 DO
CRC := CRC XOR BYTE_TO_WORD(Buffer[idx]);
FOR bit := 0 TO 7 DO
IF (CRC AND 16#0001) <> 0 THEN
CRC := SHR(CRC, 1) XOR 16#A001;
ELSE
CRC := SHR(CRC, 1);
END_IF;
END_FOR;
END_FOR;
CRC_Lo := WORD_TO_BYTE(CRC AND 16#00FF);
CRC_Hi := WORD_TO_BYTE(SHR(CRC, 8));Frequently Asked Questions
Why are the two CRC-16 bytes reversed on a Modbus RTU RS-485 wire?+
While Modbus register payloads (such as 16-bit Holding Registers) are transmitted Big-Endian (High Byte first), the Modbus over Serial Line specification mandates that the 16-bit CRC checksum be appended Little-Endian: Low-Order Byte first, followed by the High-Order Byte. For example, CRC value 0xCDC5 is transmitted on the wire as C5 CD.
What polynomial and initial value does Modbus RTU CRC-16 use?+
Modbus RTU initializes the 16-bit CRC register to 0xFFFF and shifts right bit-by-bit using the reflected polynomial 0xA001 (the bit-reversal of 0x8005), with no final XOR.
How can I verify a complete Modbus RTU frame captured from a serial sniffer?+
Paste the entire captured frame—including its trailing two CRC bytes—directly into the calculator. Running the reflected CRC-16 algorithm across a valid message plus its Lo/Hi CRC bytes always yields a residual of 0x0000.
Does Modbus TCP use a CRC-16 checksum?+
No. Modbus TCP encapsulates the Modbus PDU inside a standard TCP/IP packet with a 7-byte MBAP header and relies on Ethernet FCS and TCP checksums instead of appending a 2-byte RTU CRC.
Complete PLC & Industrial Automation Calculator Suite
Bitwise & Data Formats
Simulate 16-bit INT and 32-bit DINT Masked Move instructions bit-by-bit with clickable mask gates and Structured Text output.
Decode or encode two 16-bit Holding Registers across all 4 endian byte orders (ABCD, CDAB, BADC, DCBA) for 32-bit REAL floats.
Convert between 16/32-bit Binary-Coded Decimal (BCD) thumbwheel words and integer values with invalid A–F nibble fault detection.
Analog I/O & Sensors
Convert raw ADC counts (4000–20000, 6241–31206, 0–27648) and 4–20 mA signals into engineering units with 5-point calibration tables.
Bidirectional Callendar–Van Dusen (°C/°F ↔ Ohms) calculator for PT100 and PT1000 RTDs with Class AA, A, and B tolerance bands.
Convert thermocouple millivolt (mV) readings to process temperature and back with live Cold Junction Compensation (CJC).
Estimate cabinet temperature rise, conductive heat transfer, required cooling fan airflow (CFM), and AC capacity (BTU/hr) for enclosures.
Fieldbus, Motion & Control
Compute polynomial 0xA001 CRC-16 checksums in Little-Endian Lo-Byte / Hi-Byte wire order and validate captured RS-485 frames.
Calculate maximum RS-485 trunk length, Modbus RTU 3.5-character silent interval (t3.5), frame duration, and max polling rate.
Compute synchronous speed, motor slip %, output shaft RPM after gearbox reduction, and target VFD command frequency in Hz.
Verify PLC High-Speed Counter (HSC) kHz input limits from encoder PPR, 1x/2x/4x quadrature decoding, shaft RPM, and linear travel.
Convert Independent (Kp, Ki, Kd) vs. ISA Dependent (Kc, Ti, Td) PID gains and compute FOPDT / Ultimate Gain starting parameters.