File types · Explainer

The PSD file (.psd)

A PSD file is Adobe Photoshop's own format: a layered image that keeps every layer, mask and setting so the picture can be edited again later. This guide explains what's inside one, why other apps sometimes show it blank or flattened, and has free sample PSD files to download for testing.

At a glance

Full name
Adobe Photoshop Document
Extensions
.psd; .psb for the Large Document Format
MIME type
image/vnd.adobe.photoshop (registered with IANA); older software also uses application/x-photoshop or image/x-photoshop
Kind
Binary raster image with layers; lossless (raw, RLE or ZIP)
Owner
Adobe. The format is documented by Adobe but is not an open standard
First released
1990, with Photoshop 1.0 for the Mac; layers since Photoshop 3.0 (1994)
Limits
30,000 × 30,000 pixels and 2 GB per file (PSB: 300,000 pixels)
Colour modes
Bitmap, greyscale, indexed, RGB, CMYK, multichannel, duotone, Lab; 1, 8, 16 or 32 bits per channel
Byte order
Big-endian, on every platform
Magic number
38 42 50 53 00 01 (8BPS, then version 1)
Opens with
Photoshop, Photopea, GIMP, Krita, Affinity Photo; macOS Preview shows the flattened image

The basics

What is a PSD file?

PSD is the format Adobe Photoshop saves in by default. Where a PNG or JPG stores one finished picture, a PSD stores how the picture was made: separate layers of pixels, text and shapes, their order, blend modes and opacity, masks, adjustment layers, layer effects, guides, paths and saved selections. Open it again in Photoshop and everything is still editable.

Designers, photographers and illustrators use PSD as their working file: the master copy of a poster, a retouched photo, a website mock-up, an app icon or a piece of digital art. The finished result is usually exported to another format, such as JPG or PNG for the web or PDF or TIFF for print.

  • It's Adobe's format. Adobe publishes a specification, but it covers the data layout only, and many features (text, smart objects, effects) are only fully understood by Photoshop itself.
  • It's not for sharing finished images. Browsers can't display PSD files, and they're usually much larger than an exported image.
  • It's lossless. Pixel data is stored raw or with lossless compression (RLE or ZIP). Saving a PSD again never degrades it the way re-saving a JPG does.

Anatomy

What's inside a PSD file

A PSD file has five parts, always in the same order: a fixed 26-byte header, then four sections that each start with their length. Below is the structure of our sample-layers.psd: the header in hex, then each section as a reader walks through it. All numbers are big-endian.

sample-layers.psd (header in hex, then the structure)
38 42 50 53   00 01   00 00 00 00 00 00
00 03   00 00 01 90   00 00 02 80   00 08   00 03

00 00 00 00   colour mode data: 0 bytes

00 00 17 38   image resources: 5,944 bytes
  8BIM 1005   resolution info (16 bytes)
  8BIM 1036   JPEG thumbnail (2,858 bytes)
  8BIM 1057   version info (121 bytes)
  8BIM 1060   XMP metadata (2,900 bytes)

00 02 9D FC   layer and mask info: 171,516 bytes
  layer count 9, bottom to top:
  [0] Background        640×400 at 0,0     norm  255  flags 08
  [1] </Layer group>    0×0                norm  255  flags 1A
  [2] Sun glow          359×348 at 271,0   scrn  204  flags 08
  [3] Sun               105×105 at 398,118 norm  255  flags 08
  [4] Hills             640×192 at 0,208   norm  255  flags 08
  [5] Shadow            387×118 at 27,282  mul   153  flags 08
  [6] Scenery           0×0                pass  255  flags 18
  [7] Label (etiquette) 542×39 at 16,346   norm  255  flags 08
  [8] Hidden layer      357×32 at 44,49    norm  255  flags 0A
  channel image data for the 9 layers (RLE)

00 01   image data: the merged composite, RLE, 153,943 bytes
  1. 138 42 50 53 00 01

    Signature and version

    8BPS in ASCII, then version 1. A PSB (Large Document Format) file has the same signature with version 2. The spec tells readers to stop if the signature doesn't match.

  2. 200 00 00 00 00 00

    Reserved

    Six bytes that must be zero.

  3. 300 03 00 00 01 90 00 00 02 80

    Channels, height, width

    3 channels (red, green, blue), then the height (190 hex = 400) and the width (280 hex = 640). Note that height comes first. A PSD can have up to 56 channels, including extra alpha channels saved as selections.

  4. 400 08 00 03

    Bit depth and colour mode

    8 bits per channel, colour mode 3 (RGB). Other modes: 0 bitmap, 1 greyscale, 2 indexed, 4 CMYK, 7 multichannel, 8 duotone, 9 Lab.

  5. 5colour mode data: 0 bytes

    Colour mode data

    Only indexed and duotone images use it, for the palette or the duotone settings. For RGB it's just a zero length.

  6. 68BIM 1005 … 8BIM 1060

    Image resources

    Numbered blocks, each starting with 8BIM: print resolution (1005), a small JPEG thumbnail (1036), version info that records whether a composite image is included (1057) and XMP metadata (1060). Photoshop writes dozens more: guides, slices, paths, colour settings, the ICC profile.

  7. 7layer and mask info

    The layers

    One record per layer, from the bottom of the stack to the top: position and size, the channels, a blend-mode key such as norm, mul (multiply) or scrn (screen), opacity from 0 to 255, flags and a name. Then the pixel data of every layer, channel by channel.

  8. 8[1] </Layer group> … [6] Scenery

    A layer group

    Groups aren't nested in the file. They're two extra records, marked with an lsct block: a hidden end marker below the group's layers and the group itself, with blend mode pass (pass through), above them.

  9. 9flags 0A

    A hidden layer

    Bit 1 of the flags byte marks a layer as not visible. Its pixels are still in the file, and anyone who opens it in an editor can switch it back on.

  10. 10Label (etiquette)

    Layer names

    The record holds a short single-byte name. The real Unicode name, here Label (étiquette ✓), sits in a separate luni block that modern readers prefer.

  11. 11image data: the merged composite

    The composite image

    The whole picture flattened into one image, compressed with RLE. It's what most other apps, previews and thumbnails show. Without it, a reader has to rebuild the picture from the layers, which few can do faithfully.

Under the hood

How a PSD stores layers and pixels

The five parts of every PSD file
PartWhat it holds
File header (26 bytes)Signature, version, number of channels, height, width, bit depth, colour mode.
Colour mode dataThe palette of an indexed image or duotone settings; empty otherwise.
Image resourcesNumbered 8BIM blocks of document-wide settings: resolution, ICC profile, thumbnail, XMP and Exif metadata, guides, paths, slices.
Layer and mask informationEvery layer's record and pixels, the layer masks, and tagged blocks for text, effects, adjustment layers, smart objects and more.
Image dataThe merged composite: the whole document flattened into one image.

A layer only stores the rectangle it covers, not the whole canvas: the Sun layer in our sample is 105 × 105 pixels at position 398, 118. A layer usually has a transparency channel (ID -1) plus one channel per colour, and each channel is compressed on its own. Data is stored planar: all of the red values, then all of the green, then all of the blue, rather than red-green-blue pixel by pixel.

Compression methods for pixel data
CodeMethodNotes
0RawUncompressed.
1RLE (PackBits)Runs of identical bytes are stored once. Good for flat colour, poor for gradients and photos. A table of compressed row lengths comes first.
2ZIPDeflate, as in ZIP and PNG.
3ZIP with predictionEach value is stored as the difference from its left neighbour before Deflate, which suits smooth 16- and 32-bit data. Our sample-16bit.psd uses it for its layers.

Why big-endian?

Photoshop started on the Mac, whose Motorola 68000 processors stored numbers most significant byte first. The format kept that byte order on Windows too, so a PSD is byte-for-byte the same on every platform.

The composite

The composite image and Maximize Compatibility

Rebuilding a picture from its layers means reproducing every blend mode, adjustment layer, effect and text layer exactly as Photoshop draws them. Most programs can't, so they read the composite instead: the flattened image stored at the end of the file. Thumbnails, file previews, Lightroom, InDesign and many converters depend on it.

Whether a layered PSD includes that composite is controlled by Photoshop's Maximize PSD and PSB File Compatibility setting (Preferences, File Handling). With it on, the file is bigger but every reader sees the right picture. With it off, the file is smaller, Photoshop still opens it normally, but other apps may show it blank, flattened wrongly or refuse to import it.

Why does my PSD look different (or blank) outside Photoshop?

Either the file was saved without Maximize Compatibility, so there's no composite to show, or the app is rendering the layers itself and doesn't support some of them: text layers, smart objects, adjustment layers and layer styles are the usual losses. Open it in Photoshop, turn the setting on (or choose Always), and save it again.

Variants

PSD vs PSB, colour modes and bit depths

PSB, the Large Document Format, arrived with Photoshop CS in 2003 for images that outgrow PSD. The structure is the same; the header says version 2, and the length fields that could overflow (layer section lengths, channel lengths, RLE row lengths) are twice as wide.

PSDPSB
Extension.psd.psb
Header version12
Maximum size30,000 × 30,000 pixels300,000 × 300,000 pixels
Maximum file size2 GBUp to 4 exabytes
Support outside AdobeWideMuch narrower; many tools that read PSD can't open PSB

Within either format, the colour mode and bit depth matter just as much for compatibility:

  • RGB, 8 bits per channel is what almost everything reads.
  • CMYK is common for print work. PSD stores CMYK values inverted (255 means no ink), and a file without an embedded colour profile is converted to screen colours with whatever profile the viewer assumes, so colours vary from app to app. sample-cmyk.psd has no profile, on purpose.
  • 16 and 32 bits per channel are used for photo retouching and HDR work. Photoshop stores the layers of such files in a separate Lr16 or Lr32 block, which simpler readers skip. Pillow, the Python imaging library, can't open sample-16bit.psd at all.

Comparison

PSD vs TIFF, PNG and GIMP's XCF

PSDTIFFPNGXCF (GIMP)
LayersYes, fully editable in PhotoshopYes, if saved from Photoshop with layersNoYes
Made forWorking filesPrint and archivingFinished images, the webGIMP working files
Opens in a browserNoSafari onlyYesNo
CompressionLossless (RLE, ZIP)None, LZW, ZIP or JPEGLosslessLossless (RLE or zlib)
CMYKYesYesNoNo
  • To keep editing: PSD (or the editor's own format).
  • To publish on a website or share: export a PNG, JPG or WebP.
  • To send to a printer: a flattened TIFF or a print-ready PDF, unless the printer asks for the PSD.
  • To hand over to a developer: export the assets they need, or share the PSD and say which layers matter.

Troubleshooting

Why is my PSD so big, blank or missing layers?

  • It's huge. A PSD keeps every layer at full resolution, plus the composite, a thumbnail and metadata. Large layers that extend past the canvas, hidden layers you no longer need, embedded smart objects and 16-bit mode all add up. Delete unused layers, rasterise or unlink smart objects you won't edit, and use File, Save As rather than Save, which writes a clean copy.
  • It shows blank or white in another app. The composite is missing: see Maximize Compatibility above.
  • Text looks different or is pixelated. The other app either lacks the font or draws the text from the stored pixel version. Text layers stay editable only where the same font is installed.
  • Layers are merged or missing. The app reads only the composite (macOS Preview and Quick Look, most web upload previews) or only simple pixel layers (GIMP and others turn unsupported layer types into pixels or drop them).
  • It won't open: "not a valid Photoshop document". The file may be a PSB renamed to .psd, be damaged (often a cut-off download), or not be a Photoshop file at all. Check the first bytes: 38 42 50 53 00 01 is a PSD, 00 02 after 8BPS is a PSB.
  • Colours shift after converting. A CMYK or 16-bit file was converted without its colour profile, or into a narrower colour space. Convert to RGB and 8 bits in Photoshop before exporting for the web.

How to

How to open, edit and convert a PSD file

  • Photoshop (Windows, macOS, and Photoshop on the web and iPad) reads and writes everything.
  • Without Photoshop: Photopea runs in the browser and handles layers, text and many effects; GIMP and Krita (free, Windows, macOS, Linux) and Affinity Photo open layered PSDs, with some layer types converted or lost.
  • Just to look at it: macOS Preview and Quick Look show the composite image.
  • On a phone: most phones can't preview a PSD; Photoshop's mobile apps or Photopea in the browser can.
  • Convert to PNG or JPG: in Photoshop, File, Export, Export As. On the command line, magick 'design.psd[0]' design.png converts the composite with ImageMagick; leave out [0] and you get one file per layer as well.
  • In code: psd-tools (Python) reads layers and can render them; ag-psd and psd.js do the same in JavaScript.

Security

Privacy and security: what a PSD can give away

A PSD holds far more than the picture you see, and the extra is easy to forget when you send the file to someone:

  • Hidden layers. Switching a layer off only hides it. Earlier drafts, rejected versions and notes stay in the file.
  • Pixels outside the canvas. Layers can extend past the edges, and cropping with Delete Cropped Pixels turned off keeps the cropped areas in the file.
  • Metadata. XMP and Exif blocks can hold author names, edit history, software, dates and the GPS location of a placed photo.
  • Embedded files. Smart objects carry a full copy of the placed image or document, at its original resolution.

A PSD can't run code. The risk on the reading side is software bugs: image decoders and Photoshop itself have had memory-safety flaws that a crafted file could trigger, and Adobe regularly ships security updates for Photoshop. Keep editors and libraries up to date, and treat PSD uploads on a server like any other untrusted input: check the declared dimensions before decoding.

To send a design without its working layers, export a PNG, JPG or PDF instead, or flatten a copy and save it under a new name. Our sample-layers.psd has a hidden layer so you can check whether your tools reveal it.

Free downloads

Sample PSD files to download

Free sample PSD files for testing viewers, converters, upload pipelines and layer parsers. Each one was generated from code following Adobe's specification and reads back correctly with psd-tools and ImageMagick.

sample-layers.psd · 323.7 KBDownload

Browsers can't show this kind of file in a page. Download it to open it in the app it belongs to.

What's inside sample-layers.psd

Browsers can't display PSD files, so there's no live preview here. Open sample-layers.psd in an editor and look at the Layers panel, or read it with psd-tools, and you'll find these parts.

  1. Seven pixel layers and a group

    Background, Sun glow, Sun, Hills, Shadow, Label and a hidden layer, with Sun glow, Sun, Hills and Shadow inside a group called Scenery.

  2. Three blend modes

    Normal for most layers, Screen at 80% opacity for the glow and Multiply at 60% for the shadow. A reader that ignores blend modes draws the glow and shadow as flat colour.

  3. Layers smaller than the canvas

    Only the background covers all 640 × 400 pixels; the others store just their own rectangle, at an offset.

  4. A hidden layer

    Red "HIDDEN LAYER" text with its visibility switched off. It isn't part of the composite, but its pixels are in the file.

  5. A Unicode layer name

    The label layer is called Label (étiquette ✓), stored in a luni block, with a plain ASCII fallback for older readers.

  6. A composite and a thumbnail

    The flattened image (saved as if Maximize Compatibility were on) and a 160 × 100 JPEG thumbnail in image resource 1036.

  7. XMP metadata

    A title, a description pointing back to this page and a rights statement, in image resource 1060.

All sample PSD files

  • Layered PSD with a group

    sample-layers.psd · 323.7 KB (331,441 bytes)

    640 × 400 RGB, 8 bits per channel: seven pixel layers, a group, Normal, Screen and Multiply blend modes, a hidden layer, a Unicode layer name, a composite, a thumbnail and XMP metadata.

    • Testing layer parsers and PSD previews
    • Checking which apps honour blend modes and hidden layers
  • Flat PSD, no layers

    sample-flat.psd · 111.0 KB (113,653 bytes)

    A 256 × 256 RGB gradient with only the composite image and an empty layer section, as older or simpler programs write PSD.

    • Parser tests: don't assume a layer section
    • Basic PSD-to-PNG conversion
  • CMYK PSD

    sample-cmyk.psd · 84.5 KB (86,553 bytes)

    600 × 400 at 300 ppi in CMYK: pure cyan, magenta, yellow and black patches, their mixes, rich black and 50% tints, on two layers, with no embedded colour profile.

    • Checking CMYK-to-RGB conversion in upload and thumbnail pipelines
    • Print workflow tests
  • 16-bit PSD

    sample-16bit.psd · 265.8 KB (272,208 bytes)

    256 × 160 RGB at 16 bits per channel, with two layers in an Lr16 block compressed with ZIP-with-prediction and an uncompressed composite. psd-tools and ImageMagick read it; Pillow 12 can't open it.

    • Testing high-bit-depth support
    • Finding readers that skip `Lr16` layers
  • 1 MB PSD file

    sample-1mb.psd · 1 MB (1,048,576 bytes)

    The layered sample at 1280 × 800, padded inside its XMP packet to exactly 1,048,576 bytes (1 MiB).

    • Upload limits at exactly 1 MiB
    • Timeouts and progress bars

Ways to test with them

  • Upload limits: sample-1mb.psd is exactly 1,048,576 bytes, so you can test a 1 MiB limit at the boundary.
  • Previews and thumbnails: a pipeline that shows sample-layers.psd with red "HIDDEN LAYER" text is rendering layers itself and ignoring visibility. The correct picture is the composite.
  • Layer parsing: sample-layers.psd should come back as 7 pixel layers and one group (Scenery, holding four of them), with opacities 255, 204 and 153 and blend modes norm, scrn and mul .
  • Colour handling: convert sample-cmyk.psd to PNG. The cyan patch should come out cyan, not red: red means the inverted CMYK values were read the wrong way round.
  • Bit depth: sample-16bit.psd should load as 16 bits per channel, with two layers.

Free to use for testing, teaching and demos, commercially or not, with no attribution needed. A link back to this page is always appreciated.

Put it online

Have a PSD file? Give it a link.

Drop a PSD on 99helpers and it gets its own link. Browsers can't display PSD files, so visitors download it and open it in Photoshop, Photopea or another editor; to have the design seen in the browser, upload a PNG or JPG export next to it.

Questions

PSD files, frequently asked

What is a PSD file?

Adobe Photoshop's own image format. It keeps layers, masks, text, effects and other editing information, so the image can be changed later, plus a flattened copy that other apps can display.

How do I open a PSD file without Photoshop?

Use Photopea in a browser, or GIMP, Krita or Affinity Photo on a computer. They open most layered PSDs, though some layer types are converted or lost. To just view it, macOS Preview shows the flattened image.

Can a browser show a PSD file?

No. Browsers don't display PSD, so a link to one downloads the file. Export a PNG or JPG to show the design on a web page.

What's the difference between PSD and PSB?

PSB is Photoshop's Large Document Format: the same structure with wider length fields, for images over 30,000 pixels on a side or files over 2 GB. Fewer apps outside Adobe can open PSB.

How do I convert a PSD to PNG or JPG?

In Photoshop, use File, Export, Export As. Photopea and GIMP can export too, and magick 'file.psd[0]' file.png converts the flattened image with ImageMagick.

Why is my PSD file so large?

It stores every layer at full resolution, plus a flattened copy, and often embedded smart objects and metadata. Removing unused layers and smart objects, and saving a fresh copy with Save As, usually makes it much smaller.

What does Maximize Compatibility do?

It saves a flattened composite image inside layered PSD and PSB files. Other apps, thumbnails and Lightroom rely on it. Without it the file is smaller but may show as blank outside Photoshop.

Is it safe to open a PSD file?

A PSD can't run code, but image decoders have had bugs that crafted files can exploit, so keep your software updated. When you send a PSD, remember it can contain hidden layers, cropped-out areas and metadata.

Related formats

Other file types explained

Keep going

Related

Sources

Last reviewed 27 October 2026.