APDU Response Codes
ProtocolTwo-byte status words (SW1-SW2) appended to every APDU response indicating success (9000), warnings, or error conditions as defined by ISO 7816-4.
What Are APDU Response Codes?
apdu-response-codes/" class="glossary-term-link" data-term="APDU response codes" data-definition="Two-byte status codes in APDU responses." data-category="Protocol">APDU response codes -- also called status words -- are two-byte values (SW1-SW2) appended to every response APDU returned by a smart card. They indicate whether a command succeeded, completed with a warning, or failed with a specific error condition. Every smart card interaction, from selecting an application to verifying a PIN, ends with a status word that the host software must interpret before proceeding.
The status word system is defined by ISO 7816-4 and extended by application-specific standards such as EMV, GlobalPlatform, and ICAO 9303 for ePassports.
Status Word Structure
The two bytes SW1 and SW2 are interpreted together:
| SW1 Range | Meaning |
|---|---|
| 90 | Success (SW2 = 00) |
| 61 | Success; SW2 bytes of response data still available (use GET RESPONSE) |
| 62-63 | Warning (non-volatile memory unchanged / changed) |
| 64-66 | Execution error |
| 67 | Wrong length |
| 68 | Functions in CLA not supported |
| 69 | Command not allowed |
| 6A | Wrong parameters P1-P2 |
| 6B-6F | Various errors |
Common Status Words
Engineers encounter these status words most frequently when developing smart card applications:
- 9000 -- command executed successfully without error
- 6100 -- response data available; issue GET RESPONSE with Le = SW2
- 6283 -- selected file deactivated (invalidated)
- 6982 -- security status not satisfied (authentication required)
- 6983 -- authentication method blocked (PIN locked)
- 6984 -- reference data not usable (key corrupted)
- 6985 -- conditions of use not satisfied
- 6A82 -- file or application not found
- 6A86 -- incorrect parameters P1-P2
- 6D00 -- instruction code not supported or invalid
- 6E00 -- class (CLA) not supported
Handling in Application Code
Robust smart card middleware must check the status word after every APDU exchange. A common pattern is to treat SW1=61 as a signal to issue a GET RESPONSE command to retrieve remaining data, and to map error codes to domain-specific exceptions. For SCP03 secure channels, status words are also covered by the session MAC, so tampering with the response code is detectable.
When debugging card interactions, the ATR parser and APDU trace tools are invaluable for correlating status words with the command sequence that produced them.
Related Content
Understanding ISO 7816
Standards & Protocols…if no response expected) Response APDUs append a two-byte status word (SW1 SW2). 90 00 means success; 6A 82 means file not…
ISO 14443 Deep Dive
Standards & Protocols…uses the same AID format, and responses carry the same SW1 SW2 status words. This design means a dual-interface card can…
EMV Payment Card Architecture
Standards & Protocols…verification VERIFY (PIN), signature Verify PIN; return SW 7. Risk management Check velocity, floor limits N/A 8.…
ISO 7816 Parts Guide
Standards & Protocols…command data Le Expected length of response data SW1 SW2 Status word — 90 00 = success Use the APDU Builder to construct and…
FIDO2 and Smart Cards
Standards & Protocols…Le = 00 Response APDU: Data = CBOR-encoded response map SW1 SW2 = 90 00 (success) or 6F XX (error) The CTAP2 command byte…
PKI on Smart Cards
Standards & Protocols…ALG=11 (RSA-2048) Response: 7F 49 ... (public key in TLV) SW1 SW2: 90 00 For ECC P-256 (ALG=06): Command: 00 47 00 9A 05 AC…
EMV Contactless Kernel Deep Dive
Standards & Protocols…80 A8 00 00 02 83 00 00 Response: 80 0A ... (AIP + AFL) SW1 SW2: 90 00 Kernel 2 (Mastercard) Flow Kernel 2 implements…
Secure Channel Protocols (SCP02/SCP03)
Standards & Protocols…bytes) Card Challenge (6 bytes) Card Cryptogram (8 bytes) SW1 SW2: 90 00 # Compute host cryptogram, verify card cryptogram #…
คำถามที่พบบ่อย
The smart card glossary is a comprehensive reference of technical terms, acronyms, and concepts used in smart card technology. It covers protocols (APDU, T=0, T=1), security (Common Criteria, EAL, HSM), hardware (SE, EEPROM, contact pad), and applications (EMV, ePassport, eSIM). It serves developers, product managers, and engineers.
Yes. SmartCardFYI provides glossary definitions in 15 languages including English, Korean, Japanese, Chinese, Spanish, Portuguese, Hindi, Arabic, French, Russian, German, Turkish, Vietnamese, Indonesian, and Thai.