APDU Command Builder & Parser
Interactive ISO 7816-4 APDU command construction and parsing. Build Case 1/2/3/4 APDUs with precise byte control, or parse raw APDU hex. Supports Extended APDU (3-byte Lc/Le), instant SW1 SW2 lookup, and common command presets for Java Card, GlobalPlatform, and EMV development.
APDU Parameters
Assembled APDU
APDU Command Structure
ISO/IEC 7816-4 defines the Application Protocol Data Unit (APDU) format for smart card commands. Mastering APDU structure is essential for smart card development, testing, and debugging.
Command APDU Format
A command APDU consists of a mandatory 4-byte header and an optional body: CLA (class byte) indicates the command category and security properties. Standard CLA values: 0x00 for non-secure commands, 0x0C for commands using secure messaging (integrity only), 0x80 for GlobalPlatform management commands, 0x84 for SCP03-protected commands. INS (instruction byte) specifies the operation: A4=SELECT, B0=READ BINARY, D6=UPDATE BINARY, B2=READ RECORD, DC=UPDATE RECORD, 20=VERIFY, 24=CHANGE PIN, 88=INTERNAL AUTHENTICATE, 82=EXTERNAL AUTHENTICATE, 84=GET CHALLENGE, AE=GENERATE AC (EMV). P1 and P2 are parameter bytes whose meaning depends on INS.
Body and Le
Lc (1-3 bytes) specifies the length of the command data field. For data longer than 255 bytes, extended length APDUs use a 3-byte Lc. Data is the command payload (e.g., the AID in SELECT, the PIN block in VERIFY). Le (1-3 bytes) specifies the maximum number of bytes expected in the response. If Le is 0x00, the terminal requests up to 256 bytes (or 65536 in extended mode). When the response exceeds Le, the card returns 61XX status, and the terminal issues GET RESPONSE (C0 00 00 XX) to fetch remaining bytes. Use our APDU Debugger to decode response status words.
Send Those APDUs to Real Hardware
Build your command here, then fire it at a card or tag through one of these readers.
Disclosure: As an Amazon Associate, CardWise earns from qualifying purchases at no additional cost to you. This does not affect our recommendations.
ACR122U NFC Reader (~$40) — The most widely supported reader for libnfc/pyscard APDU workflows (~$40).