.fw files.wiki
DOC

DOC Files

Microsoft Word Binary Document

.DOC files are usually legacy Microsoft Word binary documents, but the extension is also used by plain-text documentation files.

Microsoft Word Binary Document (Word 97–2003 / Compound File Binary Format)

Most common
Developer
Microsoft
Category
Documents
MIME type
application/msword
Format
Container
Magic bytes
D0 CF 11 E0 A1 B1 1A E1
First released
1997
Latest version
Word 2003 binary format / MS-DOC specification
Open standard
No

Plain-text documentation file

MIME type
text/plain
Format
Text
Open standard
Yes

Microsoft Word for DOS / early Word binary document

Developer
Microsoft
MIME type
application/msword
Format
Binary
Magic bytes
DB A5
First released
1983
Latest version
Word for DOS 6.0
Open standard
No

WordPerfect Document using .DOC extension

Developer
Corel / WordPerfect Corporation
MIME type
application/vnd.wordperfect
Format
Binary
Magic bytes
FF 57 50 43
First released
1980
Latest version
WordPerfect 2021 document format
Open standard
No

Online .DOC Text Viewer

Reading file…

What is a .DOC file?

Most often DOC stands for the legacy document format that Microsoft Word 97, 2000, 2002/XP, and 2003 utilized until the release of DOCX by default starting from Word 2007. DOC format is characterized by a formatted Word processing file with text and such elements as styles, sections, tables, images, OLE embedded items, comments, changes, fields, headers, and footers, which can also include, depending on specific conditions, VBA macro. The Microsoft Document format for Word 97 through Word 2003 is implemented in the context of the MS CFB (Compound File Binary) format and usually starts with D0 CF 11 E0 A1 B1 1A E1 (instead of text).

Besides this, another type of .DOC file with a corresponding extension could be found in the source codes as a readable text with no fixed magic numbers. Another possible format where the extension is utilized could be the documents of WordPerfect as well as Word for DOS, however, some of these documents may start with DB A5. Some other Word processors may also use .DOC files, but this time as a regular name of document. However, WordPerfect Document will start with such combination of magic bytes as FF 57 50 43 located on offset 0.

The user is likely to meet with DOC files either being archived business records, as an attachment to e-mail or just some pre-2007 office suite's documentation or a template. To detect binary Word, plaintext files and corrupted data the easiest way is looking into several bytes.

How to open a .DOC file

Open a .DOC file on Windows

  1. 1 Go to the folder with your file in File Explorer. Usually, downloaded files end up in Downloads.
  2. 2 Double-click your .DOC file if you have an app for .doc files on your computer. In case it does not open, move on to step three.
  3. 3 Right-click your .DOC file -> select Open with -> Choose another app.
  4. 4 Choose Microsoft Word in the list (Windows 11: choose Always). For Windows 10 -> put a check on "Always use this app to open .doc files" and click OK.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for Windows

Open a .DOC file on macOS

  1. 1 In the Finder app, locate your .DOC file.
  2. 2 Just double-click your .DOC file in order to automatically launch the program which is connected with it.
  3. 3 Need another app on your Mac? Control-click the file (or right-click with a mouse). In the pop-up menu select Open With -> Microsoft Word.
  4. 4 If it isn't in the list, choose Other… and find the application manually.

Still not opening? See common problems and fixes, or view it in your browser.

Open a .DOC file on Linux

  1. 1 Launch your file manager. Depending on the desktop it may be named Files (GNOME), Dolphin (KDE Plasma), Nemo (Cinnamon) or Thunar (Xfce).
  2. 2 Double-click the file.
  3. 3 Or choose another program by right-clicking the file -> Open With -> LibreOffice Writer.
  4. 4 Install LibreOffice Writer (if it is not installed on your computer) from the software centre, repository or Flathub.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for Linux

Open a .DOC file on Android

  1. 1 Launch Files or another file management app.
  2. 2 In Downloads, find the .DOC file and open it by tapping.
  3. 3 A list of apps capable of opening the file will be shown. Tap Microsoft Word and press Always to permanently connect the file type with this app.
  4. 4 No apps able to open this file? Download Microsoft Word from the Google Play Store.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for Android

Open a .DOC file on iPhone / iPad

  1. 1 Use the Files app and go to On My iPhone, iCloud Drive or Downloads.
  2. 2 Tap the .DOC file you want to open.
  3. 3 If the file can be opened by a built-in iOS app (supported format), it opens automatically.
  4. 4 Touch and hold the file to get the context menu -> choose Share -> select Microsoft Word from the list of apps.
  5. 5 If there is no such option, download the app first from the App Store and then tap the document again.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for iPhone / iPad

Open a .DOC file online

  1. 1 Move to the online viewer at the top of this page.
  2. 2 Drag the file there or select it, and its contents will appear in your browser tab. The file is not uploaded.

Still not opening? See common problems and fixes, or view it in your browser.

Programs for Online

More details about opening .DOC files

Windows' paid software Microsoft Word provides most compatible and exact opening options including keeping layout from Word 97-2003 format files, macros in Visual Basic for Applications, comments, passwords in document, as well as exporting into newer formats like .DOCX or to PDF. The free alternative is the LibreOffice office suite, which also offers Writer - free document editor supporting all three main computer operating systems and offering compatibility with Word .DOC files as well as exporting options including batch command line conversion by the means of soffice executable with arguments --convert-to pdf (or other formats). There is also Apache OpenOffice writer for .DOC files. On Linux platform AbiWord opens most basic and simple documents.

macOS and iOS Pages offer importing Word documents and the capability of exporting those in PDF or DOCX format. Pages might lose macros or more complex formatting of a document like tables, exact page breaks etc.

For mobile devices Android and iOS platforms' MS Word, Google Docs, WPS Office, or ONLYOFFICE software provide the most complete compatibility with document .DOC format, except macros that are usually either not supported or not possible to enable. Google Docs, Word for the web, ONLYOFFICE DocSpace/Workspace, or iCloud Pages in a web browser allow uploading the document and its further modification there. For secure exchange of confidential documents you should only trust reputable and secure services.

In case of plain-text content, open it using any text editor capable of displaying text in Unicode or in some older codepages. Make sure you open the file in the right program if opening directly with double clicking does not work and do not change extension before testing with different programs.

Technical details

Word 97 through Word 2003 .DOC files use the Compound File Binary Format (sometimes called OLE structured storage file format). The file is essentially a binary structure which contains sectors of either 512 or 4096 bytes, depending on the selected FAT sector size for the file. The initial bytes signature in offset 0 consists of values D0 CF 11 E0 A1 B1 1A E1. In terms of the binary file structure it has directory entries as well as named streams: WordDocument, 0Table or 1Table, Data, SummaryInformation, DocumentSummaryInformation. When there are macros inside of the file, one can have also an additional VBA project storage inside the same compound binary file. This format specification is disclosed and published by Microsoft as part of its binary file formats for Office and MS-DOC documents, but unlike ODF and OfficeOpenXML formats of .DOCX the compound binary .DOC is not an ISO-standardized open specification.

The text itself can be found in document pieces using a single-byte code page or the 16-bit encoding, UTF-16LE encoding. It also uses the Piece table to link the positions of logical characters within the text to their location in the actual binary stream of WordDocument stream which requires parsing of both the pieces table as well as of the document itself while text extraction. Since there is no compression applied (unlike ODF), the storage is allocated in sector-sized blocks within CFBF structure - that means DOC-file is going to take larger space on disk then DOCX unless there are lots of graphical and embedded OLE files. Metadata information could include: author, company, template path, editing date, number of revisions and comments, hidden text and tracking changes. Usual sizes could be from ten thousands of bytes needed for simple letter up to many Mbytes when there are lots of images and OLEs. Possible corruption problems relate to FAT tables, directory entries, or to the data of WordDocument stream or table streams.

How to convert .DOC files

If one wants to open this format in software that supports editing of .docx file such as Microsoft 365 or even Google Docs (or Apple Pages), then it has to be converted to .docx. This can be done either by using File -> Save As option from Microsoft Word main menu or by using batch operation from Libreoffice command-line: ``` soffice --headless --convert-to docx --outdir out input.doc ```

If one wants to convert .doc files to other formats just because there should be no changes to formatting and layout at all, then it can be saved as pdf document with options that do not change this document format (e.g., for sharing, printing, or records management). Both MSWord and LibreOffice allow conversion into this document type but MS Word will better preserve document size and layout during conversion. Batch operation looks the same way as in previous case (and even saves some time during processing big amount of documents): ``` soffice --headless --convert-to pdf --outdir out input.doc ``` As one can see it does not allow font substitution on recipient computer side, and even the pages will not differ very much but this format is not meant for later editing.

ODT format is preferable to use if the file will be imported to other OpenDocument applications like Libreoffice because of possibility to use batch process for this operation: ``` soffice --headless --convert-to odt --outdir out input.doc ```

Convert toToolCommand / note
PDF LibreOffice soffice --headless --convert-to pdf --outdir out input.doc Best general-purpose batch conversion; layout depends on available fonts and import filter quality.
DOCX LibreOffice soffice --headless --convert-to docx --outdir out input.doc Modernizes legacy .doc files to Office Open XML; some macros, fields, and old formatting may change.
HTML Pandoc pandoc input.doc -o output.html Pandoc can read .doc through supported readers in current builds; complex page layout and tracked-change details may not survive.
ODT LibreOffice soffice --headless --convert-to odt --outdir out input.doc Useful for open-document workflows; proprietary Word features may be approximated.
TXT antiword antiword input.doc > output.txt Extracts readable text from many Word 97–2003 files but discards images, tables, comments, and layout.
PDF Microsoft Word Use File > Save As or Export > Create PDF/XPS; usually preserves Word layout better than third-party importers.

Common problems and fixes

For example, Word displays "Word experienced an error trying to open the file" when Windows blocks the attachment, when the attached file is located on a network storage place rather than local, or because of damages of its file structure. To work around it in Word, one should click File>Options>Trust Center>Trust Center Settings>Protected view and file blocking settings, copy the .DOC to the local drive and File>Open>Browse>Open and Repair the file. Alternatively, if Word still fails, LibreOffice Writer can often open .doc files and save them as .DOCX or .ODT (and hence to fix minor stream damage during import).

"The file is corrupt and cannot be opened" implies truncation of email attachments, failure of downloading or damages of CFBF (compound file binary format) allocation tables. One should re-download the document in this case or retrieve its backup; prior to that it is worth to run word Open & repair on the file or to try hex-level data recovery on its individual sectors. When Notepad returns "binary trash" as a result, the document should rather be interpreted as either genuine Word and WordPerfect binary document rather than a .DOC text-file; it needs to be opened with help of either Microsoft Word, LibreOffice and some other Word file browser. For ancient versions of Word documents opened incorrectly because of characters being not right, it is advised to set up Windows-1252; CP437; ISO-8859-1; Shift JIS; UTF-8 encoding of the file in the file editor.

"To open it in the newer version is required" message appears more often for .docx, yet in case of embedding objects, fields, importing data of a document it may well appear also on .doc file. Update your Office program to the recent one or use the converter in the source program of your .DOC files creation. Fonts missing change line spacing or pagination, therefore install correct fonts for it and if possible use metrically compatible ones. In case of password protection of .DOC files, the original open password may be required; in addition some unsupported viewing software says that the document in question is either corrupted or encrypted. In Word, macros, ActiveX controls and linkedOLE objects may be disabled, and in this case enable their usage exclusively for reliable documents.

Security considerations

Word 97-2003 documents with a .DOC extension might carry out some malicious operations such as execution of VBA macros, use of built-in document automatic triggers, implementation of OLE objects, exploitation via ActiveX controls, presence of hyperlinks to websites, and exploit of parsers in the Office applications suite. Such attachment can appear in phishing e-mails due to obsolete format and possibility of running malicious macros. There are four protection measures for the DOC files you get through Internet downloads and email messages: Microsoft Office Protected View, Mark-of-the-Web blocking technology, antivirus analysis, and ability to block Office macros on internet-sourced files. Don't enable macros and editing unless you confirmed who the sender was and your need to see their documents through a separate channel. For viewing suspicious attachments, apply sandboxes with viewers, update LibreOffice and use it for opening DOC, or save them to PDF from an isolated system; none of these guarantees safety absolutely. Finally, some data about the author of such files, including template location, track changes, comments, invisible strings and other elements, printer settings and even remnants of revision history can be exposed. Use Document Inspector before distributing files. The .DOC document with text only is rather safe to execute.

History and versions

Word for DOS made its first appearance in 1983, using the .DOC file type before Windows took up prominence as Microsoft Word's primary operating environment. Version 1.0 of Word for Windows saw its release in 1989, and the .DOC file type became popular through Microsoft Word in the office suite during the decade of the 1990s. Then came the introduction of the well-known binary Word format .DOC version 97-2003 from the year 1997 (used by Word 97, 2000, 2002/XP, and 2003 and created using a format named OLE Compound File), with Microsoft making changes to Word 2007 so that the save option would use the new Word 2007 file format .DOCX (ZIP package known by the name of Office Open XML). Nevertheless, Microsoft continued to provide the capability for saving and opening Word Documents (version 97-2003 binary .DOC format); it provided office binary formats documentation via interoperation, and Microsoft documentation regarding MS-DOC format can still be found on Microsoft Learn. The version .DOC is a proprietary and fully documented format, and not ISO standardized; standardized alternative to .DOC is the OOXML / DOCX format, as well as ODT format.

DOCX is today's default format in Microsoft Word based on Office Open XML which is more compressed and allows easy viewing unlike Binary DOC. DOCM is macro-enabled OpenXML format, so use it instead of DOCX whenever VBA macros are required in a newer file structure container. RTF format is universal and readable, but does not include all the information included in .DOC. ODT is OpenDocument Text that belongs to Open Document Format family of software such as Apache openoffice and can be considered an option as neutral editing format. PDF has a static layout and thus should be considered more appropriate for publication/printing, whereas DOC format is more convenient when it comes to editing. TXT and MD (markdown), both free from hidden metadata and macros can be used for source trees and documentation. WPD format belongs to WordPerfect application which sometimes appears as DOC format. .DOT and DOTX are template formats rather than documents themselves.

Comments (0)

Replying to

No comments yet. Be the first to share your experience with this file type.