Free webp to jpg
PNG

Portable Network Graphics (Legacy MIME)

image/x-png Released 1996 · by PNG Development Group

The image/x-png MIME type is a legacy, non-standard alias for the Portable Network Graphics (PNG) format. It was historically generated by early versions of Microsoft Internet Explorer (specifically IE 4, 5, and 6) during file uploads before the official 'image/png' MIME type was fully standardized and adopted. The underlying file format is identical to a standard PNG—a robust, lossless, chunk-based image format supporting 8-bit alpha transparency. While modern web servers and browsers strictly use 'image/png', developers handling legacy systems or processing user file uploads must frequently account for 'image/x-png' to prevent unexpected validation failures.

Web Graphics Transparency Progressive ✦ HDR Production Ready

Technical Specifications

MIME Type
image/x-png
Extensions
.png
Container
PNG Chunk Structure (IHDR, IDAT, IEND)
Compression
Deflate (Lossless)
Algorithms
Deflate (LZ77)
Color Depth
1-bit to 16-bit (Grayscale), 8-bit (Indexed Palette), 24-bit (True Color), 32-bit (True Color with Alpha), 48-bit (High Color), 64-bit (High Color with Alpha)
Metadata
EXIF XMP ICC
Capabilities
Transparency
Animation
Progressive Loading
Alpha Channel
HDR Support
Official Specification
Aliases: image/png

Magic Bytes & HTTP Headers

File Signature (Magic Bytes)
89 50 4E 47 0D 0A 1A 0A
ASCII: \x89PNG\r\n\x1A\n
HTTP Headers
Content-Type: image/png
Content-Type: image/x-png
HTML Accept Attribute
accept="image/png, image/x-png, .png"

Browser Support Matrix

Browser Status Min Version
Chrome Chrome
Supported 1
Firefox Firefox
Supported 1
Safari Safari
Supported 1
Edge Edge
Supported 12
Internet Explorer Internet Explorer
Supported Legacy

Advantages & Limitations

Advantages
  • The underlying format provides flawless, lossless compression and perfect 8-bit alpha channel transparency
  • Universally supported by every modern operating system, image editor, and web browser
Limitations
  • The 'image/x-png' string is an obsolete vendor quirk that forces backend developers to write redundant normalization logic in file upload scripts
  • If left unnormalized, strict MIME validators or content security policies on modern systems may incorrectly reject valid PNG files

Developer Code Snippets

import magic
# Modern Libmagic will output the standardized 'image/png' rather than the legacy 'x-png'
print(magic.from_file('graphic.png', mime=True)) # Outputs 'image/png'
const mime = require('mime');
// JS libraries resolve .png strictly to the IANA standard image/png
console.log(mime.getType('graphic.png')); // Outputs 'image/png'
import (
    "bytes"
    "net/http"
)
// Native Go HTTP detection reads the PNG magic bytes and returns the standard MIME
// mime := http.DetectContentType(buf) // Returns "image/png"
// Example of normalizing the legacy MIME type during a file upload in PHP
$mime = $_FILES['upload']['type'];
if ($mime === 'image/x-png') {
    $mime = 'image/png';
}
echo $mime;

File Detection Steps

How to programmatically detect a image/x-png file by reading its raw bytes:

  1. 1 Because the file is a standard PNG, check the first 8 bytes for the universal PNG signature (Hex: 89 50 4E 47 0D 0A 1A 0A).
  2. 2 When evaluating MIME types from HTTP multipart form uploads (e.g., $_FILES in PHP), map 'image/x-png' explicitly to 'image/png' before saving to the database.

Software Support

S
Standard Web Browsers
A
Adobe Photoshop
ImageMagick ImageMagick
GIMP GIMP

Conversion Tools

Convert PNG to →
Convert to PNG from ←

Share & Embed

Markdown Badge
PNG Format Badge
[![PNG Format](https://freewebptojpg.com/mime/image/png/badge.svg)](https://freewebptojpg.com/mime/image/png)
Interactive iframe Widget
<iframe src="https://freewebptojpg.com/mime/image/png/embed" width="100%" height="280" style="border:1px solid #cbd5e1;border-radius:8px;" title="PNG Specs"></iframe>

JSON API

All data on this page is available as a free, open JSON API. Use it in your project, documentation, or tooling.

GET https://freewebptojpg.com/mime/image/png.json Open JSON
Free to use
No auth required
CORS enabled
Use from any domain
Cached 24h
Cache-Control headers set

Frequently Asked Questions

What is the difference between image/png and image/x-png?

There is absolutely no difference in the actual image file. The 'image/png' string is the official IANA standard MIME type. The 'image/x-png' string was a temporary, experimental designation used primarily by old versions of Internet Explorer when uploading files to a server.

Why is my server receiving image/x-png files?

If a user is browsing your site with an extremely old browser (like Internet Explorer 6) or using a legacy enterprise application to submit HTTP POST requests, the client's internal registry may still map .png files to the image/x-png MIME type.

Should I allow image/x-png in my file upload validator?

Yes, but you should instantly normalize it. When your backend receives 'image/x-png', you should programmatically rewrite the MIME string in your database and storage logic to 'image/png' to maintain consistency and avoid future compatibility issues.

Related Formats

Share this format