Convert BAK files to CSV
How to convert a .bak file to CSV: identify which kind of backup you have, restore SQL Server backups before exporting, and decide whether an online BAK to CSV converter is a safe choice.
Short answer: it depends on what the .bak file really is
There is no single BAK format. The extension only means "backup," and many programs use it for unrelated kinds of files. Converting a .bak file to CSV is worth doing when the backup holds tabular data, such as database tables or a saved copy of a spreadsheet or text export. The main benefit is a portable, plain-text file that almost any spreadsheet, script or database can read. The decisive tradeoff is that CSV keeps only rows and values. Data types, relationships, indexes and multiple tables in one file are all lost. If you need to keep working with the data as a database, restore the backup and keep it as a database. Make CSV only for the specific tables you need to share or analyze.
Common kinds of .bak files
- SQL Server database backups, created by the BACKUP DATABASE command or by backup tools. These are binary. They cannot be read as text and must be restored before export.
- Renamed copies of text files, such as data.csv.bak or report.txt.bak, created by editors or scripts. These usually need only a rename.
- Application-specific backups. For example, AutoCAD saves drawing backups as .bak files, which are renamed copies of a drawing file. These contain no tabular data, so converting them to CSV makes no sense.
- Backups from other software, such as accounting or point-of-sale systems. Their structure depends on the vendor, and conversion depends on that vendor's own restore or export tools.
How to identify the kind you have
Start with where the file came from: the program or server that produced it is the strongest clue. If that is unknown, look at the first bytes. A file that shows readable comma- or tab-separated text is already delimited text. SQL Server backups use Microsoft Tape Format and typically begin with the characters TAPE. On Linux or macOS you can check with:
file MyDb.bak
head -c 256 MyDb.bak | xxd | head
On a machine with SQL Server installed, you can confirm that a file is a SQL Server backup, and list its contents, without restoring it:
RESTORE HEADERONLY FROM DISK = N'C:\restore\MyDb.bak';
RESTORE FILELISTONLY FROM DISK = N'C:\restore\MyDb.bak';
What the conversion actually changes
Converting BAK to CSV is a change of data format. It does not reverse, mirror or restyle characters, and it does not involve any Unicode substitution or display-only effect. The stored values are pulled out of a database or binary container and written as plain text. Each table becomes its own file, with one line per row and a delimiter between fields. What changes is the structure around the values, and sometimes how the values are written.
| Aspect | In a restored database | In CSV |
| Tables | Many tables in one backup | One table per CSV file |
| Data types | Numbers, dates, text and binary are distinct | Everything becomes text |
| NULL vs empty | Distinct | Often both appear as an empty field |
| Relationships and keys | Enforced | Not represented |
| Indexes, views, procedures | Present | Not exported |
| Binary columns (images, files) | Stored as-is | Need encoding such as hex or Base64, or must be excluded |
| Text encoding | Defined by column type and collation | Depends on the export setting, such as UTF-8 with or without a BOM |
Route 1: the .bak is a renamed text file
If the file opens as readable delimited text, no converter is needed. Copy it, remove the .bak extension, and give it .csv or .tsv depending on the delimiter. Work on the copy so the original backup stays intact. If it uses semicolons or tabs instead of commas, decide whether your destination expects that delimiter before changing it.
Route 2: the .bak is a SQL Server backup
SQL Server backups have to be restored into a running SQL Server instance before any table can be exported. The free Developer edition is fine for this. Express also works, but it caps each database at 10 GB, so larger databases will not restore on it. A backup cannot be restored on a SQL Server version older than the one that created it. Encrypted backups also require the matching certificate or key. First use RESTORE FILELISTONLY to get the logical file names, then restore under a new name:
RESTORE DATABASE MyDb_Restored
FROM DISK = N'C:\restore\MyDb.bak'
WITH MOVE N'MyDb' TO N'C:\restore\MyDb_Restored.mdf',
MOVE N'MyDb_log' TO N'C:\restore\MyDb_Restored_log.ldf',
RECOVERY;
Then export each table you need. The Import and Export Wizard in SQL Server Management Studio can write to a flat file and lets you set a text qualifier, usually a double quote, so values containing commas stay intact. The bcp command-line tool is fast, but it does not quote fields. Any comma or line break inside a value will shift columns unless you choose a delimiter that never appears in the data. In PowerShell with the SqlServer module, Export-Csv quotes fields for you. The extra DataRow properties need to be excluded, or they show up as columns:
Invoke-Sqlcmd -ServerInstance "localhost" -Database "MyDb_Restored" -Query "SELECT * FROM dbo.Customers" |
Select-Object * -ExcludeProperty ItemArray, Table, RowError, RowState, HasErrors |
Export-Csv -Path ".\customers.csv" -NoTypeInformation -Encoding UTF8
Online BAK to CSV converters
No evidence was available for this review about any specific online converter. There is nothing to report on which BAK types such tools support, their file size limits, how they handle multiple tables, or what they do with uploaded files. A tool's look or marketing claims are not a reliable guide to its privacy or data retention. A database backup often contains a whole system's records, including personal or financial data. Uploading it hands all of that to a third party, not just the table you want. Before using any online service, check its written terms on storage and deletion, and confirm it supports your exact backup type. A local restore and export is the more controllable option for any backup containing sensitive data.
Will the CSV stay readable and usable after sharing?
- Encoding: export as UTF-8 and tell recipients. Some spreadsheet programs misread UTF-8 without a byte order mark and garble accented or non-Latin characters.
- Quoting: values with commas, quotes or line breaks must be enclosed in quotes, with internal quotes doubled. Otherwise columns shift when the file is opened.
- Leading zeros and long numbers: spreadsheets may strip leading zeros from codes such as ZIP codes, or round long IDs. Import those columns as text, not by double-clicking the file.
- Dates: date formats can be reinterpreted by regional settings. An unambiguous format such as year-month-day reduces errors.
- Size: Excel worksheets hold at most 1,048,576 rows. Larger tables need a database, a script, or splitting.
- Copy and paste: pasting comma-separated text into a spreadsheet often lands in a single column. Tab-separated text generally splits into cells, so TSV is more convenient for pasting.
- Accessibility and search: CSV is ordinary text, so reading order and search work the same as for any text in the program that opens it. No specific screen reader or destination was tested for this review.
When CSV is not the right target
Keep the restored database if you need relationships between tables, exact data types, or ongoing queries. If the .bak is a drawing or another non-tabular backup, restore it in its original program instead. For quick pasting into a spreadsheet, export TSV. For long-term archiving, keep the original backup alongside any CSV exports, because the CSV cannot recreate the database.
Gaps in this review
- No specific converter, online or desktop, was tested or documented in the supplied evidence.
- No measurements of conversion speed, accuracy or file size limits were available.
- Vendor-specific BAK formats other than SQL Server were not examined. Use each vendor's documentation for those.
- Rendering and import behavior was not tested in any particular spreadsheet version or assistive technology.