wallet.dat Recovery with PhotoRec: Step-by-Step Guide 2026
You found an old hard drive or USB stick with a wallet.dat file — and Bitcoin inside. Or you remember running Bitcoin Core years ago and wonder if the keys are still recoverable. This guide covers every practical method available in 2026: file recovery from formatted drives, password cracking, corruption repair, and when professional help makes economic sense.
What Is a wallet.dat File
wallet.dat is the file used by Bitcoin Core (the original Bitcoin client, formerly known as Satoshi Client) to store private keys. If you ran Bitcoin Core before roughly 2016 — and in many cases well after — all your Bitcoin private keys live in this single file. It is a BerkeleyDB database, a format that has been in use since the earliest versions of the Bitcoin software.
The file may be encrypted with a passphrase. If you chose a wallet passphrase when setting up Bitcoin Core, the private keys inside wallet.dat are encrypted using AES-256-CBC. Losing access to wallet.dat — or forgetting the encryption password — means losing access to the Bitcoin stored at those addresses, because there is no central authority that can reset your credentials. The blockchain itself will always show your balance, but only the private key in wallet.dat can authorize a transaction to move those funds.
By default, Bitcoin Core stores wallet.dat in a platform-specific directory: on Windows at C:\Users\[YourName]\AppData\Roaming\Bitcoin\, on macOS at ~/Library/Application Support/Bitcoin/, and on Linux at ~/.bitcoin/. Many users who set up Bitcoin Core between 2009 and 2015 never explicitly backed up this file, which is why wallet.dat recovery is one of the most common requests KarCrypto's wallet recovery specialists receive.
How wallet.dat Gets Lost
The scenarios that bring people to wallet recovery are more predictable than they might seem. An old hard drive from a computer replaced years ago sits in a drawer or a box — sometimes still readable, sometimes failed. A PC was formatted or reinstalled without backing up the Bitcoin data directory first. A USB drive used as a backup stopped responding. Cloud storage accounts were closed or accidentally cleared. In some cases the wallet.dat file exists but has become corrupted due to a filesystem error, improper shutdown, or hardware degradation.
Forgotten encryption passwords are an equally common problem. Someone set a password in 2013, wrote it nowhere because the Bitcoin was worth almost nothing, and a decade later the value has changed considerably. The file exists and is intact — but without the password, the private keys inside are inaccessible. This category of loss is recoverable under certain conditions, which are explained in the password recovery section below.
A less obvious scenario: the hard drive itself is physically damaged. Platters in older drives develop bad sectors, firmware can fail, and read heads can seize. In these cases the wallet.dat sectors may still be intact but inaccessible through normal means. Specialist clean-room hardware recovery can extract the raw data before software-level recovery begins.
First Steps: Do Not Make It Worse
The single most important rule in wallet.dat recovery: do not write anything to the drive that contains your wallet.dat. Every file saved, every program installed, every Windows update applied to a drive with deleted or corrupted wallet.dat increases the probability of permanently overwriting the sectors where the file resided. This is not a theoretical risk — it is the most common reason professional recovery fails.
If you believe wallet.dat is on a drive you still have access to, stop using that drive immediately. Do not install recovery software onto it. Do not run any program from it that writes temporary files. Instead, create an exact sector-by-sector clone of the drive first, then work exclusively on the copy.
On Linux or macOS, the dd command creates a byte-for-byte copy: dd if=/dev/sdX of=/path/to/backup.img bs=4M status=progress. On Windows, Clonezilla is a reliable free option that boots from a USB drive and clones without touching the source. Once you have a verified copy, every subsequent step — PhotoRec scans, btcrecover attacks, BerkeleyDB repair — runs against the image, leaving the original untouched.
Making a sector-by-sector copy before any recovery attempt is not optional. It is the difference between having one chance and having unlimited chances.
Can PhotoRec Recover a wallet.dat File
Yes. PhotoRec can recover wallet.dat files from formatted or damaged drives, and it does so specifically because it does not rely on file system metadata. Instead, it scans raw sectors looking for known file signatures. wallet.dat, being a BerkeleyDB database, has a distinctive header signature that PhotoRec recognizes. The tool was originally designed for photo recovery but supports hundreds of file types including BerkeleyDB databases.
The steps for using PhotoRec on a drive you suspect contains wallet.dat are straightforward. First, stop using the drive entirely. Second, download TestDisk and PhotoRec from CGSecurity's official site — the two tools are distributed together. Third, run PhotoRec against the raw device (not a mounted partition) so it has access to every sector. Fourth, search the recovered output directory for any file named wallet.dat or any file with a .db extension that matches BerkeleyDB structure. PhotoRec renames recovered files sequentially, so you will need to inspect the output folder rather than look by original filename.
Recovery success depends entirely on whether the sectors where wallet.dat resided have been overwritten since the file was deleted or the drive was formatted. A drive that was formatted once and then left unused for years has a very high chance of yielding the file intact. A drive that was actively used as a system drive for months after formatting has a much lower chance. This is why stopping all writes to the drive as early as possible is so critical.
Recovering a Lost wallet.dat Password
If your wallet.dat file is intact but encrypted with a forgotten password, you are not at a dead end — you are at a probabilistic problem. The encryption used by Bitcoin Core (AES-256-CBC with key derivation through multiple rounds of SHA-512) is strong, but password recovery exploits the fact that humans choose passwords in predictable ways.
The most accessible open-source tool for this is btcrecover, available at github.com/gurnec/btcrecover. It supports dictionary attacks using wordlists, brute-force attacks across defined character sets, and typo-mutation attacks that try variations of a base word you provide. If you remember the approximate length, the type of characters used, or a word the password was based on, btcrecover can structure the search around those constraints and dramatically reduce the search space.
For passwords that are genuinely complex — 10 or more random characters from mixed case, numbers, and symbols — btcrecover running on a consumer GPU will not finish in a reasonable timeframe. In those cases, professional GPU cluster recovery is the realistic option. KarCrypto's wallet recovery specialists use dedicated hardware arrays that can test billions of password candidates per second. Success probability depends on what you remember: a 6-character password with a known character set can be exhausted in hours; a 10-character fully random password requires years; a 12-character truly random password is practically unrecoverable by brute force alone. If you remember any partial details — a word you used, the approximate length, a rule you applied when creating it — recovery becomes feasible even for longer passwords.
Another tool for GPU-accelerated attacks is hashcat in Bitcoin Core wallet mode. The workflow involves first extracting the password hash from wallet.dat using bitcoin2john.py (part of the John the Ripper suite), then running hashcat against that hash. This approach requires technical knowledge to set up but gives full control over attack modes and GPU utilization.
Corrupted wallet.dat: Can It Be Repaired
Yes, in some cases. wallet.dat is a BerkeleyDB file, and BerkeleyDB includes a built-in recovery utility called db_recover. This utility is part of Oracle's BerkeleyDB tools package and is designed to repair structural damage to BerkeleyDB databases. If the corruption affects metadata, transaction logs, or non-critical parts of the file structure, db_recover can often restore the database to a consistent state that Bitcoin Core can then open.
The command is straightforward once you have the BerkeleyDB tools installed: run db_recover -h /path/to/bitcoin/datadir pointing at the directory containing wallet.dat rather than the file itself. The full documentation for this utility is available in the Oracle BerkeleyDB API reference.
If the corruption has affected the actual key data pages within the database — the sectors storing the private keys themselves — db_recover cannot recreate data that is physically missing. In these cases, a specialist approach is required: using hex editors to directly read the BerkeleyDB page structure, identifying key pages by their internal format, and extracting raw key data manually. This is exacting work that requires detailed knowledge of BerkeleyDB internals and Bitcoin key formats, but partial recovery of some keys is often possible even when the file appears severely corrupted. If the Bitcoin addresses associated with those keys held funds, recovering even a subset of the keys can be valuable.
What Information You Need Before Starting Recovery
Before beginning any recovery attempt — whether DIY or professional — gather everything that might be relevant. The physical drive or backup medium containing wallet.dat, or the file itself if you already have it. Any passwords you might have used, including partial memories: the approximate length, whether you used capital letters, whether it was based on a word or phrase, whether you added numbers or symbols. The approximate date when you last used Bitcoin Core, which helps establish which version of the software created the wallet and whether version-specific quirks are relevant. And an approximate estimate of the Bitcoin balance, because this determines whether professional recovery is economically rational.
If you have any old password managers, encrypted notes, or email drafts from the era when you created the wallet, search those carefully before starting. A partial password is worth dramatically more than no password at all when it comes to narrowing the search space for btcrecover or a professional recovery service.
When Professional Recovery Is Worth It
The honest answer depends on the balance in the wallet and the specifics of why access was lost. For wallets holding over $1,000 in Bitcoin, professional recovery is worth evaluating even when the prospects are uncertain, because the asymmetry favors attempting recovery: the cost of the attempt is bounded, while the upside is the full wallet balance. For wallets where the file is corrupted or was deleted from a drive that has since been used heavily, professional tools for sector-level forensics and BerkeleyDB reconstruction go well beyond what open-source utilities can achieve.
If the password has some known structure — a base word, approximate length, or remembered character types — that information combined with professional GPU cluster hardware can succeed where a consumer machine running btcrecover would not finish in a reasonable timeframe. KarCrypto's wallet.dat recovery service provides a free initial assessment so you can evaluate the realistic probability before committing. The fee starts at 10% of the wallet balance, with the exact percentage set after diagnosis. You pay only after access is restored, with no upfront payment. We do not guarantee results.
For balances under $500 and a password with no remembered structure, DIY tools like btcrecover are the more cost-effective path. The software is free, the documentation is thorough, and if the password was simple or follows a pattern you remember, a consumer GPU can find it. Professional recovery makes sense when the DIY options have been exhausted or when the technical steps — drive cloning, BerkeleyDB repair, GPU configuration — are beyond the user's comfort level.
Old wallet.dat with Bitcoin inside? We can help recover it.
Send us your case details — KarCrypto's wallet recovery specialists will assess feasibility and provide an honest probability estimate before any paid engagement.
Recovery feasibility quick check
If you have the wallet.dat file and remember any part of the password — recovery probability is high. If the file was deleted but the drive was not heavily used afterward — PhotoRec has a good chance. If the file is corrupted but physically present — BerkeleyDB repair often works. If the drive was used as the primary system drive for months after formatting, professional sector-level forensics is the only realistic option, with no guarantee. A free initial assessment determines which category your case falls into.
Citations
Bitcoin Core documentation: bitcoin.org/en/bitcoin-core/. btcrecover (open source wallet password recovery): github.com/gurnec/btcrecover. TestDisk and PhotoRec: cgsecurity.org/wiki/PhotoRec. BerkeleyDB db_recover utility: Oracle BerkeleyDB API Reference.
Frequently Asked Questions
What is a wallet.dat file and where is it stored?
Can I recover Bitcoin from an old computer with wallet.dat?
Does PhotoRec work for wallet.dat files?
Does PhotoRec Recover Bitcoin wallet.dat Files?
How do I crack my wallet.dat password?
What if my wallet.dat file is corrupted?
Can I recover wallet.dat from a formatted hard drive?
How long does wallet.dat password recovery take?
How do I know if my wallet.dat still has Bitcoin?
Old wallet.dat with Bitcoin inside? We can help recover it.
Tell us about your situation — which recovery scenario you are in (forgotten password, deleted file, corrupted wallet, failed drive) and what you remember about your setup. KarCrypto's wallet recovery specialists will assess feasibility and give you an honest probability estimate.