APDU Error Codes (SW1 SW2): Developer Troubleshooting Guide

How do you troubleshoot an APDU error code? Read the last two bytes of the reply: that is the status word SW1 SW2. Then ask who answered: a command with class FF was answered by the ACS reader, anything else by the card. The first byte, SW1, tells you the family of the problem: 61 and 6C are length handling you must react to, 62/63 are warnings, 64/65 are execution errors, and 67 to 6F mean the card refused the command as sent. 6A 82, for example, means the file or application you asked for is not on that card. 63 00 after an ACS FF command means the reader could not carry out the operation.

This page is the diagnosis guide: for each SW1 family it lists what to check first when you sent a command and got that reply. It does not repeat the meaning table; the full ISO/IEC 7816-4 table is on our APDU status words table, and the steps below link to it. It covers the ACS reader commands (pseudo-APDUs), points DESFire 91 xx codes to the DESFire reference, and separates status words from PC/SC error codes such as 0x80100069. BSD Infotech is an independent ACS supplier and integrator, not the manufacturer.

Not yet tested by BSD on hardware. Meanings come from public ISO/IEC 7816-4 summaries, PC/SC Part 3 and the ACS reader manuals (see Sources). The example exchanges are illustrations, not captured replies. The C# helper below was compiled and run by BSD with sample status words on 2 Dec 2026, without a reader.

Most wrong diagnoses come from decoding the wrong thing. Spend one minute on these three checks first.

  1. Is it a status word at all? A status word exists only when the PC/SC call itself succeeded. If SCardTransmit returned anything other than 0, no command reached the card and there is no status word to decode. See the box PC/SC error or status word? below.
  2. Who answered: the reader or the card? Look at the class byte you sent. FF commands (Get Data, Load Keys, General Authenticate, Read Binary on a memory card) are carried out by the ACS reader, so the reader chose the status word, and its meaning can differ between reader models. 00 and other classes go to the card's own operating system. 90 on a DESFire card is a wrapped native command, and the card answers 91 xx. The difference is explained in ACS FF commands vs card APDUs.
  3. Are the bytes the ones you meant? Log the exact command bytes as sent, not the variables that built them. A wrong Lc, a decimal block number written as hex, or a missing Le causes more "mysterious" status words than any card fault.

Then read the reply from the end: the last two bytes are SW1 SW2, everything in front of them is data. On an error there is normally no data at all.

Two layers, two kinds of code

PC/SC error codeAPDU status word
Looks like0x80100069, -2146434967, SCARD_W_REMOVED_CARDTwo bytes at the end of the reply: 90 00, 6A 82, 63 00
Comes fromWindows (winscard.dll and the Smart Card service) or pcsc-liteThe card, or the ACS reader for an FF command
MeansThe call failed: no reader, no card, card removed, sharing violation, buffer too smallThe call worked and the card or reader answered your command
Look it up inPC/SC error codes (SCARD_E_*)This page and the status word table

Always check the return code first, the status word second. Our "which layer is the error from?" section explains the third kind, plain Windows codes such as 1, 6 or 31.

ISO/IEC 7816-4 groups status words by their first byte. The group already tells you where to look, before you know the exact second byte. The public summaries of the standard also note which groups leave the card's memory unchanged: everything from 64 to 6F except 65, while 63 and 65 mean something in memory may have changed. That matters when the failed command was a write.

SW1FamilyCard memoryFirst question to askSection
61, 6CLength handling (61 is a normal result)UnchangedDid my program react before sending anything else?61 / 6C
62WarningUnchangedIs the data I got usable, just shorter or flagged?62 / 63
63WarningMay have changedIs this a counter (63 Cx) or an ACS reader failure (63 00 after FF)?62 / 63, ACS FF
64, 65Execution error64 unchanged, 65 may have changedDid the card lose power or move during the command?64 / 65
67Wrong lengthUnchangedDoes Lc match the data, and is Le present only when it should be?67
68CLA function not supportedUnchangedDoes my class byte ask for a logical channel or secure messaging?68
69Command not allowedUnchangedIs a step missing before this one (select, verify, authenticate)?69
6A, 6BWrong parametersUnchangedDo the AID, file ID, offset or P1-P2 exist on this card?6A, 6B
6D, 6EUnknown INS or CLAUnchangedAm I talking to the card (or application) I think I am?6D / 6E
6FNo precise diagnosisUnchangedDoes it repeat on a fresh connection?6F
91Not ISO: DESFire native statusDepends on the commandWhich DESFire command was it?DESFire 91 xx

If the card's own manual gives a status word a different meaning, the card's manual wins. For FF commands, the ACS manual for your reader model wins.

Symptom: "I sent a SELECT and got 61 1A, and my program reported an error." Or: "READ BINARY returns 6C 0F."

Neither is a failure. Both tell you the exact next command, and both mostly appear with contact cards using the T=0 protocol, where a command cannot carry data in both directions.

  • 61 xx: xx bytes are waiting. Send 00 C0 00 00 xx (GET RESPONSE) immediately. If the reply to that ends in 61 yy again, keep fetching and join the pieces until 90 00.
  • 6C xx: your Le was wrong and xx is the right length. Send the same command again with Le = xx, immediately. PC/SC Part 3 also uses 6C xx for the reader's Get Data (FF CA) when your Le is shorter than the UID.

What to check when it still goes wrong:

  1. Another command slipped in between. A logging call, a second thread or another program that sends a command between the reply and your GET RESPONSE makes the card discard the waiting data. Wrap the pair in SCardBeginTransaction / SCardEndTransaction (see share modes and transactions).
  2. The second command is not identical. After 6C xx, change only Le. If you also change P1-P2, the card may answer 6C again or something else.
  3. Your library already handles it. Some PC/SC wrappers issue GET RESPONSE themselves. If you add your own as well, the card sees an unexpected GET RESPONSE. Check which layer does it, and do it once.
  4. You treated 61 as an error. Any code that tests "SW1 != 90 means failure" breaks on T=0 cards. Test for 61 and 6C before the error branch, as in the call sequence on our APDU page.

The full exchange, step by step, is on the APDU page under T=0 GET RESPONSE.

Symptom: "The command worked, but the reply ends in 62 82", or "VERIFY returned 63 C2".

A warning means the card did something, but not exactly what you asked. Decide case by case whether the data in front of the status word is usable.

ReplyTypical situationWhat to check
62 82READ BINARY or READ RECORD past the end of the fileThe data is valid but shorter than Le. Read the file size from the FCI or the card's manual and stop at the end. On FF CA, PC/SC Part 3 uses it when Le was longer than the UID.
62 81Part of the data may be corruptedRepeat the read once. If it repeats on the same block, record it and treat the card as suspect.
62 83SELECT of a file or application that is deactivatedThe object exists but is switched off. Only the issuer's own process can change that. (DESFire uses it for a deactivated application too, see the DESFire status codes.)
63 CxAfter VERIFY (PIN or code): x tries leftStop. Do not loop. Every further wrong attempt counts down, and at zero the card blocks. Find the correct PIN from the card's owner.
63 81The last write filled the fileThe write succeeded. The file has no room left.
63 00 after a card command"No information given"Check the card's manual for what that command means by it.
63 00 after an ACS FF commandThe ACS manuals define it as "the operation failed"Go to ACS FF commands: key, key location, block number, card type.

Because 63 belongs to the group where memory may have changed, read the data back after a write that returned 63 xx before you assume either success or failure.

Symptom: "A write returned 65 81", or "a command that worked yesterday returns 64 00 today."

Here the card accepted the command but could not complete it. 64 00 means memory is unchanged; 65 xx means memory may have changed, and 65 81 is "memory failure".

  1. Did the card move? A contactless card at the edge of the field can lose power in the middle of a write. Keep it flat on the reader and repeat once on a fresh connection.
  2. Read back what you wrote. After 65 xx the block may hold the old data, the new data or neither. Never repeat a write blindly on a value or counter.
  3. Is the address valid? PC/SC Part 3 lists 65 81 for the reader's General Authenticate when the addressed block "does not exist", for example a block above 3F on a MIFARE Classic 1K card.
  4. Does it repeat on one card only? A memory failure that follows one card across readers points to the card. Stop writing to it and keep it for read tests.

ISO/IEC 7816-4 reserves 66 xx for security-related errors without defining them; if you see one, only the card's manual can explain it.

Symptom: "I sent 00 A4 04 00 07 and six AID bytes and got 67 00."

The card counted the bytes and they did not add up. It is almost always a bug in how the command was built, not a card problem.

  1. Count the data bytes. Lc must equal the number of bytes that follow it (before Le). One missing AID byte gives exactly this reply.
  2. Check the APDU case. A case 3 command (data in, no data out) must not end with Le. A case 1 command has neither Lc nor Le. The four APDU cases show which fields belong to which case.
  3. Check fixed-length commands. Some commands require an exact Lc: the reader's Load Keys needs 06 plus six key bytes, General Authenticate needs 05 plus five bytes.
  4. Extended length. A 00 byte where Lc should be starts an extended-length field. If the card or reader does not support extended APDUs, it answers 67 00 or similar. Use short APDUs unless both manuals say otherwise.

6C xx is the other "wrong length" reply: there the card tells you the right Le. See 61 / 6C.

Symptom: "Every command returns 68 81" or "68 82".

The low bits of the class byte can request a logical channel or secure messaging. The card replies 68 81 (logical channel not supported) or 68 82 (secure messaging not supported) when your CLA asks for something it cannot do.

  1. Print the CLA in hex. 01, 02, 03 select logical channels; values such as 04 or 0C announce secure messaging. For plain interindustry commands use 00.
  2. Reused code from another card. A command copied from a project that used secure messaging carries that CLA with it. Use the class the current card's manual gives.
  3. Memory cards through the reader. PC/SC Part 3 uses 68 00 for "class byte is not correct" on storage-card commands; check that reader commands start with FF.

Symptom: "READ BINARY returns 69 82" or "69 86".

The command is valid, but not in the card's current state. The fix is almost always a missing or wrong step before this command, so look at the command history, not at the failing command alone.

ReplyWhat the card is sayingWhat to check
69 82Security status not satisfiedWhich verify or authenticate step should come first, and did it succeed (90 00) in this session? A reconnect or card reset clears it. Use only keys or PINs you are entitled to; never try values at random.
69 85Conditions of use not satisfiedThe order of commands, for example GET RESPONSE without a preceding 61 xx, or a step the application expects first.
69 86Command not allowed (no current EF)SELECT the file before READ BINARY. A reselected application clears the current file.
69 81Command incompatible with file structureREAD BINARY on a record file, or READ RECORD on a transparent file. Check the file type in its FCI.
69 83Authentication method blockedStop. The retry counter is exhausted. Only the card issuer can help.
69 84Referenced data invalidatedThe key or PIN you referenced is disabled on this card.
69 87, 69 88Secure messaging objects missing or incorrectYour secure messaging layer: MAC, padding, counters. See also 68 82.

On ACS FF commands, the same codes can mean other things. PC/SC Part 3 gives examples per command: for Load Keys, 69 86 means "volatile memory is not available"; for General Authenticate, 69 86 means "key type not known"; for Read Binary, 69 86 means "command not allowed". The ACR1252U and ACR122U manuals themselves document only 63 00 for failure, and the ACR1552U manual "6X XX". So for a reader command, read 69 xx together with the command it answered, as in ACS FF commands. For the MIFARE case, see 63 00, 69 82 and 69 86 after a MIFARE authentication.

Symptom: "I sent 00 A4 04 00 07 D2 76 00 00 85 01 01 00 and got 6A 82."

6A 82 is the most searched status word, and usually the card is right: it does not have what you asked for. Work through this list in order:

  1. Is it the card you think? Check the ATR first (identify a card from its ATR). A bank card, a transport card and an NFC tag carry different applications. A MIFARE Classic or NTAG card has no ISO 7816-4 files at all; for those, the ACS reader translates FF commands instead.
  2. Check the AID byte by byte. Compare it with the application's documentation, including its length. A partial AID only works if the card supports partial selection.
  3. Check P1-P2 of the SELECT. 04 00 selects by AID; 00 0C with two bytes selects by file ID. Selecting a file ID with P1 = 04 finds nothing.
  4. Check the current level. A file ID is often valid only inside its application. Select the application first, then the file.
  5. Is the card personalised yet? A blank card has no application until the issuing step creates it.
ReplyMeaningWhat to check
6A 81Function not supportedOn FF CA: the card has no UID to give, for example a contact card or the SAM slot entry selected instead of the PICC entry. The ACR1552U manual also has the reader answer 6A 81 itself when an APDU is sent to a contactless card that does not support ISO 14443-4.
6A 80Incorrect parameters in the data fieldThe data bytes, for example a malformed TLV or a value out of range.
6A 83Record not foundThe record number in P1 and the record count of the file.
6A 84Not enough memory space in the fileThe write length against the file size.
6A 86, 6A 87Incorrect P1-P2 / Lc inconsistent with P1-P2P1 and P2 against the command definition in the card's manual.
6A 88Referenced data not foundThe key or PIN reference number in P2 (for example in VERIFY).

6B 00: wrong parameters P1-P2

Usually an offset or block number outside the file or memory. Check the offset you computed, and remember that in READ BINARY a set bit 8 in P1 means "short file identifier", not a high offset byte.

6D 00: instruction not supported

The card, or the application currently selected, does not know this INS. Check: is the right application selected (some commands only exist inside it)? Is the card the type you expect? Is the INS byte for this card family, or copied from another card's manual?

6E 00: class not supported

The card does not accept this CLA. Typical causes: a reader command (FF) that your reader model does not handle, so it reaches the card; a DESFire wrapped command (90) sent to a card that is not a DESFire; or an ISO command (00) sent to a card that only uses a proprietary class. Check whether the command is meant for the reader or the card, and which models support it in the ACS manual.

6F 00: no precise diagnosis

The card failed without saying why. Repeat once on a fresh connection (disconnect, present the card again, reconnect). If it repeats, log the exact command, ATR and reader, and compare with the card's manual: some cards use 6F 00 for internal errors such as an unexpected state. Do not retry a write in a loop.

For commands with class FF, the ACS reader firmware writes the status word. ISO/IEC 7816-4 calls 63 00 a warning with "no information given", but the ACS manuals define it plainly for their reader commands: the ACR1252U and ACR122U API manuals list 90 00 for success and 63 00 for "the operation failed", and the ACR1552U reference manual lists any 6X XX as a failure. So after an FF command, treat 63 00 as an error and find out which part of the operation failed.

Command63 00 (or 6X XX on the ACR1552U) usually meansWhat to check
FF CA 00 00 00 Get Data (UID)No card in the field, or the card did not answerCard position, the PICC reader entry (not SAM), and that the reader is in PC/SC mode. PC/SC Part 3 adds 6A 81 when the card has no UID.
FF 82 Load KeysThe reader did not accept the keyLc = 06, six key bytes, P1 = 00, key location 00 or 01.
FF 86 General AuthenticateAuthentication did not succeedKey loaded, same key location, key A (60) or B (61), block number, card type, card movement. Full guide: MIFARE authentication failed.
FF B0 Read BinaryThe read failedBlock in a sector that was authenticated in this session; Le allowed for this card and reader (16 bytes always works).
FF D6 Update BinaryThe write failedAs for Read Binary, plus the access bits. Never write block 0 or a sector trailer.
ACS-specific FF 00 ...The reader rejected the commandThe command bytes in your reader's own manual. These differ by model and firmware.

Three rules for reader commands: the same bytes can give different status words on different ACS models, so log the model and firmware with every result; PC/SC Part 3 also defines codes such as 69 82, 69 86 and 6C xx for these commands, which a reader may use; and the reader's manual wins over any general table. Which commands each model supports: ACR1252U, ACR1552U, ACR122U. A read-only test plan with the expected reply for each command is in our APDU test plan.

If SW1 is 91, the reply is not an ISO status word. It is a MIFARE DESFire card answering a wrapped native command (class 90), and SW2 is the card's own status byte. 91 00 is success and 91 AF means "another frame follows": send 90 AF 00 00 00, it is not an error. The codes you will meet most while debugging are 91 AE (authentication needed or failed), 91 9D (permission denied), 91 F0 (file not found), 91 BE (read beyond the file) and 91 CA (an earlier frame chain was not finished).

Every published code, with what to do, is in the DESFire status code table. DESFire cards also accept a few ISO commands with class 00; those answer with normal ISO status words such as 6A 82, which this page covers.

Illustrations of the reasoning, not captured replies. The bytes are standard commands documented on our linked pages.

SentGotDiagnosisNext step
00 A4 04 00 07 D2 76 00 00 85 01 01 00 (SELECT NDEF application)6A 82The card answered, so the link works. It has no NFC Type 4 application.Check the ATR: a MIFARE Classic or NTAG card is read with FF B0, not with SELECT.
FF CA 00 00 00 (UID)6A 81The reader says the function is not supported for this card or slot.Use the PICC reader entry, not the SAM entry. A contact card has no UID to return.
FF 86 00 00 05 01 00 04 60 0063 00The ACS reader could not authenticate block 04.Load the key again, check location and key type, then the card type. MIFARE authentication diagnosis.
00 B0 00 00 20 (READ BINARY, 32 bytes)6C 0FNot an error: only 15 bytes are available.Resend 00 B0 00 00 0F straight away.
90 60 00 00 00 (DESFire GetVersion)6E 00 or 6D 00The card does not accept the DESFire class or command.The card is not a DESFire. Check the ATR and FF CA 01 00 00 (ATS).
00 B0 00 00 10 right after selecting an application69 86No file is selected.SELECT the file (00 A4 00 0C 02 [FID]), then read.
00 20 00 01 ... (VERIFY)63 C2Wrong PIN, two tries left.Stop. Get the right PIN; do not retry in code.
Any commandSCardTransmit returns 0x80100069No status word: the card was removed.SCARD_W_REMOVED_CARD.

Language: C# 14 on .NET 10, any platform. Prerequisites: none; it works on the byte array that SCardTransmit returns, for example from the Transmit method in our PC/SC programming in C# tutorial. It turns the last two bytes into one of the families above, with a short hint for your log. It takes the class byte you sent, so that 63 00 after an ACS FF command is reported as a reader failure.

Compiled and run without a reader; not yet tested with a reader. BSD built this file for .NET 10 on 2 Dec 2026 (0 warnings, 0 errors) and ran it on sample replies (90 00, 61 1A, 6C 0F, 63 00, 6A 82, 69 82, 6E 00, 91 AE, 63 C2 and a 1-byte reply), each giving the expected group. It has not yet been used with replies from an ACS reader.

// StatusWords.cs: sort an APDU reply's status word into a diagnosis group.
// C# 14, .NET 10. No reader needed. Meanings follow ISO/IEC 7816-4 public summaries
// and the ACS manuals (63 00 = "operation failed" on ACS class FF commands).
namespace Bsd.Pcsc;

public enum SwGroup { Success, MoreData, RetryWithLe, Warning, ExecutionError,
    WrongLength, ClassFunction, NotAllowed, WrongParameters, WrongIns, WrongCla,
    NoDiagnosis, DesfireNative, ReaderFailed, Unknown }

public static class StatusWords
{
    /// <param name="reply">The full reply from SCardTransmit (data + SW1 SW2).</param>
    /// <param name="sentCla">The CLA byte of the command you sent (FF = ACS reader command).</param>
    public static (SwGroup Group, string Hint) Diagnose(byte[] reply, byte sentCla)
    {
        if (reply.Length < 2) return (SwGroup.Unknown, "Reply shorter than 2 bytes: not a status word.");
        byte sw1 = reply[^2], sw2 = reply[^1];
        return (sw1, sw2) switch
        {
            (0x90, 0x00) => (SwGroup.Success, "OK."),
            (0x91, _) => (SwGroup.DesfireNative, "DESFire native status: look up 91 " + sw2.ToString("X2") + "."),
            (0x61, _) => (SwGroup.MoreData, $"Send GET RESPONSE 00 C0 00 00 {sw2:X2} now."),
            (0x6C, _) => (SwGroup.RetryWithLe, $"Resend the same command with Le = {sw2:X2}."),
            (0x63, 0x00) when sentCla == 0xFF => (SwGroup.ReaderFailed, "ACS reader command failed: check key, block, card type."),
            (0x62 or 0x63, _) => (SwGroup.Warning, "Warning: check the data and the card's manual."),
            (0x64 or 0x65 or 0x66, _) => (SwGroup.ExecutionError, "Execution error: retry once on a fresh connection."),
            (0x67, 0x00) => (SwGroup.WrongLength, "Wrong length: recount Lc and check Le."),
            (0x68, _) => (SwGroup.ClassFunction, "CLA asks for a function the card lacks (channel, secure messaging)."),
            (0x69, _) => (SwGroup.NotAllowed, "Not allowed now: security, file state or command order."),
            (0x6A or 0x6B, _) => (SwGroup.WrongParameters, "Wrong P1-P2 or data: check AID, file, offset."),
            (0x6D, 0x00) => (SwGroup.WrongIns, "INS unknown to this card or application."),
            (0x6E, 0x00) => (SwGroup.WrongCla, "CLA not supported: reader command sent to a card, or wrong class."),
            (0x6F, 0x00) => (SwGroup.NoDiagnosis, "No diagnosis: retry once, then check the card's manual."),
            _ => (SwGroup.Unknown, "Not in the ISO 7816-4 groups: check the reader or card manual.")
        };
    }
}

Expected result: StatusWords.Diagnose([0x6A, 0x82], 0x00) returns WrongParameters; Diagnose([0x63, 0x00], 0xFF) returns ReaderFailed. Act on MoreData and RetryWithLe automatically; log and stop on the rest. Error handling: call it only after SCardTransmit returned 0; a non-zero return code is a PC/SC error and there is no reply to sort.

One line per command is enough

  1. The command bytes exactly as sent, in hex.
  2. The full reply in hex, or the PC/SC return code if the call failed.
  3. The commands sent just before it in the same session (most 69 and 61 problems are about order).
  4. The card's ATR, and the reader entry name (PICC or SAM).
  5. Reader model and firmware, driver version, Windows version.
  6. Never the key or PIN bytes: log "key location 00" or "factory key", not the key.

With that, a status word can usually be explained in minutes. Compare the same command in the ACS Script Tool: if it works there and not in your program, the difference is in your bytes or your connection, not the card. Still stuck? Send BSD the log.

Checked on 1 and 2 Dec 2026. ISO/IEC 7816-4 is a paid standard; the families and meanings here are based on the public summary below and written in BSD's own words. ACS facts come from the ACS manuals (local copies from the ACS SDK kits and download pages).

  • CardWerk summary of ISO/IEC 7816-4, section 5, basic organisations: SW1 families, the memory-unchanged rule, the 62, 63, 65, 68, 69 and 6A qualifiers (checked 1 Dec 2026)
  • PC/SC Workgroup specifications, Part 3 rev. 2.01.09, section 3.2.2.1: Load Keys, General Authenticate and Read Binary error code examples (including 65 81, 69 82, 69 86, 6A 81, 6C xx)
  • ACS, ACR1252U Application Programming Interface v1.17: response codes 90 00 / 63 00 "the operation failed" for the PICC commands, listed on the ACR1252U downloads page
  • ACS, ACR1552U Series Reference Manual v1.05: "6X XX Fail" for Get Data, Load Key, Authenticate and Read Binary; 6A 81 for cards without ISO 14443-4 (section 5.3), from the ACR1552U downloads page
  • ACS, ACR122U Application Programming Interface v1.4: 63 00 "the operation failed", from the ACR122U downloads page
  • DESFire status codes: NXP public documents as cited on our DESFire APDU page
  • Microsoft Win32 reference: SCardTransmit

BSD Infotech is an independent ACS supplier and integrator, not the manufacturer. ACS, the ACS logo and ACS product names belong to Advanced Card Systems Ltd. MIFARE and DESFire are trademarks of NXP B.V. Windows is a trademark of Microsoft Corporation.

Stuck on an APDU status word?

Send us the command you sent, the reply, the card ATR and the reader model. We help with APDU handling, card commands and PC/SC integration for ACS readers.