Bottom line: there’s really no way to tell from just the filename.
The problem is that many applications use the file extension “.dat” to indicate a file that contains data.
But that’s exactly all it tells us. It doesn’t tell us what kind of data or how that data is formatted and represented.
In other words, it doesn’t give us a single clue as to what the file is or what program we should use to open it.
We need more information and there may be one way to get some.
Whatever follows the last “.” in a file name is called the file or filename extension.
In general, it’s intended to tell you what type of information the file contains. .exe files, for example, contain executable programs, .jpg files contain images formatted using the JPEG compression algorithm, and so on.
On problem is that the use of extensions is an arbitrary convention. There’s no rules committee that says what gets to be called what, and there’s no requirement that any of the conventions be followed. It’s perfectly possible to store what would be an executable program in a file with a .jpg extension. In fact, in the past that was one trick that malware would use to infect your system.
The .dat extension
… there is no way to know how to open a .dat file unless you know what program created it.
To me that’s almost redundant because all files contain data when you think about it.
The real problem is that so many different programs use .dat when they store their data that the filename, by itself, really doesn’t tell you anything about the file, what it contains, or what program it belongs to. There is no standard format and there is no standard way to interpret the contents. .dat is only a name and nothing more.
So I’ll be super clear: there is no way to know how to open a .dat file unless you know what program created it. Period.
A good example is that Yahoo Instant Messenger (YIM) apparently keeps its message history in a file that ends in .dat. The way Yahoo works, you can only open that .dat file using Yahoo Instant Messenger, and only of you are logged in to the account that created the file in the first place.
But if you don’t know what application created the file, there’s no way to know how to open it.
Fortunately, there may be one trick to identifying that application…
In How do I figure out what kind of file I have – without the file extension? I discuss the concept of file signatures.
File signatures are nothing more than bytes with specific values at the beginning of a file that identify what the file contains.
For example, executable files begin with the bytes (represented in hexadecimal) 4D followed by 5A. That’s upper case MZ, the initials of the engineer that defined the original .exe file format.
JPEG image files generally start with the bytes FF, D8, FF. That means if you get a .jpg file, but it starts with something other than those values, you know there’s a problem – the type of file content doesn’t match what the filename extension implies.
How does this help our .dat file scenario?
Fairly simply: by examining the first few bytes of the data in that file, you may be able to determine what kind of file it is. (I have to stress may as there’s also no requirement that any file follow any particular convention.)
How do I figure out what kind of file I have – without the file extension? has more, including a link to a tool to examine those values, as well as a link to a fairly extensive list of file signatures.
Including the one I created, that begins with my initials, LN.