How to open a .dat file
Generic data file · Ambiguous / data
There is no single .dat format. The extension just means "data", so the answer depends entirely on which program made it. If it arrived as an email attachment called winmail.dat, it is an Outlook formatting wrapper and needs a TNEF reader.
What a .dat file actually is
Unlike .pdf or .mp3, .dat carries no format information at all. Developers reach for it when they want a file the operating system will leave alone. A .dat can be plain text, a video stream, a save game, a database page or a proprietary blob.
This is why generic advice fails. Before you can open it, you have to work out what it actually is, and the reliable way to do that is to look at the first bytes of the file rather than guess from its name.
Why it will not open
Windows has no association for .dat because there is nothing to associate it with. The file is not broken and nothing is missing; the extension simply does not identify a format.
Step by step
Windows
- 01First, check the name. A file called winmail.dat is an Outlook TNEF wrapper, and the real attachments are inside it. Use a TNEF extractor rather than a text editor.
- 02Otherwise, identify it: open the file in HxD, a free hex editor, and read the first few bytes.
- 03Match the signature. "%PDF" means rename it to .pdf. "PK" means it is a ZIP. "RIFF" or "\x00\x00\x01\xBA" means video, so try VLC. Mostly readable words means it is text, so open it in any editor.
- 04If the header is unrecognisable, the file belongs to one specific program and only that program will read it. Find out what created it.
macOS
- 01Open Terminal, then run: file /path/to/yourfile.dat
- 02The "file" command reads the header and names the format, doing in one step what a hex editor does manually.
- 03Open it with whatever that reports, or rename the extension to match.
What usually goes wrong
winmail.dat
By far the most common .dat people receive. Outlook sends rich formatting using TNEF, and non-Outlook mail clients cannot decode it, so the entire attachment set collapses into one winmail.dat. Nothing is lost: a TNEF extractor recovers the original files. The permanent fix is for the sender to switch that recipient to plain text or HTML.
Never just rename and run
If a .dat turns out to be an executable, renaming it to .exe and running it is how people get compromised. Identify it, and if it is a program you did not expect, delete it.
Programs that open .dat
Our pick, in order. Every one links to the publisher's official download URL and the SHA-256 hash of the installer, so you can check the file before you run it.
- HxD Hex EditorHex and Disk Editorv2.5 · 1 hashed installer85
- VLC media playerVLC is a free and open source cross-platform multimedia player and framework that plays most multimedia files, and various streaming protocols.v3.0.23 · 9 hashed installers96
- Sublime Text 4Sublime is a sophisticated cross-platform text editor for code, markup and prose.v4.0.0.420000 · 2 hashed installers92
Common questions
- What program opens a .dat file?
- There is no single program, because .dat is not a format. Identify the content first by reading the file header with a hex editor on Windows or the "file" command on macOS, then open it with the program that matches what it actually is.
- How do I open winmail.dat?
- winmail.dat is a TNEF wrapper produced by Microsoft Outlook when it sends rich-text formatting to a client that cannot read it. Your real attachments are inside. Use a TNEF extractor to unpack them, and ask the sender to send in HTML or plain text next time.
- Can I open a .dat file in Notepad?
- You can try, and if the content is text it will work. If it is binary you will see garbage, but nothing will be damaged as long as you do not save. Notepad is a reasonable first test.
- Is a .dat file a virus?
- Not inherently, and the extension itself does not run. The risk comes from renaming an unknown .dat to an executable extension and launching it. If a .dat arrived unexpectedly, identify it before doing anything else.