APDU Response Codes

Protocole
{# Answer-first lead — frontend-gold-standard §1.1. Expects `lead` (plain text, already resolved by apps.content.leads). Rendered directly under the h1 so the self-contained answer is the first prose a reader, a SERP snippet, or an AI extractor meets. No curated-data gate: the view always supplies either curated content_summary or a computed fallback. #}

Two-byte status words (SW1-SW2) appended to every APDU response indicating success (9000), warnings, or error conditions as defined by ISO 7816-4. It is also written Status Word, SW1 SW2, and SW. The term belongs to the Protocole section of the smart card glossary.

Embed This Widget

Theme


      
    

Widget powered by . Free, no account required.

Also known as: Status Word SW1 SW2 SW

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.

{# FAQ block + FAQPage JSON-LD. Expects `faq_items` = [{"question", "answer"}]. Native
/ (frontend-gold-standard §1.7): the answer text is in the initial HTML and stays reachable with JavaScript disabled, so crawlers and AI extractors read answer-shaped chunks without depending on Alpine. #}

Frequently Asked Questions

What does status word 9000 mean?

9000 is the success status word: the command executed without error and no further response data is pending. It is the value host software checks for before proceeding to the next command in a sequence.

What does 61XX mean in an APDU response?

SW1 of 61 signals success with response data still available on the card. The SW2 byte carries the number of bytes remaining, which the host retrieves by issuing GET RESPONSE with Le set to that value.

How are APDU status word ranges organised?

SW1 partitions the space: 90 is success; 61 is success with data pending; 62 and 63 are warnings, distinguishing non-volatile memory unchanged from changed; 64 through 66 are execution errors; 67 is wrong length; 68 marks functions in the class byte that are not supported; 69 means the command is not allowed; 6A indicates wrong P1-P2 parameters; and 6B through 6F cover the remaining error conditions.

Which standard defines APDU status words?

ISO 7816-4 defines the status word system. Application-specific standards extend it with their own values, including EMV for payment, GlobalPlatform for card management, and ICAO 9303 for ePassports.

What is the smart card glossary and who is it for?

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.

Are the glossary definitions available in other languages?

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.