MDI File Documentation


Summary

A Microsoft Document Imaging File is a scanned document or fax saved by Microsoft Office Document Imaging (MODI), a tool bundled with Office 2003 and 2007. The .mdi file is Microsoft’s proprietary variant of TIFF, so it begins with an altered EP header that standard TIFF viewers reject. MODI was discontinued, so the reliable fix is Microsoft’s free MDI to TIFF File Converter, which turns it into a normal TIFF you can then save as PDF.

Technical details

FeatureValue
Full nameMicrosoft Office Document Imaging file (MODI)
File extension.mdi
MIME typeimage/vnd.ms-modi
Format typeMulti-page raster scan, Microsoft variant of TIFF
DeveloperMicrosoft Corporation
IntroducedOffice XP / Office 2003 (MODI tool)
StatusDiscontinued (last shipped Office 2007, deprecated 2010)
Open standardNo (proprietary; compression schemes undocumented)
Byte orderLittle-endian
Magic number (hex)45 50 2A 00 (EP*\0) at offset 0
Standard TIFF header49 49 2A 00 (II*\0) — MDI swaps II for EP
Specification[MS-MODI] (Microsoft Open Specifications)
PagesOne or more scanned page rasters (multi-page)
OCR text layerOptional (MODI OCR made scans searchable)
AnnotationsOptional MODI markup over the page
Native openerOffice 2003/2007 MODI component (legacy)
Migration toolMicrosoft MDI to TIFF File Converter (mdi2tif.exe, free)
Related extensions.tif, .tiff, .pdf, .xps
Specification URLlearn.microsoft.com/openspecs/windows_protocols/ms-modi
File signature (magic bytes)
45 50 2A 00

An .mdi begins with 45 50 (ASCII EP) followed by 2A 00 at offset 0. This is a deliberate tweak of the TIFF header: a little-endian TIFF starts with 49 49 2A 00 (II plus the magic number 42, 0x002A). Microsoft replaced the II byte-order marker with EP while keeping the 2A 00 magic. Because the byte-order field no longer reads II or MM, standard TIFF decoders refuse the file even though its internal structure is TIFF-like. Converting it to a real TIFF (which restores the II header) is exactly what Microsoft’s MDI to TIFF File Converter does.

What is an MDI file?

A Microsoft Document Imaging File is the native format of Microsoft Office Document Imaging (MODI), a utility bundled with Office XP, 2003 and 2007 for scanning paper documents, running OCR on them and storing the result. An .mdi holds one or more scanned page images (it is a multi-page raster format) and, optionally, an OCR text layer that makes the scanned document searchable. Technically it is Microsoft’s proprietary variant of TIFF: close enough to begin with a TIFF-like header, but altered just enough that ordinary TIFF viewers reject it.

The format is obsolete. MODI was the only component that used .mdi, it shipped for the last time in Office 2007, and Microsoft deprecated it in Office 2010. So anyone on modern Windows or a current Office is almost certainly looking at an old scan, a fax archive, or a document someone digitised years ago, and cannot open it with installed software. The rest of this article explains why the file resists normal image tools and what the format actually contains.

The EP header: a deliberate TIFF variant

The defining technical feature of an .mdi is its header. A little-endian TIFF file begins with the bytes 49 49 2A 00: II (“Intel”, meaning little-endian byte order) followed by the TIFF magic number 42 written as 2A 00. An .mdi instead begins with 45 50 2A 00: the ASCII letters EP replacing the II byte-order marker, while the 2A 00 magic number is kept.

Standard little-endian TIFF : 49 49 2A 00   "II" + magic 0x002A
Standard big-endian TIFF    : 4D 4D 00 2A   "MM" + magic 0x2A00
Microsoft MDI               : 45 50 2A 00   "EP" + magic 0x002A

The first two bytes of a TIFF are supposed to declare byte order and must be either II or MM. Because an .mdi presents EP there instead, a conforming TIFF decoder cannot determine byte order and rejects the file at the first check, even though everything after the header follows TIFF conventions. This single altered field is why a scan that is structurally almost a TIFF cannot be opened by Photos, IrfanView, GIMP or any standard viewer. The reliable repair is to run the file through Microsoft’s MDI to TIFF converter, which rewrites a valid II header and produces a file every image tool accepts.

The TIFF-style structure inside

Past the header, an .mdi follows the TIFF model: an Image File Header points to an Image File Directory (IFD), and each IFD is a list of tagged fields describing one page. A tag records something like image width, height, bits per sample, compression type, and the offset to that page’s pixel data. Because TIFF IFDs chain (each points to the next), a single file can hold many pages, which is how a multi-page scanned document, a whole faxed contract for example, lives in one .mdi.

The catch is compression. MODI stored page images using compression schemes that Microsoft did not publicly document, so while the tag structure is TIFF-like, an independent decoder cannot necessarily decompress the pixels the way it could for a standard TIFF using CCITT Group 4 or LZW. This is the second reason third-party tools struggle with .mdi beyond the header issue, and why the practical path is conversion with Microsoft’s own tool rather than coaxing a generic library into reading it.

The OCR text layer and annotations

MODI was not just a scanner; it ran optical character recognition and could store the recognised text alongside the page image. When present, that OCR layer is what makes an old scan searchable and lets MODI’s “Send Text to Word” command lift the words out as editable text. MODI could also overlay annotations, markup drawn on top of the scanned page. Both the OCR text and any annotations are additional data carried in the file beyond the raw page raster. If an .mdi was created without running OCR, there is no text layer to extract, and recovering the words means re-running OCR on the page image after converting it.

Opening and converting an MDI today

There are two working paths. If you still have Office 2003 or 2007 with the MODI component installed (you sometimes have to add the feature), double-clicking the .mdi opens it in Microsoft Office Document Imaging natively, with OCR available. On any modern system, the dependable route is Microsoft’s free standalone MDI to TIFF File Converter (mdi2tif.exe). It batch-converts .mdi files to standard multi-page TIFF that Windows Photos and every image viewer open:

mdi2tif.exe -source contract.mdi -dest contract.tif

From the resulting TIFF, producing a PDF for sharing is a second step: print the TIFF with “Microsoft Print to PDF”, or open it in IrfanView or Acrobat and Save As PDF. The canonical migration order is therefore MDI → TIFF → PDF, with the TIFF stage being the one that actually decodes the proprietary format. Because MODI and its format are dead, the sound advice is to convert important .mdi archives to TIFF or PDF now, while Microsoft’s free converter is still available.

MDI is not MIDI

One frequent confusion is worth settling: .mdi is not .mid/.midi. MDI here is a scanned-document image format from Microsoft Office Document Imaging. MIDI is a completely unrelated music and instrument-control format. The letters “MDI” also name Multiple Document Interface, a Windows windowing style, which is a programming concept and not a file you open. Only the Microsoft Office Document Imaging meaning is a scanned-image file with the EP header described above.

FAQ

How do I open an MDI file on Windows 10 or 11?

Modern Windows and Office cannot open it directly because MODI was discontinued. Install Microsoft’s free MDI to TIFF File Converter to turn the .mdi into a standard TIFF, then open that in Windows Photos. If you still have Office 2003/2007 with the MODI component, it opens .mdi natively.

Why won’t my MDI open as a TIFF even though it looks like one?

Because MDI is a Microsoft variant of TIFF with a changed header: it starts with EP (45 50) instead of TIFF’s II, so standard TIFF decoders cannot read the byte-order field and reject it. Run it through the MDI to TIFF converter, which writes a valid TIFF header.

Can I still get the text out of an old MDI scan?

Yes, if it had an OCR layer or you re-OCR it. In Office 2007 MODI, run OCR and use “Send Text to Word”. Otherwise convert the file to TIFF or PDF and run OCR in OneNote, Adobe Acrobat, or another OCR tool.

References