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.rawfiles. - 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
ddor used directly by virtual machines such as QEMU.
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.
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
49 49 55 00Panasonic and Leica camera RAW
IIfor little-endian, like a TIFF, but with55hex (85) where a TIFF has 42. libopenraw describes the full start asIIUfollowed by08 00 00 00, the offset of the first directory. Panasonic's later RW2 format starts the same way, followed by a 16-byte signature. Thefilecommand (version 5.45) just says "data" for these. - 2
"ARECOYK" at byte 25Kyocera Contax N Digital
The Contax N Digital camera also wrote
.rawfiles. ExifTool recognises them by the maker name stored backwards, 25 bytes in. - 3
image values from byte 0Headerless 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
audio samples from byte 0Headerless 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
55 AA at bytes 510–511Disk 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.rawreports a DOS/MBR boot sector and lists the partitions. - 6
"EFI PART" at byte 512Disk 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, whichfileshows as a partition of type0xee. - 7
file system at byte 0Image of a single partition
A copy of one partition rather than a whole disk starts directly with a file system.
fileusually 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
- 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.
- 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.
- 3What does
filesay? On Linux and macOS,file something.rawrecognises 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. - 4What are the first bytes?
xxd something.raw | head -4, or a hex editor.49 49 55 00is Panasonic or Leica camera RAW, andARECOYK(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. - 5Try ExifTool:
exiftool something.rawreads 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
.rawas 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 need | Typical values | If it's wrong |
|---|---|---|
| Width and height | From the source; the size must divide exactly | Diagonal stripes or a sheared, repeating image |
| Channels and order | 1 (grey), 3 (RGB or BGR), 4 (RGBA) | Wrong colours or a picture tripled side by side |
| Bits per value | 8, 16, sometimes 32-bit float | Noise, or an image twice as wide as expected |
| Byte order (16-bit and up) | Little-endian on PCs; big-endian on some older systems | Speckled, noisy image with the right shapes |
| Interleaved or planar | RGBRGB… or all red, then all green, then all blue | Three small grey copies of the picture |
| Header or offset | Often 0; some programs add one | Image shifted, with garbage at the top |
# 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
.rawfile 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:
# 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.flacIf 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.
# 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.raw7-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
| Kind | Header | What you must know to open it | Open or convert with |
|---|---|---|---|
| Panasonic/Leica camera RAW | Yes, TIFF-like (IIU) | Nothing: the file describes itself | Lightroom, Apple Photos, Windows Photos; DNG Converter |
| Contax N Digital camera RAW | Yes | Nothing | LibRaw-based tools |
| Headerless image | No (or a fixed-size one) | Width, height, channels, bit depth, byte order, layout | GIMP, ImageMagick, Photoshop → PNG or TIFF |
| Headerless audio | No | Sample format, byte order, channels, sample rate | Audacity, FFmpeg, SoX → WAV or FLAC |
| Disk image | The disk's own partition table or file system | Nothing, if it's a whole disk | QEMU, 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
- libopenraw: Panasonic RAW
- ExifTool: Panasonic RAW tags
- ImageMagick: supported image formats
- Audacity manual: File Menu: Import (Raw Data)
- FFmpeg formats documentation (raw PCM demuxers)
- QEMU block drivers: the raw image format
Last reviewed 27 October 2026.