.BAK Backup File
.bak

Backup File

A .bak file is a backup copy whose internal format mirrors whatever application created it — from SQL Server database dumps to AutoCAD drawings to plain-text editor snapshots. Identify the creator by inspecting the first bytes, not the extension.

Binary layout
Header magic bytes
Sections code · data
MetadataText1981
By FileDex
Not convertible

BAK is a naming convention, not a fixed format. The internal structure varies by creator application — SQL Server, AutoCAD, and text editors all produce .bak files with completely different contents. Identify the source application first, then use its native tools to open or convert the file.

Common questions

What is a BAK file?

A BAK file is a backup copy created by an application before overwriting the original file. The extension is a naming convention, not a format — the contents depend entirely on which program created it. SQL Server, AutoCAD, text editors, and many other applications all produce .bak files with completely different internal structures.

How do I identify what created a BAK file?

Inspect the first bytes of the file. AutoCAD backups begin with a version string such as AC1032. SQL Server backups contain the ASCII string TAPE near the start. Text editor backups contain readable plain text with no binary header. The directory where the file was found also provides strong context. See the CLI tab for identification commands.

Can I safely delete BAK files?

It depends on the source. AutoCAD backups are safe to delete if the current drawing file is intact. Text editor backups are safe once the original is confirmed correct. SQL Server backups may be part of a disaster recovery chain where deletion breaks point-in-time restore. Always verify the original exists and is not corrupted first.

How do I restore an AutoCAD drawing from a BAK file?

Copy the file and change the copy's extension from .bak to .dwg. The backup is a byte-identical copy of the previous drawing state and opens directly in AutoCAD. Copy rather than rename to preserve the backup as a safety net. AutoCAD's Drawing Recovery Manager also detects these files automatically after a crash.

Why does Windows not recognize BAK files?

Windows has no default application associated with the .bak extension because it can contain any format. A database backup needs database software, a CAD backup needs drawing software, and a text backup needs an editor. No single program handles all variants, so Windows asks you to choose every time.

What is the difference between BAK and TMP files?

BAK files are intentional backups of a previous file version, meant to persist for recovery. TMP files are temporary working files created during active operations, meant to be deleted when the operation finishes. An orphaned BAK on disk is probably a valid backup worth keeping. An orphaned TMP is probably left over from a crashed application.

Can FileDex convert BAK files?

No. BAK is a naming convention with no fixed internal format. Since the contents vary completely depending on which application created the file, no single tool can process all variants. Determine which application created the backup first, then use that application's native tools to open the actual data inside.

What makes .BAK special

MS-DOS heritage
EDLIN created the first automatic .bak files in 1981
Tim Paterson wrote EDLIN in 1980 for 86-DOS. It renamed originals to .bak before writing edits — the first program known to automate this convention. Microsoft shipped it with MS-DOS 1.0 in 1981.
Three files, one extension
SQL Server, AutoCAD, and Vim all write .bak files with nothing in common
A SQL Server .bak contains an MTF binary stream with database pages. An AutoCAD .bak is a renamed DWG drawing. A Vim .bak is a plain-text copy. Same extension, completely different contents — the extension tells you only that a backup occurred.
Rename to recover
AutoCAD .bak files are valid DWG drawings with a different extension
AutoCAD renames the previous .dwg to .bak on every save. The .bak is byte-identical to the drawing it replaced. Changing the extension back to .dwg produces a file that opens directly — the simplest recovery path in CAD.
No magic bytes
The .bak extension provides zero information about content
BAK has no registered MIME type, no PRONOM identifier, no magic bytes, and no specification. The only way to identify a .bak file's content is to inspect its first bytes or check the directory where it was found.

What is a BAK file?

A BAK file is a backup copy of another file, created by an application before overwriting the original. The .bak extension is a naming convention, not a file format. There is no specification, no registered MIME type, no entry in the Library of Congress Format Description Database, and no PRONOM identifier. The internal structure of a .bak file is determined entirely by the software that created it.

Continue reading — full technical deep dive

This makes .bak fundamentally different from formats like PDF, PNG, or MP4, which define a fixed binary structure. A .bak file from SQL Server and a .bak file from Vim share nothing except three characters in the filename.

The origin: EDLIN and MS-DOS

The .bak convention traces to the earliest days of personal computing. Unix editors like ed (1971) and vi (1976) encouraged manual copying before edits, but the first program to automate .bak creation was EDLIN, the line editor written by Tim Paterson in 1980 for 86-DOS. When a user opened a file for editing, EDLIN renamed the original to .bak and wrote modifications to a new file with the original name. Microsoft acquired 86-DOS and shipped EDLIN with MS-DOS 1.0 in 1981. The .bak convention spread through the entire MS-DOS ecosystem and persists unchanged more than four decades later.

SQL Server BAK files

SQL Server .bak files are the most technically complex use of the extension. They contain a binary stream formatted according to the Microsoft Tape Format (MTF), a block-oriented structure originally designed for tape backup devices.

The MTF stream begins with a TAPE descriptor block (DBLK) whose first four bytes are 0x54415045 — the ASCII string "TAPE". This is followed by a 52-byte common block header (MTF_DB_HDR) containing the vendor ID (0x1200 for Microsoft), media name, creation timestamp, and media family information. Each .bak file can hold multiple backup sets — full backups, differential backups, and transaction log backups — appended sequentially to the same file.

SQL Server enforces a strict version compatibility rule: backups restore forward but never backward. A .bak file created on SQL Server 2005 can be restored on SQL Server 2022, spanning 17 years of forward compatibility. A .bak file from SQL Server 2019 cannot be restored on SQL Server 2017 — the internal database version marker prevents it. The RESTORE HEADERONLY command reads backup metadata (database name, version, timestamp, compatibility level) without performing a restore, which makes it the primary diagnostic tool for unknown .bak files in database environments.

AutoCAD BAK files

AutoCAD creates a .bak file on every manual save operation. The save process renames the current .dwg file to .bak, then writes the updated drawing as a new .dwg. The .bak file is a byte-identical copy of the previous drawing state, beginning with the standard DWG version string — AC1032 for AutoCAD 2018 and later formats.

Recovery is straightforward: rename the .bak file to .dwg, and it opens as a standard drawing. This is the primary recovery path when a .dwg becomes corrupted during a failed save operation.

The ISAVEBAK system variable controls .bak creation (default value: 1, enabled). Setting it to 0 disables backup creation, which saves disk space but removes the safety net. AutoCAD also produces .sv$ files from its timed auto-save feature, but these serve a different purpose: .sv$ captures unsaved work at intervals (default: 10 minutes) and is deleted when AutoCAD closes normally. The .bak file captures the last saved state and persists until the next save overwrites it.

AutoCAD's Drawing Recovery Manager detects both .bak and .sv$ files after a crash, presenting them as recovery options ranked by timestamp.

Text editor BAK files

Text editors produce the simplest .bak files: plain-text copies of the original, with no special headers or binary structure.

Vim creates backup files when the user sets :set backup in their configuration. The default backup extension is a tilde (~), but :set backupext=.bak changes it to .bak. The backupdir option controls where backups are stored — by default, the same directory as the original file.

Notepad++ creates .bak files when "Create Backup" is enabled in Settings. Like Vim, the backup is a character-for-character copy of the file as it existed before the current editing session.

Emacs uses a tilde suffix by default (file.txt~) rather than .bak, but the behavior is identical: the previous version is preserved before the new version is written.

Identifying unknown BAK files

The central challenge with .bak files is identification. Without knowing which application created the file, the extension alone provides no information about contents. Three identification strategies exist, in order of reliability.

First, inspect the first bytes. A file beginning with AC10 followed by two digits is an AutoCAD drawing — the digits identify the DWG version. A file whose early bytes contain the ASCII string TAPE is a SQL Server backup. Readable ASCII or UTF-8 text indicates a text editor backup.

Second, consider the directory context. A .bak file in a SQL Server backup directory is almost certainly a database backup. A .bak file alongside .dwg files is an AutoCAD backup. A .bak file in a configuration directory is likely a text editor copy.

Third, use automated content identification tools available on Unix and macOS systems. These inspect magic bytes from a database of known file signatures and report the actual format regardless of the extension. They correctly identify DWG content inside .bak files, report text files as text/plain, and flag unknown binary formats as application/octet-stream. See the CLI tab for specific commands.

Content distribution

According to analysis cited by Wikipedia, approximately 15 percent of .bak files in the wild are ZIP archives, another 15 percent are AutoCAD DWG files, and the remainder includes SQL Server database backups, plain-text copies, and various application-specific binary formats. This distribution reflects the convention's universal adoption — no single application dominates the .bak namespace.

Why BAK files accumulate

Applications create .bak files automatically but rarely delete them. AutoCAD overwrites the previous .bak on each save, limiting accumulation to one backup per drawing. SQL Server, by default, appends new backup sets to existing .bak files, growing them continuously. Text editors create a new .bak on each save session. The result is steady accumulation, especially in SQL Server environments where .bak files can grow to hundreds of gigabytes.

Windows does not associate .bak with any default application, so double-clicking produces a "How do you want to open this file?" prompt. This creates a recurring support burden in enterprise environments where users encounter .bak files without understanding their origin.

.BAK compared to alternatives

.BAK compared to alternative formats
Formats Criteria Winner
.BAK vs .TMP
Purpose
BAK files preserve a previous version for recovery after a save operation. TMP files hold intermediate data during an active operation and are meant to be deleted when the operation completes. BAK persists intentionally; TMP persists only on failure.
Draw
.BAK vs .TMP
Cleanup safety
TMP files in the system temp directory are generally safe to delete when no application is running. BAK files may be the only surviving copy of important data — deletion requires verifying that the original file exists and is intact first.
TMP wins
.BAK vs .OLD
Convention clarity
Both are renaming conventions with no fixed format. .old typically indicates a manual rename during configuration changes (httpd.conf.old), while .bak can be manual or automatic. The distinction is social, not technical.
Draw
.BAK vs .SWP
File state
SWP (Vim swap files) indicate an active editing session and lock the file against concurrent edits. BAK files represent a completed backup with no lock. An orphaned .swp suggests a crashed editor; an orphaned .bak is simply a preserved copy.
BAK wins

Technical reference

MIME Type
application/octet-stream
Developer
Various
Year Introduced
1980
Open Standard
No

Binary Structure

BAK files have no universal magic bytes or fixed structure. The format is determined entirely by the creating application. SQL Server .bak files begin with an MTF TAPE descriptor block — first four bytes are 0x54415045 (ASCII: TAPE), followed by a 52-byte MTF_DB_HDR common block header containing vendor ID, media name, and media family metadata. AutoCAD .bak files start with a DWG version string (AC1032 for 2018+ format) and are byte-identical to the .dwg file they replaced. Text editor .bak files begin with whatever content the original file contained, typically UTF-8 or ASCII text with no binary header at all.

1971The ed line editor on Unix establishes the practice of manually copying files before editing — the precursor to automatic .bak creation1981MS-DOS 1.0 ships with EDLIN, the first program known to create .bak files automatically by renaming originals before writing edits1982AutoCAD 1.0 releases and adopts the .bak convention for drawing backups — renaming the previous .dwg to .bak on every save1998SQL Server 7.0 introduces the MTF-based .bak backup format that supports multiple backup sets in a single file2005SQL Server 2005 adds backup compression support to .bak files, significantly reducing storage requirements for database backups2017SQL Server on Linux reaches general availability, bringing .bak backup and restore capability to Linux environments for the first time
Identify the actual format inside a BAK file other
file --mime-type backup.bak && xxd -l 32 backup.bak

The file command inspects magic bytes to determine the real format regardless of extension. The xxd hex dump shows the first 32 bytes for manual identification — look for TAPE (SQL Server MTF), AC10 (AutoCAD DWG), or readable ASCII (text editor backup).

Recover an AutoCAD drawing from a BAK file other
cp drawing.bak drawing_recovered.dwg && file drawing_recovered.dwg

AutoCAD .bak files are byte-identical copies of the previous .dwg. Copying with a .dwg extension produces a valid drawing file. The file command confirms DWG detection. Always copy rather than rename to preserve the backup.

Inspect SQL Server backup metadata without restoring other
sqlcmd -S localhost -Q "RESTORE HEADERONLY FROM DISK = 'C:\Backups\database.bak'"

RESTORE HEADERONLY reads the backup set headers from a SQL Server .bak file and reports the database name, backup type (full, differential, log), creation date, compatibility level, and SQL Server version — without performing any restore operation.

Find all BAK files and report their detected formats other
find /path/to/search -name '*.bak' -exec file {} \;

Recursively locates every .bak file under a directory and runs the file command on each to identify its actual content type. Useful for auditing backup file accumulation and determining which files can be safely deleted.

Check the DWG version inside an AutoCAD BAK file other
xxd -l 6 drawing.bak

Reads the first 6 bytes to identify the AutoCAD version string. AC1032 means AutoCAD 2018-2024 format. AC1027 means AutoCAD 2013-2017. AC1024 means AutoCAD 2010-2012. The version string determines which AutoCAD release can open the file.

MEDIUM

Attack Vectors

  • BAK files may contain sensitive data — database credentials, personal information, API keys — from the original file, persisting on disk long after the source has been secured, rotated, or deleted
  • SQL Server .bak files can contain entire databases including user tables, password hashes, and financial records — a single leaked .bak file exposes the full database at the time of backup
  • An attacker can craft a .bak file with a malicious payload matching the expected source application, exploiting automatic restore workflows that process .bak files without validation

Mitigation: FileDex does not open, execute, or parse BAK files. This is a reference page only. Treat .bak files with the same access controls as the original data they contain.

Microsoft's GUI for SQL Server administration — creates and restores .bak database backups via the Backup/Restore Database wizards
AutoCAD tool
Autodesk's CAD software — creates .bak files automatically on every save as byte-identical copies of the previous .dwg drawing
Vim tool
Text editor with configurable backup file creation — set backupext=.bak to use the .bak extension instead of the default tilde
Notepad++ tool
Windows text editor with optional backup creation — saves a .bak copy of the original file before applying edits when enabled in settings
Cross-platform database tool from Microsoft — can restore SQL Server .bak files on Windows, macOS, and Linux