File types · Explainer

The RAW file (.raw)

A RAW file is not one format: the .raw extension is used by older Panasonic and Leica cameras, by headerless image and audio data, and by raw disk images, which have nothing in common except the name. This guide explains how to tell which kind of .raw file you have, from its origin, its size and its first bytes, and how to open and convert each kind.

At a glance

Full name
None; "raw" just means unprocessed or without a header
Extensions
.raw; the same kinds of data also appear as .bin, .img, .pcm or .data
MIME type
None registered for .raw; usually application/octet-stream. Panasonic camera RAW is sometimes labelled image/x-panasonic-raw
Kind
Depends: TIFF-like camera raw, headerless pixel data, headerless PCM audio, or a byte-for-byte copy of a disk
Standard or owner
None: each use is separate
Magic number
Panasonic/Leica camera RAW: 49 49 55 00. Headerless image and audio data: none. Disk images: 55 AA at byte 510 if partitioned with MBR
Opens with
Camera RAW: Lightroom, Apple Photos, LibRaw-based tools. Image data: GIMP, ImageMagick, Photoshop. Audio: Audacity, FFmpeg. Disk images: QEMU, 7-Zip, Linux loop devices

The basics

What is a RAW file?

"Raw" means data without processing or without a wrapper, and several unrelated programs and devices chose .raw as the extension for their output. A file called something.raw is usually one of these:

  • A camera raw photo from an older Panasonic or Leica camera. A real file format with a header and metadata. Panasonic later moved to .rw2 (RW2). The Kyocera Contax N Digital also wrote .raw files.
  • Headerless image data: pixel values with no description of the image. Photoshop's Photoshop Raw format, scientific and industrial cameras, game terrain heightmaps and 3D scan volumes (often with a separate small header file, such as .mhd) all produce files like this.
  • Headerless audio: PCM samples with no WAV header, as written by audio tools, recorders and embedded devices.
  • A raw disk image: a byte-for-byte copy of a disk, USB stick or partition, made with dd or used directly by virtual machines such as QEMU.

RAW on a camera menu is something else

When a camera offers "RAW" as a picture quality, it means its own raw format: NEF for Nikon, CR3 for Canon, ARW for Sony, DNG for many others. Only a few older cameras used the actual .raw extension.

Anatomy

How to recognise each kind of .raw file

Since the kinds of .raw file have nothing in common, the useful thing to know is what each looks like at the start. Camera raw files and disk images have recognisable bytes; headerless image and audio data have none, so their size is the only clue. The signatures below come from libopenraw and ExifTool (camera raw) and from the standard MBR and GPT disk layouts, checked with the file command. Look at the first bytes with xxd photo.raw | head or any hex editor.

first bytes of each kind of .raw (outline)
what's at the start of the file          kind of .raw file

49 49 55 00 08 00 00 00 …                 Panasonic or Leica camera RAW:
                                          a TIFF-like header with 0x55, not 42
"ARECOYK" at byte 25                      Kyocera Contax N Digital camera RAW
                                          ("KYOCERA" backwards)
image values from byte 0                  headerless image data
  size = width × height × channels × bytes per value
  640 × 480 RGB, 8-bit = 921,600 bytes
audio samples from byte 0                 headerless PCM audio
  size = rate × channels × bytes per sample × seconds
  44,100 × 2 × 2 × 60 = 10,584,000 bytes for 1 minute
… 55 AA at bytes 510–511                  disk image with an MBR partition
  partition table at bytes 446–509          table (file: "DOS/MBR boot sector")
45 46 49 20 50 41 52 54 at byte 512       disk image with a GPT partition
  ("EFI PART")                              table
file system at byte 0                     image of one partition
  (ext4: 53 EF at byte 1080)                (file names the file system)
  1. 149 49 55 00

    Panasonic and Leica camera RAW

    II for little-endian, like a TIFF, but with 55 hex (85) where a TIFF has 42. libopenraw describes the full start as IIU followed by 08 00 00 00, the offset of the first directory. Panasonic's later RW2 format starts the same way, followed by a 16-byte signature. The file command (version 5.45) just says "data" for these.

  2. 2"ARECOYK" at byte 25

    Kyocera Contax N Digital

    The Contax N Digital camera also wrote .raw files. ExifTool recognises them by the maker name stored backwards, 25 bytes in.

  3. 3image values from byte 0

    Headerless image data

    No signature, no size, no colour information: just pixel values, row after row. The file size must equal width × height × channels × bytes per value, plus any header the program added. That equation is the main clue to the dimensions.

  4. 4audio samples from byte 0

    Headerless PCM audio

    Sample values one after another, with channels interleaved. CD-quality stereo (44,100 samples a second, 2 channels, 2 bytes per sample) is 176,400 bytes a second, so a file of a whole number of seconds at that rate is a strong hint.

  5. 555 AA at bytes 510–511

    Disk image with an MBR

    The first 512-byte sector of a partitioned disk ends in the boot signature 55 AA, with four 16-byte partition entries just before it. file disk.raw reports a DOS/MBR boot sector and lists the partitions.

  6. 6"EFI PART" at byte 512

    Disk image with GPT

    Newer disks use a GUID partition table, which starts in the second sector with the text EFI PART. The first sector still holds a protective MBR, which file shows as a partition of type 0xee.

  7. 7file system at byte 0

    Image of a single partition

    A copy of one partition rather than a whole disk starts directly with a file system. file usually names it, for example "Linux rev 1.0 ext4 filesystem data". The size of any disk image is a whole number of 512-byte sectors, and usually much larger than a photo or a sound.

Identify

How to tell what a .raw file is

  1. 1Where did it come from? From a camera's memory card: camera raw. From a disk imaging or forensic tool, or a virtual machine folder: a disk image. From an audio or measurement program, or a scientific instrument: headerless data. The program that wrote it usually knows the parameters.
  2. 2How big is it? Photos are megabytes; disk images are usually hundreds of megabytes to terabytes and a whole number of 512-byte sectors. For headerless data, factor the size: 921,600 bytes is 640 × 480 × 3 (an 8-bit RGB image) and 10,584,000 bytes is one minute of CD-quality stereo.
  3. 3What does file say? On Linux and macOS, file something.raw recognises disk images by their partition table or file system. It says "data" for headerless data and for Panasonic camera RAW, so a "data" answer means you look at the bytes next.
  4. 4What are the first bytes? xxd something.raw | head -4, or a hex editor. 49 49 55 00 is Panasonic or Leica camera RAW, and ARECOYK (KYOCERA backwards) at byte 25 is a Contax N Digital file. A camera make in plain text near the start also points to camera raw. Anything else with no recognisable header is headerless data.
  5. 5Try ExifTool: exiftool something.raw reads camera RAW files and names the camera; for headerless data it can only report the file size.

Camera RAW

Panasonic, Leica and Contax camera RAW files

Panasonic's early raw-capable Lumix cameras saved .raw files; later models use .rw2, and Leica's equivalents .rwl. ExifTool reads all three with the same Panasonic module. The RAW files are built like a TIFF: a header, a main directory of tags that describes the sensor data and its colour filter layout, and a link to Exif metadata. According to libopenraw, the oldest RAW files have no preview image, while some later RAW files and all RW2 files include a full JPEG with its own Exif data.

  • Open them in Adobe Camera Raw or Lightroom, in Apple Photos and Preview (Apple's supported list still includes Panasonic's oldest raw models), or in Windows Photos with the Raw Image Extension, which is built on LibRaw.
  • If an app ignores them, it may not treat .raw as a camera extension. Open the file from inside the app, or convert it with Adobe's free DNG Converter to DNG.
  • See the camera and settings: exiftool photo.raw.

Like any camera file, these contain Exif data: camera model, date and time and settings. Check before you publish originals.

Image data

Opening headerless image data

A headerless image file is only the pixel values, so you have to supply what a header would have said. Get it from the program or device that wrote the file, or work it out from the size:

You needTypical valuesIf it's wrong
Width and heightFrom the source; the size must divide exactlyDiagonal stripes or a sheared, repeating image
Channels and order1 (grey), 3 (RGB or BGR), 4 (RGBA)Wrong colours or a picture tripled side by side
Bits per value8, 16, sometimes 32-bit floatNoise, or an image twice as wide as expected
Byte order (16-bit and up)Little-endian on PCs; big-endian on some older systemsSpeckled, noisy image with the right shapes
Interleaved or planarRGBRGB… or all red, then all green, then all blueThree small grey copies of the picture
Header or offsetOften 0; some programs add oneImage shifted, with garbage at the top
terminal
# ImageMagick: 640 × 480, 8-bit RGB, interleaved
magick -size 640x480 -depth 8 rgb:photo.raw photo.png

# 16-bit greyscale, big-endian (a heightmap or a scientific image)
magick -size 1024x1024 -depth 16 -endian MSB gray:height.raw height.png

# ImageMagick 6 uses "convert" instead of "magick"
  • GIMP: File > Open, then choose Raw image data under Select File Type. GIMP asks for the offset, width, height and image type, and shows a preview as you change them.
  • Photoshop: opening a .raw file as Photoshop Raw asks for width, height, number of channels, interleaving, bit depth, byte order and header size; Photoshop can also save in this format.

Audio

Opening raw PCM audio

Raw audio is a stream of samples with no header, so a player has to be told the sample format, byte order, number of channels and sample rate. Get any of them wrong and you hear noise, or the right sound at the wrong speed or pitch.

  • Audacity: File > Import > Raw Data. Choose the encoding (such as signed 16-bit PCM or 32-bit float), byte order, channels, start offset and sample rate. The Detect button guesses, but its guess can be wrong. Audacity can't import raw data stored as text.
  • FFmpeg: state the format before the input, then save a normal file:
terminal
# signed 16-bit little-endian, 44.1 kHz, stereo → WAV
ffmpeg -f s16le -ar 44100 -ac 2 -i sound.raw sound.wav

# 32-bit float, 48 kHz, mono → FLAC
ffmpeg -f f32le -ar 48000 -ac 1 -i capture.raw capture.flac

If you don't know the parameters, start with signed 16-bit little-endian, the most common, and check the result: a sound at the right pitch and length means the rate and channels are right; loud noise usually means the wrong sample format or byte order. The length in seconds should come out as size ÷ (rate × channels × bytes per sample).

Disk images

Opening a raw disk image

A raw disk image is an exact copy of every sector of a disk or partition, with nothing added. That's why it's called raw, and why it's the simplest format for virtual machines and data recovery. QEMU's documentation calls it simple and easy to export to other emulators; on file systems that support sparse files, the parts of the image that were never written take no space.

terminal
# what's inside: partition table and partitions
file disk.raw
fdisk -l disk.raw

# Linux: attach read-only (it prints a device such as /dev/loop0),
# then mount a partition from it read-only
sudo losetup --find --show --partscan --read-only disk.raw
sudo mount -o ro /dev/loop0p1 /mnt

# make one from a USB stick (check the device name first!)
sudo dd if=/dev/sdX of=usb.raw bs=4M status=progress

# convert for a virtual machine, and check its real size
qemu-img convert -f raw -O qcow2 disk.raw disk.qcow2
qemu-img info disk.raw

7-Zip can open many disk images and list or extract the files in common file systems, without mounting anything. Virtual machine software such as QEMU can boot a raw image directly.

Mount untrusted images read-only, or not at all

A disk image can hold anything a disk can: programs, scripts and a crafted file system designed to trip up the code that mounts it. Mount images you didn't make read-only, preferably inside a virtual machine, and never write a .raw image back to a disk unless you're sure of the target device: dd overwrites without asking.

Comparison

The kinds of .raw file side by side

KindHeaderWhat you must know to open itOpen or convert with
Panasonic/Leica camera RAWYes, TIFF-like (IIU)Nothing: the file describes itselfLightroom, Apple Photos, Windows Photos; DNG Converter
Contax N Digital camera RAWYesNothingLibRaw-based tools
Headerless imageNo (or a fixed-size one)Width, height, channels, bit depth, byte order, layoutGIMP, ImageMagick, Photoshop → PNG or TIFF
Headerless audioNoSample format, byte order, channels, sample rateAudacity, FFmpeg, SoX → WAV or FLAC
Disk imageThe disk's own partition table or file systemNothing, if it's a whole diskQEMU, 7-Zip, Linux loop devices

Sample files

There are no sample RAW files on this page, because .raw covers several unrelated formats. To make headerless test data, run magick rose: -depth 8 rgb:test.raw (70 × 46 RGB) or ffmpeg -f lavfi -i sine -t 2 -f s16le test.raw (2 seconds of a 440 Hz tone: 16-bit, mono, 44.1 kHz).

Put it online

Have a RAW file? Give it a link.

Drop a .raw file on 99helpers and it gets its own web address. Browsers can't display any kind of .raw file, so the link downloads it; tell the recipient what it contains, and for headerless data, its width, height or sample rate.

Questions

RAW files, frequently asked

What is a .raw file?

It depends on where it came from. It can be a camera raw photo from an older Panasonic or Leica camera, headerless image or audio data, or a byte-for-byte disk image. They share only the extension.

How do I open a .raw file?

First work out which kind it is: check its origin, its size and its first bytes. Camera RAW opens in Lightroom or Apple Photos; image data in GIMP or ImageMagick; audio in Audacity; disk images with 7-Zip, QEMU or a Linux loop device.

Why does my .raw image look like diagonal stripes or noise?

The width, bit depth, channel count or byte order you entered doesn't match the data. Stripes usually mean a wrong width; noise usually means a wrong bit depth or byte order.

How do I convert a .raw file to JPG or PNG?

For camera RAW, export from Lightroom, Preview or darktable. For headerless image data, use magick -size WIDTHxHEIGHT -depth 8 rgb:file.raw out.png with the right size and format.

How do I play a raw audio file?

Import it in Audacity with File > Import > Raw Data, or convert it with ffmpeg -f s16le -ar 44100 -ac 2 -i file.raw file.wav, adjusting the format, rate and channels to match.

Is a .raw disk image the same as an .img or .iso?

A raw disk image and an .img file are often exactly the same thing with different names. An ISO is a CD or DVD file system image; it's also raw sector data, but with its own standard layout.

Is RAW the same as camera raw?

Not usually. Most cameras use their own extensions, such as NEF, CR3, ARW or DNG. Only some older Panasonic, Leica and Contax cameras used .raw itself.

Is a .raw file safe to open?

Image and audio data can't run anything. Disk images can contain programs and crafted file systems, so mount untrusted ones read-only, ideally in a virtual machine.

Related formats

Other file types explained

Keep going

Related

Sources

Last reviewed 27 October 2026.