1. Windows
2. Mac / Linux

# Fix Corrupted Nikon NEF Images

Downloading NEF images from newer Nikon cameras with Nikon Transfer 1 or older versions of ViewNX 2 (and probably Capture NX 2) may result in corrupted NEF images that can no longer be opened.

This utility repairs these corrupted NEF images for the D4, Df, D600, D610, D750, D800, D800E, D810, D850, D3200, D5200, D5300, D5500, D7100, D7200 and D7500.

It DOES NOT REPAIR images corrupted by memory card problems, disk errors, or other software. [Nikon NX-D has also been known to corrupt images (possibly related to changing the file byte ordering!), but these problems are not fixed by this utility.]

> Warning! If you modify the corrupted images with any other software before fixing them with this utility, then the raw image data may be permanently lost! (This may happen for instance if you use View NX2 to geotag the images after downloading.)

Follow the instructions below for running this utility on Windows or Mac / Linux systems.

See this thread in the ExifTool forum if you have any questions or comments.

[Note that Nikon doesn't learn from their mistakes, and a similar problem happened 2 years earlier with an older version of Nikon Transfer and the D5000 (read here), and the new Nikon NX-D software has other corruption issues. The moral is: Don't use Nikon Transfer or any other utility that modifies the file to download your precious images!]

It is very sad that this Nikon software bug penalizes only loyal Nikon owners (since it affects only people who had an older copy of the Nikon software from a previous camera), yet Nikon customer support provides no help other than suggesting that you contact your memory card manufacturer to see if the original images can be restored.

## Windows Users

1. Download and open "fix_corrupted_nef_win.zip", then move the "fix_corrupted_nef.exe" application onto your hard disk.
2. Drag and drop the corrupted NEF files and/or folders onto the "fix_corrupted_nef.exe" application.
3. A command window should open and prompt with this message:
   "Bit depth of compressed images (12 or 14) [14]?"
   Type either "12" or "14", then press RETURN. If you don't know the bit depth of your compressed NEF images, or if you have mixed 12 and 14-bit compressed images, or if you have only uncompressed NEF images, just type "14" (or simply press RETURN). If this is wrong for some images, you will not be able to open the fixed images (but you can delete these and re-generate them with the other bit depth later). Note that this number is ignored for the D3200 and D5200 since the NEF bit depth can not be changed for these cameras.
4. The application should now run and create a "fixed" folder beside each of the original NEF images. This folder contains the fixed NEF images with the same names as the originals.
5. Verify that you can open the fixed NEF images. If you can't open any of the images, delete them and go back to step 2, but this time select the other bit depth in step 3. (Only the images you deleted will be re-generated, the others won't be touched.)

With any luck, the mess caused by the Nikon software is now fixed, and all of your NEF images are now restored!

If you are feeling so happy that you absolutely must send me a donation, this can be done from the ExifTool home page.

- Phil Harvey

## Mac / Linux Users

1. Download and expand "fix_corrupted_nef.zip" into a directory on your hard disk.
2. Open a Terminal window. (on Mac, launch /Applications/Utilities/Terminal)
3. Drag and drop "fix_corrupted_nef.pl" onto the Terminal window. (Note: The distributed "lib" folder must exist in the same folder as the "fix_corrupted_nef.pl" application. If you moved "fix_corrupted_nef.pl" to a different folder you must also move its "lib" folder to the same place before running.)
4. Drag and drop the corrupted NEF files and/or folders onto the Terminal window.
5. Select the Terminal window, then press RETURN on the keyboard.
6. You should see this prompt:
   "Bit depth of compressed images (12 or 14) [14]?"
   Type either "12" or "14", then press RETURN. If you don't know the bit depth of your compressed NEF images, or if you have mixed 12 and 14-bit compressed images, or if you have only uncompressed NEF images, just type "14" (or simply press RETURN). If this is wrong for some images, you will not be able to open the fixed images (but you can delete these and re-generate them with the other bit depth later). Note that this number is ignored for the D3200 and D5200 since the NEF bit depth can not be changed for these cameras.
7. The "fix_corrupted_nef.pl" application should now run and create a "fixed" folder beside each of the original NEF images. This folder contains the fixed NEF images with the same names as the originals.
8. Verify that you can open the fixed NEF images. If you can't open any of the images, delete them and go back to step 3, but this time select the other bit depth in step 6. (Only the images you deleted will be re-generated, the others won't be touched.)

With any luck, the mess caused by the Nikon software is now fixed, and all of your NEF images are now restored!

If you are feeling so happy that you absolutely must send me a donation, this can be done from the ExifTool home page.

- Phil Harvey

### Revisions

2019-01-09 - Version 3.2 - Added support for D7500 images

2017-11-03 - Version 3.1 - Added support for D850 images

2016-09-14 - Version 3.0 - Added support for D5300 images

2016-08-04 - Version 2.9 - Added support for D500 DX and 1.3x images

2015-09-25 - Version 2.8 - Added support for D7200 images

2015-08-31 - Version 2.7 - Added support for D5500 images

2015-08-13 - Version 2.6 - Added support for other D810 image sizes

2015-08-11 - Version 2.5 - Added support for D810 FX and DX images

2014-11-15 - Version 2.4 - Added support for D750 FX, DX and 1.2x images and improved recognition of corrupted images

2014-10-19 - Version 2.3 - Added support for D4 1.2x and 5:4 crops

2014-10-10 - Version 2.2 - Added support for D4 DX images

2014-09-02 - Version 2.1 - Added support for Df FX and DX images

2014-05-17 - Version 2.0 - Added support for D610 images

2013-08-01 - Version 1.9 - Added support for D600 movie-cropped images

2013-06-17 - Version 1.8 - Added support for D7100 1.3x cropped images

2013-06-12 - Version 1.7 - Added support for D5200 images

2013-05-16 - Version 1.6 - Added support for D7100 images and D800 5:4 cropped images

2013-03-26 - Version 1.5 - Added support for D600 DX images

2013-01-15 - Version 1.4 - Added support for D3200 images

2013-01-07 - Version 1.3 - Added support for D800 DX images

2012-11-03 - Version 1.2 - Added support for D600 FX images

2012-09-26 - Version 1.1 - Added support for D4 FX images

2012-09-08 - Version 1.0 - Initial release (fixes D800 FX images)

Created Sept. 8, 2012

<-- Back to ExifTool home page