What Is a NEF File? Nikon's Raw, and Why It Is Not a Photo Yet
NEF is Nikon raw. Jump to your question below, or work through it in order.
NEF is Nikon raw. Jump to your question below, or work through it in order.
A NEF file is the raw photo your Nikon camera saved. NEF is short for Nikon Electronic Format. It holds what the sensor measured and the settings you chose, kept apart from one another.
A NEF is not a picture yet, and that is the point. Your camera settings sit in the NEF file as instruction sets, so changing your mind later costs nothing at all.
That is also why one NEF looks different in all software. All of them develop the same numbers in their own way, and none of them is wrong.
Raw image files are sometimes referred to as digital negatives. A NEF file is raw image data your Nikon sensor saved, written to the memory card with almost nothing done to it. Every pixel on the camera's sensor measured one brightness value. Your camera wrote those values down and stopped.
NEF files contain all the image information the sensor captured, plus the image metadata. Beside raw image data sits the metadata: camera identification, the lens, the shutter speed, the aperture, the date.
And beside that sit the settings you chose, white balance, hue, tone and sharpening, stored as instruction sets rather than applied to the picture.
A NEF keeps 12-bit or 14-bit data depending on the camera, which gives a far greater tonal range than the 8 bits in a JPEG.
That split between data and decisions is the entire idea. A JPEG has your settings baked into every pixel. A NEF keeps your settings in a note, and sensor data under the note never changes.
Sensor data in one place, your calls in another. Nothing you choose in your camera is final, because nothing you choose is written into your picture.
.nef, with .nrw on some Coolpix bodiesimage/x-nikon-nef, never registered with IANAWrong page? Canon raw sits in CR2 files and Sony raw in ARW files. The documented format Adobe built for all of them is the DNG format.
Nikon made NEF and has never published it. The structure under it is not secret at all: it is TIFF, following an ISO standard from 2001.
NEF is Nikon's raw image file format and it is proprietary, which means Nikon owns it. The company has never released the specification, so all software that opens one either licensed one from Nikon or worked it out by reading files.
The surprise is what sits under it. Open NEF files in a hex editor and the first four bytes are TIFF. Not something like TIFF. Actual TIFF, the same header a scanned document uses.
| When | What happened |
|---|---|
| 1999 | The Nikon D1 arrives and writes the first NEF files |
| 2001 | TIFF/EP published as ISO 12234-2, the standard NEF follows |
| 2004 | Adobe publishes DNG, open, and built on the same standard |
| Apr 2005 | Nikon encrypts white balance data. Adobe cites the DMCA and will not break it |
| Mar 2021 | NX Studio replaces ViewNX-i and Capture NX-D as Nikon's free software |
| Dec 2021 | The Nikon Z 9 adds High Efficiency raw, which halves NEF files and keeps 14 bits |
The standard in row two is worth naming. ISO 12234-2:2001, Electronic still-picture imaging, Removable memory, Part 2: TIFF/EP image data format describes how to store camera raw images inside TIFF. It is a subset of TIFF 6.0, carrying Exif tags.
Wikipedia puts it plainly: Nikon NEF is TIFF/EP in all but name, complete with a tag which identifies the version of TIFF/EP they are based on. That tag has a number, 37398, and the name TIFF/EPStandardID.
So the shape of NEF files is public and the contents are not. Nikon's own additions live in a block called the MakerNote, which is where the camera settings, the lens data and, for a while, the encryption all sat.
This is why free software can read your photos. The TIFF skeleton is public, so decoders know where to look before they know what they are looking at. Everything else came from people reading thousands of files and writing down what changed.
A NEF that will not open is almost never damaged. Your software is older than your camera, and every Nikon body writes these files in its own way.
There is no single raw format. Nikon changes your file with every new camera, so software that reads NEF files from a D850 can refuse a Z 8 outright. The fix is an update, not a repair tool.
Notice that three of those four are about the program rather than your file. The bytes on your card are fine in every one of them.
A gray or black thumbnail is a decoder problem, not lost work. Install the Raw Image Extension on Windows, or drag your file into NX Studio. If your picture appears there, nothing was ever wrong with it.
Trouble with the computer rather than the NEF? Our Windows error guides and macOS fixes cover your file association problems behind most double-click failures.
Nikon gives NX Studio away. macOS opens NEF files already, Windows needs one free extension and two open-source editors handle the rest.
Every result that wants money for this is selling something Nikon hands out. NX Studio is free, runs on Windows and macOS and reads every Nikon camera ever made, including whichever one came out last month.
| Software | Runs on | Why choose it |
|---|---|---|
| NX Studio | Windows, Mac | Free from Nikon. Reads every body, and applies your Picture Control just as your camera did |
| Apple Preview | Mac | Built in. Double-click and your photo opens |
| Microsoft Photos | Windows | Needs the free Raw Image Extension from the Microsoft Store first |
| darktable | Windows, Mac, Linux | Free and open source. A full raw tool with its own catalog |
| RawTherapee | Windows, Mac, Linux | Free, and the finest control over demosaicing of anything here |
| ExifTool | Windows, Mac, Linux | Not a viewer. Prints all the tags in your file, Nikon's own included |
| Adobe Lightroom | Windows, Mac | Paid, and the standard in most studios. Adobe Camera Raw does the decoding |
Paid programs open NEF files too. Corel PaintShop Pro, Corel AfterShot Pro and Adobe Photoshop all read them, and Apple Photos and Google Photos both show them on a phone. The Raw Image Extension deserves its own line. Search results for raw files on Windows are full of paid converters, and the answer is free from the Microsoft Store.
Install it once and NEF thumbnails appear in File Explorer and open in Photos.
Use NX Studio. Nothing else reads Nikon Picture Controls the same way.
Use darktable. Catalog, develop and export, open source.
Nikon ViewNX2 still appears on half the results for this question. Nikon replaced it, then replaced its replacement. NX Studio arrived on 4 March 2021 and Nikon said support for ViewNX-i and Capture NX-D was not planned going forward. Download NX Studio.
A NEF is a TIFF with Nikon's own block bolted in. Four parts matter: the TIFF header, the metadata tags, the full-size JPEG preview and sensor data itself.
Open NEF files in a text editor and the first thing you see is readable. Two bytes give the byte order, which way round numbers are written, then the word Nikon appears within the first screen. All of it after that is a TIFF directory.
| Part | What it holds |
|---|---|
| TIFF header | Eight bytes. 49 49 2A 00 or 4D 4D 00 2A, then where the first directory starts |
| Exif tags | Shutter, aperture, ISO, lens, date, camera identification. Standard tags any reader understands |
37398 | TIFF/EPStandardID, the tag that names which version of the standard this file follows |
| MakerNote | Nikon's own block. Picture Control, focus points, lens corrections, shutter count |
| Thumbnail | A small JPEG for file browsers and your camera's grid view |
| JPEG preview | A full-size JPEG your camera made, which is what the rear screen showed you |
| Raw image data | Nearly all the bytes. One 12-bit or 14-bit number for every pixel on the sensor |
The JPEG preview explains one thing people find strange. A file browser with no raw decoder still shows the right photo, because it is reading that preview. Then a proper editor opens the same file and your picture changes, because now something is developing the raw image data instead.
The MakerNote is where Nikon keeps everything the TIFF standard has no tag for. It is also where the 2005 encryption lived, and where the shutter count sits that people pay websites to read for them. ExifTool prints it free.
Every four-byte tag number is in the open. ExifTool names about 500 of them in Nikon files. Run exiftool photo.nef and your camera, the lens, the shutter count and the Picture Control all print as plain text.
Every pixel measured one color, not three. Working out the other two is guesswork and all software guesses differently. That is why one NEF has no single look.
This question sends people looking for a setting to fix, and there is nothing to fix. Raw files have no look of their own. Something has to decide what it looks like, and different software decides differently.
A camera sensor measures brightness and nothing else. To get color, the maker lays a mosaic of tiny filters over it, red, green, blue and a second green in every block of four. That mosaic is a color filter array, and almost every camera uses the Bayer pattern.
So every pixel in your NEF knows one color out of three. Half of them know green. The rest split between red and blue. Turning that into a full-color photo means working out the two missing numbers at every single pixel by interpolating from the neighbors around it.
That step is called demosaicing, and it is arithmetic with no single right answer.
Then come white balance, color translation into a working space, tone, noise reduction and sharpening. Every one is judgment. NX Studio makes Nikon's calls and Lightroom makes Adobe's.
Same maker, same calls. Nikon applies your Picture Control just as your camera did.
Adobe starts from its own profile. Switch the profile to Camera Standard and the two converge.
None of this is a defect and none of it is lost work. The sensor data is the same in all of them. What changed is the recipe, and you can change it again tomorrow.
Your camera screen is lying to you, pleasantly. What you review after a shot is the JPEG preview inside the NEF, made with your camera's own settings. A raw editor starting from scratch will almost always look duller at first. That is the starting point, not the result.
Same question, other makers? Canon CR2 files and Sony ARW files work the same way, and DNG files carry your camera profile in a public place.
Shoot NEF and keep it. The real decision is what you archive beside it, and that comes down to whether an open format matters more to you than Nikon's own settings.
Three of these four hold finished pictures and one holds the material for one. Comparing them on quality misses the point, so the table below compares them on what you can still do afterwards.
| NEF | DNG | JPEG | TIFF | |
|---|---|---|---|---|
| Holds sensor data | Yes | Yes | No | No |
| Bits per channel, and tonal range | 12 or 14 | 12 or 14 | 8 | 8 or 16 |
| Published specification | No | Yes, free | Yes | Yes |
| White balance still changeable | Yes | Yes | Barely | Barely |
| Opens everywhere | Needs a current decoder | Wide | Everywhere | Everywhere |
| Nikon Picture Control survives | Yes | Partly | Baked in | Baked in |
| File size, 45 MP | 22 to 55 MB | Similar | 8 to 20 MB | 130 MB plus |
Row three is the one archivists care about. The Library of Congress rates maker raw formats as less desirable for archives and names DNG as the alternative. The reason is one you can test yourself. DNG is royalty free and anybody may read its specification. No one outside Nikon may read the NEF one.
Row six is the one photographers care about. Convert to Adobe’s DNG and Nikon-only settings stop traveling with your photo, because only Nikon software knows what they mean.
Keep the NEF. Nikon reads its own file best, and nothing is lost.
Keep a DNG too. An open format outlives a licensing policy.
Comparing raw formats? The CR2 format and the older CRW format answer these questions on the Canon side. PSD files hold the layered edit a raw file never does.
Converting NEF files means developing them, and developing is one-way. Export a JPEG when you need one, keep the NEF and never replace the first file with its output.
There is no lossless route from NEF to JPEG, because a JPEG cannot hold what NEF files hold. What you can control is whether the original survives the trip. It should, every time.
NEF to JPEG or TIFF. One-way, and just what the format is for. Keep the NEF.
NEF to DNG. The sensor data moves across untouched into an open file.
Route one is the one no one mentions and plenty of people need. If a client wants something usable before you reach a computer, your camera will make it, from the same raw data, with the settings you choose on the back screen.
ExifTool prints what is in your file without developing anything. That settles most arguments about photos in two seconds: body, lens, shutter speed, shutter count and the Picture Control your camera saved.
Online NEF converters want your originals. A raw file is 25 to 55 MB of your work, and the free sites that convert one keep a copy on servers you cannot see. Nikon gives you NX Studio for nothing and Adobe gives you DNG Converter for nothing. Neither sends a byte anywhere.
Lossless compressed is the right default and it is free. Uncompressed costs storage and buys nothing. The settings worth thinking about are the lossy ones, and on current bodies they are very good.
Nikon's own page says the NEF file is written to the memory card “in either an uncompressed or lossless compressed form.” Every guide that copied that sentence stops there. Nikon menus have offered a third option for twenty years, and current bodies offer five.
| Setting | Size | What it does |
|---|---|---|
| Uncompressed | ~65 MB | Every number written out in full. No benefit over lossless |
| Lossless compressed | 55.1 MB | The default, and genuinely lossless. Returns the first numbers just |
| Compressed | ~35 MB | Lossy, despite sitting in the raw menu. Older bodies call it Compressed with no qualifier |
| High Efficiency star | 33.0 MB | Lossy. Nikon calls it nearly the same to lossless compressed |
| High Efficiency | 22.0 MB | Lossy, 60% smaller, and visibly so only in extreme recovery |
| Bit depth | 14-bit on all five. Depth and compression are separate settings | |
Two things in that table surprise people. Uncompressed is not the quality setting: lossless compressed gives the same numbers in a smaller file, which is what lossless means. And Compressed, sitting in the same menu, throws data away, which is why Nikon renamed the concept when it introduced High Efficiency.
High Efficiency star is the interesting one. Same 45 megapixels, same 14 bits and 40% smaller than lossless. Nikon says the two are nearly the same. Testing finds a difference only in photos pushed ten stops, which is not photography.
Set lossless compressed, 14-bit. Nothing is given up and cards last longer.
High Efficiency star is a fair trade. Lossless if you archive, HE* if you shoot volume.
Bit depth is its own menu item, and it is the one worth checking. Some Nikon bodies default to 12-bit, which halves the levels available in a recovered shadow. Set 14-bit once and leave it. The size difference is small beside what it buys.
In April 2005 Nikon encrypted part of the file your camera writes. Adobe would not break it and named the DMCA as the reason. That argument shaped how raw formats are archived today.
On 19 April 2005, DPReview reported that the NEF files from two new Nikon bodies, the D2X and the D2Hs, carried their white balance information encrypted. Software could read your photo and could not read the setting that tells it what color the light was.
Adobe said the encryption could be broken and that breaking it risked a lawsuit under the Digital Millennium Copyright Act.
Thomas Knoll, who wrote Photoshop and its raw converter, put the objection in one sentence: “I think the copyrighted information inside the NEF file belongs to the photographer, not Nikon. But Nikon apparently thinks they own the information inside the NEF.”
| When | What happened |
|---|---|
| 19 Apr 2005 | The encryption is made public. White balance data in D2X and D2Hs files |
| Within days | Adobe names the DMCA as its reason for not decrypting, and photographers take sides |
| 25 Apr 2005 | Nikon answers that the move “protects the uniqueness of the file” |
| Nikon's offer | A development kit, to developers Nikon calls bona fide, who apply in writing |
| What open source did | Worked it out anyway. dcraw and its descendants read these files today |
| What Adobe did | Shipped support, and kept pushing DNG, which it had published the year before |
Nikon broke its silence on 25 April 2005 and has said little about it since. Wikipedia records the practice without drama. Several major camera makers, Nikon, Canon and Sony among them, encrypt portions of the file to keep third-party tools out.
The same article lists decoding among the processing steps, noting that raw data is encoded for compression and often for obfuscation too.
Twenty-one years later nothing stops you opening NEF files. The lesson is narrower and it is about time rather than software. A format no one outside one company may document is a format whose future depends on that company staying interested.
Nothing to do. Every editor worth using reads NEF files today.
Add a DNG copy. An open format does not depend on a policy.
The Library of Congress already made this call. Its format guidance rates maker raw formats as less desirable for archives. It names DNG as the suggested alternative. That is not about image quality. It is about whether anybody will be able to read your file.
Shoot NEF when the light is hard or your picture matters. Shoot JPEG when your picture has to leave your camera finished. Most Nikon bodies will write both at once.
For difficult light, NEF wins outright. A sky you blew out, a face in shadow, white balance set wrong under tungsten. All three come back from 14 bits of sensor data. None of them comes back from 8.
For speed, NEF costs you. Files run 22 to 55 MB against 8 to 20 for JPEG, cards fill faster, burst rates drop sooner and every photo needs developing before anybody else can see it.
Shoot NEF plus JPEG. The JPEG goes out today, the NEF waits for you.
Keep the NEF forever. Exports are replaceable. Sensor data is not.
Everything on this page in one block: names, bytes, tags, bit depths, compression settings and the standards this format follows.
Directories file this under the NEF file type and list it as a Nikon Electronic Format RAW Image, which is the long way of saying Nikon Electronic Format (NEF). The NEF file extension your file manager shows has meant one thing since 1999: Nikon cameras wrote sensor data straight to the card.
| Item | Value |
|---|---|
| Extension | .nef, plus .nrw on some Coolpix bodies |
| Full name | Nikon Electronic Format |
| Kind | Camera raw image. Sensor data, never the finished picture |
| Developed by | Nikon |
| First written by | The Nikon D1, 1999 |
| Built on | TIFF, following TIFF/EP |
| Standard under it | ISO 12234-2:2001, Electronic still-picture imaging, Part 2 |
| Identifying tag | 37398, TIFF/EPStandardID |
| File signature | 49 49 2A 00 or 4D 4D 00 2A, with Nikon further in |
| Media type | image/x-nikon-nef. Never registered with IANA |
| Format registry | PRONOM record 927, six internal signatures |
| Bit depth | 12-bit or 14-bit per pixel, against 8 in JPEG |
| Compression tags | 32769 packed, 34713 Nikon Huffman with a quantization table |
| Raw settings | Uncompressed, lossless compressed, compressed, High Efficiency star, High Efficiency |
| Also inside | Exif tags, the Nikon MakerNote, a thumbnail and the full-size JPEG preview |
| Specification | Never published. Nikon licenses a kit to developers who ask |
| Nikon software | NX Studio, free, released 4 March 2021 |
Not an open format, and not in any sense of the phrase. Nikon has never published the specification, licenses a development kit only to developers who apply and encrypted part of the file in 2005.
The structure under it is TIFF, which is documented, so decoders have a map of the container and no key to Nikon's own block inside it.
The name, the bit depths and the instruction-set behavior come from Nikon's own page on the format. The TIFF/EP relationship and the identifying tag come from ISO 12234-2:2001 and the Library of Congress record for it. The signatures and the extensions come from PRONOM record 927.
The compression tag numbers come from libopenraw's format notes. The 2005 encryption, the quotation from Thomas Knoll and Nikon's answer come from reporting published that April. The measured file sizes come from a 45-megapixel Nikon body at 14 bits.
Install NX Studio. It is free and reads every body. See section 4.
Nothing is wrong. Section 6 explains why.
Comparing raw formats? The Digital Negative format holds the same sensor data in a published one. Canon raw answers the same questions on its own side, and CRW files show where Canon started.
Working with the developed picture instead? A Photoshop PSD file holds a layered edit, EPS files carry vector artwork and PDF files are what a finished page becomes.
Stuck on your computer rather than your NEF? Our Windows fixes and macOS guides cover the system side, including file associations.
New to all of this? What a file format is covers the ground under it, and our file format guides list the rest.
Found a NEF file that behaves in ways nothing here explains? Send us what ExifTool reports and we will tell you which camera wrote it.