Double-entry bookkeeping, in accounting, is a system of bookkeeping so named because every entry to an account requires a corresponding and opposite entry to a different account. For instance, recording earnings of $100 would require making two entries: a debit entry of $100 to an account named "Cash" and a credit entry of $100 to an account named "Revenue."
Deciding which account has to be debited and which account has to be credited is accomplished using the accounting equation which is expressed as, . This equation serves as an error detection tool; if at any point the sum of debits for all accounts does not equal the corresponding sum of credits for all accounts, an error has occurred. It follows that the sum of debits and the sum of the credits must be equal in value.
Double-entry bookkeeping is no guarantee that errors have not been made; for example, the wrong ledger account may have been debited or credited, or the entries completely reversed.
The oldest record of a complete double-entry system is the Messari (Italian: Treasurer's) accounts of the Republic of Genoa in 1340. The Messari accounts contain debits and credits journalised in a form, and include balances carried forward from the preceding year, and therefore enjoy general recognition as a double-entry system. By the end of the 15th century, the bankers and merchants of Florence, Genoa, Venice and Lübeck used this system widely.