The defendant appeals from the denial of his motion for credit for two years he spent incarcerated on a prior sentence that was subsequently reversed. We reverse the denial of his motion.
Background. As with most sentencing disputes, a specific chronology is useful to clarify the issues. On November 15, 1997, the defendant was charged with possession with intent to distribute a class B substance, in violation of G. L. c. 94C, *738§ 32A. On December 5, 1997, he pleaded guilty and was sentenced to serve two years in the Hampden County house of correction (the 1997 conviction). The defendant completed this sentence and was released in late 1999.
Three years later, on October 30, 2002, the defendant was arrested; he was subsequently charged with two counts of unlawful possession of a firearm and two subsequent offender counts. He pleaded guilty on July 15, 2003, and was sentenced to a term of twelve years to twelve years and one day to be served at the Massachusetts Correctional Institution at Cedar Junction (the 2003 convictions).
On October 17, 2005, while still incarcerated for the 2003 convictions, the defendant moved to withdraw his 1997 guilty plea on the basis of ineffective assistance of counsel.2 On May 17, 2006, a District Court judge allowed the motion. The defendant’s motion to dismiss the 1997 complaint with prejudice was later allowed.
The defendant then filed a motion seeking credit for the time he served on his sentence for the 1997 conviction. His motion was denied on December 2, 2011.
Discussion. Our law recognizes that time served under a vacated sentence should be credited against a valid one, “for only in this way can a prisoner receive credit, not as matter of grace, but as of right, for time served under an erroneous conviction.” Brown v. Commissioner of Correction, 336 Mass. 718, 721 (1958) (Brown).3
The motion judge based her denial of the defendant’s motion to receive credit for this “dead time”4 on an error of fact, one which the Commonwealth has properly conceded. She ruled *739that this defendant sought credit to be applied against a subsequent sentence that “was not ‘for an offense committed before the reversal’ ” of his first conviction, citing Manning v. Superintendent, Mass. Correctional Inst., Norfolk, 372 Mass. 387, 396 (1977) (Manning). Accordingly, she concluded that the prohibition against “banking” time was triggered in this case as the defendant could have been encouraged to engage in criminal activity knowing that he had already served the sentence which might result. But this was simply incorrect. The record shows that the defendant’s 2003 convictions, for offenses committed a year earlier in 2002, were already three years in the past when his 1997 conviction was vacated in 2006. The ruling below was based on clear error.
Notwithstanding the basis on which the judge ruled, the Commonwealth advances alternative grounds, still reliant on a claim of “banking,” to preserve the result. We conclude however that banking is not implicated by these facts, and that denial of credit in this case is contrary to the principle of fairness on which our cases are based.* ***5
The concept of “banking” has been demarcated by the Supreme Judicial Court, and has been expressly limited to exclude the facts of this case:
“[I]t is not our intention to grant prisoners license to commit future criminal acts with immunity.. . . Such concerns are not appropriate here. . . . Credit allowed when the *740subsequent conviction is for an offense committed before the reversal of the first sentence in no way permits credit for future criminal acts” (emphasis supplied).
Ibid.
The application of “banking” as an exception to the otherwise straightforward concept of credit for improper incarceration has been subjected, more recently, to some semantic confusion in our decisions: the term “discharge,” referring to the crucial point in time when a conviction is reversed, has been conflated to signify release from confinement. Compare Commonwealth v. Milton, 427 Mass. 18, 25 (1998), with Milton v. Commissioner of Correction, 67 Mass. App. Ct. 253, 257 (2006).6 That confusion appears to be the basis here for the Commonwealth’s assertion that this defendant was “banking” time, even though the reversal of his first conviction occurred long after the beginning of his second confinement.
The Commonwealth argues, notwithstanding the judge’s error, that credit for dead time is unavailable here because the defendant was “discharged,” that is, released from prison, before his subsequent conviction.7 Release from confinement because an improperly awarded sentence has been completed, however, is wholly irrelevant to the issue of banking.8 Banking turns on one factor: commission of an offense with knowledge that a *741sentence previously served has been judged improper. The location of a defendant, in prison or out, at the time the critical knowledge is acquired has no bearing whatsoever on the purpose underlying the banking exception: discouraging individuals from committing future crimes. Moreover, the contrary approach has the unintended result of denying credit in those cases where the improper deprivation of liberty was greatest — an entire sentence served for an erroneous conviction, rather than one fortuitously interrupted by reversal in medias res.
An additional confusion in the consideration of dead time is also manifested in this case: the importation of the concept of a “related” crime where that issue has no relevance. The Legislature has mandated that defendants receive sentencing credit for time spent in pretrial confinement on the same offense. G. L. c. 127, § 129B. G. L. c. 279, § 33A. This requirement, also straightforward in concept, becomes muddled when an individual already serving time is indicted for another offense, and claims to be in pretrial confinement on the new charge (thus entitled to credit) while simultaneously serving a separate sentence. Our cases have sensibly rejected such claims, in part because the “unrelated” nature of the two offenses makes it clear that the prisoner would have been in custody regardless of the fact that he was also awaiting trial. See, e.g., Needel, petitioner, 344 Mass. 260, 261-262 (1962); Libby v. Commissioner of Correction, 353 Mass. 472, 475 (1968).9 See also Commonwealth v. Foley, 17 Mass. App. Ct. 238, 244 (1983) (noting that since passage of G. L. c. 279, § 33A, the only decisions denying credit for unrelated convictions are those in which double credit was sought).
These statutory claims are misapplied when utilized in cases, such as this one, where pretrial confinement is not at issue.10 *742Their importation has led to the converse assumption that the right to dead time credit can only be invoked, regardless of circumstance, if two crimes are “related.” This approach has been rejected by the Supreme Judicial Court in Commonwealth v. Milton, 427 Mass. 18, a case involving pretrial confinement followed by an acquittal, followed in turn by another offense: “In some circumstances, a defendant may be allowed to credit time in an unrelated case if necessary to prevent a defendant from serving ‘dead time.’ ” Id. at 24 (discussion, in dictum, of pretrial confinement credit statutes where “banking” exception to dead time dispositive to outcome). See Commonwealth v. Foley, supra (rejecting argument that defendant not entitled to credit for dead time because charges are “unrelated”), overruled on other grounds, Commonwealth v. Amirault, 415 Mass. 112, 117 n.9 (1993), and Commonwealth v. McLaughlin, 431 Mass. 506, 519 (2000).11 The Supreme Judicial Court has made clear that “the better and more humane view” provides credit for time served on an invalidated conviction against a sentence for an unrelated credit. Brown, 336 Mass. at 721.
Because the potential variations in sequence and in chronological relation among two or more charges, convictions, confinements, sentences, and reversals are countless, our analysis in a particular case should not be diverted from “the court’s evident and overriding concern . . . that a prisoner receives credit as a matter of right for time served under an erroneous conviction.” Gardner v. Commissioner of Correction, 56 Mass. App. Ct. 31, 38 (2002) (noting that “the fundamental principle underlying decisions in this area is ‘fair treatment of the prisoner.’ Commonwealth v. McLaughlin, [supra at 515], quoting from Com*743monwealth v. Grant, 366 Mass. 272, 275 [1974]”). See Lewis v. Commonwealth, 329 Mass. 445, 448 (1952); Chalifoux v. Commissioner of Correction, 375 Mass. 424, 427 (1978); Lynch, petitioner, 379 Mass. 757, 758 (1980); Commonwealth v. Maldonado, 64 Mass. App. Ct. 250, 251 (2005).12
The majority of other State and Federal courts agree with the general principles enunciated in Brown, 366 Mass. 718, and Manning, 372 Mass. 387,13 namely, a prisoner should receive full credit for time served on an invalidated sentence toward a subsequent, unrelated sentence so long as concerns regarding banking (properly defined) or double counting are not present.14
The Federal Circuit Courts of Appeals have also reviewed this issue, invariably in the context, stated or implicit, that the due process clause of the Fourteenth Amendment requires credit for State prisoners under such circumstances. See Tucker v. Peyton, 357 F.2d 115 (4th Cir. 1966); Goodwin v. Page, 418 F.2d 867, 868 (10th Cir. 1969).15 The United States Court of Appeals for the Fifth Circuit applied the same result in favor of *744a Federal prisoner in Meadows v. Blackwell, 433 F.2d 1298 (5th Cir. 1970), stating “[i]t is clear to this Court that appellant is entitled to the relief [credit for time served on an unrelated vacated sentence] sought.” Id. at 1299, citing Tucker v. Peyton, supra; Goodwin v. Page, supra; United States v. Maroney, 264 F. Supp. 684 (M.D. Pa. 1967).
Conclusion. In this case we cannot say with confidence that the judge would have denied the defendant’s motion, absent her mistake of fact. Of greater, and overriding, significance is the principle that
“[l]iberty is of immeasurable value; it will not do to read statutes and opinions blind to the possible injustice of denying credit.”
Milton v. Commissioner of Correction, 67 Mass. App. Ct. at 258, quoting from Manning, supra at 394.
This defendant is entitled as a matter of right to credit for the time he spent in prison on a vacated conviction.16 The order dated December 2, 2011, denying the motion for credit for time served is reversed, and the case is remanded for further proceedings consistent with this opinion.
So ordered.
The defendant’s ineffective assistance claim was based on his counsel’s failure to move to suppress improperly admitted evidence on which his conviction was based.
The plaintiff in Brown sought only the amount of credit necessary to effect his immediate release. This was less than the entire amount of time he had served under the prior erroneous conviction; that pragmatic approach does not dilute the principle underlying the decision — that (absent exceptions discussed, infra) credit should be awarded for unlawful confinement.
“Dead time” is defined as “time served under an invalid sentence for which no credit is given.” Manning v. Superintendent, Mass. Correctional Inst., Norfolk, 372 Mass. 387, 390 (1977) (Manning). It is not dependent on the existence of consecutive, or “from and after,” sentences, as is shown by *739Justice Quirico’s statement of the issue in the very first sentence of Manning-. “This case presents the question whether a prisoner is entitled to credit on one criminal sentence for time served under another criminal sentence that was later vacated.” Id. at 388. We note that Manning’s contrasting reference to Davis v. Attorney Gen., 432 F.2d 777 (5th Cir. 1970), is focused on the impermissibility of banking, properly defined, in its rejection of credit for “a future unrelated sentence for a crime not yet perpetrated” (emphasis supplied). Manning, supra at 395 n.9, quoting from Davis v. Attorney Gen., supra at 778. See Commonwealth v. Milton, 427 Mass. 18, 21 n.4 (1998).
“Familiar equitable principles require an interpretation that does not leave a prisoner having served bad or dead time for which no credit is given.” Manning, supra at 396. “In all cases ‘fairness is the appropriate measure in determining whether and to what extent’ credit for time spent in custody should be given.” Commonwealth v. Foley, 11 Mass. App. Ct. 238, 243 (1983), quoting from Chalifoux v. Commissioner of Correction, 375 Mass. 424, 427 (1978).
The Commonwealth’s reliance on our opinion in Milton v. Commissioner of Correction, supra, perfectly illustrates the confusion associated with the misuse of the word “discharge.” Our opinion contains the following language: “[A]s the [Supreme Judicial] court [has] noted . . . , ‘it was important to the holding [in Manning, 372 Mass. 387,] that the defendant was convicted of the second crime prior to being discharged on the first’ ” (emphasis supplied). Milton v. Commissioner of Correction, supra at 256-257, quoting from Commonwealth v. Milton, supra at 24. But the word “discharge” is not used anywhere in Manning, supra. The Supreme Judicial Court, consistent with Brown, 336 Mass. 718, and all its other decisions on this subject, held that Manning was entitled to credit for time served on his first sentence because that sentence was “reversed” after the subsequent conviction (emphasis supplied). Manning, supra at 396.
Misuse of the word “discharge” to signify release from prison has also contributed to the otherwise immaterial reliance on consecutive sentences as a prerequisite to credit.
Obviously, a prisoner who is still serving a sentence when the underlying conviction is reversed will simultaneously be “discharged” in both senses of the word — both from the conviction and from confinement. But the fact that *741a defendant may have already been released from confinement when a conviction is reversed proves nothing. It remains necessary to determine whether a later offense was committed with or without knowledge of the reversal to establish whether banking applies.
“The short answer is that the petitioner was not held ‘in custody awaiting trial’ nor ‘in confinement prior to such sentence and while awaiting trial.’ He was in confinement pursuant to a sentence for an unrelated crime of which he had been convicted.” Libby v. Commissioner of Correction, supra at 475, quoting from Needel, petitioner, supra at 262.
The Supreme Judicial Court has specifically clarified that the relationship *742between the statutes and a claim for credit involving the reversal of a prior unrelated conviction, while indirect, is based on policy considerations: “The problem is . . . what to do for a prisoner who has served time under a sentence that is reversed. The jail time credit statutes indicate legislative policy that credit be granted” (emphasis supplied). Manning, 372 Mass. at 396. (The same policy considerations underlie the ABA Standards for Criminal Justice, Sentencing § 18-3.21[f] [3d ed. 1994], which, like the jail time credit statutes, posit fact patterns not present in this case.)
In Commonwealth v. McLaughlin, supra, the Supreme Judicial Court disapproved that portion of Commonwealth v. Foley which permitted the trial judge to deny credit by staying execution of the defendant’s sentence during his commitment at Bridgewater State Hospital, which had effectively lengthened his sentence by six months.
Neither Williams v. Superintendent, Mass. Treatment Center, 463 Mass. 627, 632-633 (2012), nor Commonwealth v. Carter, 10 Mass. App. Ct. 618, 619-621 (1980), are to the contrary. The first determined that an application for dead time credit was not timely made; the second rejected an effort to receive multiple days of credit for each day of pretrial confinement. They both acknowledge the principles underlying the case law cited above.
As with Brown and Manning, we discern no rationale in other State or Federal decisions that limits credit to circumstances involving consecutive sentences or, indeed, for any reason other than the stated exceptions of banking and double credit.
See, e.g., Vellucci v. Cochran, 138 So. 2d 510, 512 (Fla. 1962); Jackson v. Jones, 254 Ga. 127, 128 (1985); Butcher v. State, 196 Md. App. 477, 490 (2010) (finding “the majority rule [in the United States] to be that, when one of a series of consecutive sentences is nullified, the next valid sentence begins on the date set for the commencement of the invalidated sentence”); Calvin v. Missouri Dept. of Corrections, 277 S.W.3d 282, 288-289 (Mo. App. 2009) (holding that time spent incarcerated on an invalidated conviction must be credited toward another valid, unrelated sentence); Burlew v. Missouri Dept. of Corrections, 340 S.W.3d 259, 263 n.3 (Mo. App. 2011) (noting that the rule adopted in Calvin v. Missouri Dept. of Corrections, supra at 287, is consistent with other States); State v. Smith, 267 N.C. 755, 756 (1966). See generally ABA Standards for Criminal Justice, Sentencing Alternatives and Procedures § 18-4.7(c) (1979); Wagner, Sentence Credit for “Dead Time,” 8 Crim. L. Bull. 393 (1972).
In the strongest language that we have uncovered in this context, the United States Court of Appeals for the Tenth Circuit opined that denial of *744credit “would abuse due process, shock the judicial conscience and effect the imposition of a cruel and unusual punishment under the eighth amendment.” Goodwin v. Page, supra.
We are entirely unpersuaded by several peripheral points raised in this case. The first is that the Commonwealth may have elected not to contest the defendant’s collateral attack on his first conviction precisely because he had already been made to spend two years in prison. The second is the notion that crediting the defendant for dead time is inappropriate because it only serves to “reward” him once convicted of a subsequent offense (i.e., the “recidivist” objection). Considering the facts of this case, neither claim is consonant with basic precepts of due process.
Finally, we do not speculate on the possible consequences of what our dissenting colleagues identify as credit awarded in circumstances involving the discovery that drug samples were tainted or lost. See post at note 1. We simply observe that the application of the principles discussed herein would be no less important in such circumstances.