APDU Commands Reference & Status Word Lookup
Complete ISO 7816-4 APDU status word reference. Search any SW1 SW2 code — from the ubiquitous 9000 (success) to the dreaded 6A82 (file not found). Every smart card developer's daily debugging companion.
Quick search:
9000 Success
6A82 File not found
61XX Data available
6CXX Wrong Le
63CX PIN failed
69XX Security
6D00 Bad INS
6E00 Bad CLA
67XX Wrong length
6B00 Bad offset
| SW1 SW2 | Type | Meaning | Debugging Notes |
|---|---|---|---|
| 90 00 | Success | Command completed successfully. Normal ending. | The only response you want to see. No further action needed. |
| 61 XX | Data Ready | Command processed; XX bytes of response data available. SW2 = available byte count. | T=0 only. Issue GET RESPONSE (INS=C0) with Le set to SW2 value to retrieve data. T=1 does not return this — data is included directly. |
| 62 00 | Warning | Warning: no information given. Non-volatile memory state changed. | Command executed but EEPROM/Flash state was altered. Check persistent data. |
| 62 82 | Warning | End of file reached before reading Le bytes. | Reduce the offset or Le parameter. Check actual file size. |
| 62 83 | Warning | Selected file is deactivated. | Reactivate the file or select a different one. |
| 63 00 | Warning | Verification failed. PIN or password incorrect. | Prompt user to re-enter PIN. |
| 63 CX | Warning | Verification failed. X retries remaining. X=0 means locked. | Tell user remaining attempts. If X=0, use RESET RETRY COUNTER (PUK unlock). |
| 65 81 | Error | Memory failure. EEPROM/Flash write operation failed. | Card memory may be worn out. Try another card or memory location. |
| 67 00 | Error | Wrong length. Lc or Le field incorrect. | Verify the Lc byte matches the actual length of the Data field. Check CLA encoding of extended Lc/Le. |
| 68 00 | Error | CLA not supported. Logical channel not available. | Check the CLA byte. Try without logical channel bits (CLA=00 or 04). |
| 68 81 | Error | Logical channel not supported. | Card does not support MANAGE CHANNEL. Use only channel 0. |
| 68 82 | Error | Secure messaging not supported. | SM bit in CLA is set but card doesn't support it. Clear SM bits (0x0C) in CLA. |
| 69 00 | Error | Command not allowed. | Current card state prohibits this command. |
| 69 81 | Error | Command incompatible with file structure. | You used READ BINARY on a record file, or READ RECORD on a transparent file. Use the correct read command. |
| 69 82 | Error | Security status not satisfied. | PIN not verified or authentication not performed. Execute VERIFY or EXTERNAL AUTHENTICATE first. |
| 69 83 | Error | Authentication method blocked. | PIN or key is locked. Use PUK or administrative key to unlock. |
| 69 84 | Error | Referenced data (key/PIN) invalid. | The key reference or PIN ID does not exist on this card. |
| 69 85 | Error | Conditions of use not satisfied. | Time window, count limit, or amount limit not met. |
| 69 86 | Error | Command not allowed — no current EF. | You must SELECT a file before reading or writing. |
| 6A 80 | Error | Incorrect parameters in data field. | Command data contains invalid values. |
| 6A 81 | Error | Function not supported. | Card does not implement this INS code or this specific operation. |
| 6A 82 | Error | File not found. The specified FID or AID does not exist. | The #1 debugging headache. Double-check the file ID or AID. Try listing available applications first. |
| 6A 83 | Error | Record not found. Record number out of range. | Check the P1 record number in READ/WRITE RECORD. Verify with the AFL records list. |
| 6A 84 | Error | Not enough memory space. | File is full. Delete unnecessary data or use a card with more memory. |
| 6A 88 | Error | Referenced data (key/certificate) not found. | Security environment references a key or certificate that doesn't exist. |
| 6B 00 | Error | Offset outside EF range. P1/P2 parameters incorrect. | The READ/WRITE BINARY offset is past the end of the file. Reduce the offset. |
| 6C XX | Le Hint | Wrong Le; correct Le = XX. SW2 tells you the right value. | Re-issue the command with Le set to SW2. Common with SELECT when FCI is larger than expected. |
| 6D 00 | Error | Instruction code (INS) not supported. | The card doesn't recognize this INS byte. Check the command specification. |
| 6E 00 | Error | Class (CLA) not supported. | The CLA byte is rejected. Check logical channel and SM bits. |
| 6F 00 | Error | Internal exception / checking error. Unknown card internal error. | Card may be in an inconsistent state. Try a cold reset. If persistent, card may be damaged. |
APDU Command Structure Overview
# C-APDU (Command APDU)
CLA INS P1 P2 [Lc] [Data] [Le]
# R-APDU (Response APDU)
[Response Data] SW1 SW2
# Common INS Codes
A4 = SELECT B0 = READ BINARY D6 = UPDATE BINARY
B2 = READ RECORD E2 = APPEND RECORD 20 = VERIFY
82 = EXTERNAL AUTH 88 = INTERNAL AUTH 84 = GET CHALLENGE
A8 = GET PROCESSING OPTIONS (EMV) AE = GENERATE AC (EMV)
Related: For protocol-level theory, read our ISO 7816 Complete Guide. For payment-specific APDUs, see the EMV Tag Reference.