Windows IOCTL Code Decoder / Encoder

Decode or build a CTL_CODE IOCTL control code

Windows I/O control codes (IOCTLs) are 32-bit values constructed with the CTL_CODE macro defined in wdm.h and winioctl.h. Each code encodes four fields: the device type, the transfer method, the required access, and a function number. User-mode code sends IOCTLs via DeviceIoControl, and kernel-mode drivers receive them as IRP_MJ_DEVICE_CONTROL or IRP_MJ_INTERNAL_DEVICE_CONTROL requests.

Use the Decode tab to paste a hex IOCTL value and see its fields broken out. Use the Encode tab to choose field values and generate the corresponding hex code and CTL_CODE(...) macro call.

Need help developing a Windows driver that handles custom IOCTLs? Our team has 20+ years of experience building kernel-mode drivers. Learn about our driver development services or contact us to discuss your project.

  • What our customers say about us?