{"id":"image-x-win-cursor","mimeType":"image/x-win-cursor","name":"Windows Cursor","shortName":"CUR","category":"Icons \u0026 Cursors","extensions":[".cur"],"description":"The Windows Cursor (CUR) file format is a proprietary image format developed by Microsoft for mouse pointers. It is structurally identical to the Windows Icon (ICO) format, with two key exceptions: an identification byte in the header marking it as a cursor rather than an icon, and the inclusion of a 'hotspot'—a specific X and Y coordinate within the image grid that defines the exact point where user clicks are registered.","seo":{"title":"image/x-win-cursor MIME Type: CUR Specs \u0026 Magic Bytes","description":"Complete developer reference for image/x-win-cursor (.cur): magic bytes, HTTP headers, browser support, developer code snippets, and technical specifications.","faqs":[{"question":"What is the magic byte for image/x-win-cursor?","answer":"A CUR file always begins with the 4-byte sequence 00 00 02 00 in hexadecimal. The '02' differentiates it from an ICO file, which uses '01'."},{"question":"Is image/x-win-cursor supported in web browsers?","answer":"Yes. Most modern web browsers support .cur files specifically for use within the CSS 'cursor' property (e.g., cursor: url('custom.cur'), auto;)."},{"question":"What is a cursor 'hotspot'?","answer":"Unlike a standard image, a cursor must define exactly which pixel triggers a click event. A CUR file stores this precise X and Y coordinate (the hotspot) in its image directory header."}]},"index":{"compression":["Uncompressed (BMP)","PNG (Supported in newer versions)"],"browserSupport":{"score":4,"label":"Good (via CSS)"},"commonUses":["Operating System Custom Cursors","Custom Web Browser Mouse Pointers (via CSS)","Desktop Application UI"]},"technical":{"magicBytes":{"hex":"00 00 02 00","ascii":"\\x00\\x00\\x02\\x00"},"container":"ICO/CUR Container File","compressionAlgorithm":["None (DIB / BMP)","Deflate (If PNG embedded)"],"colorDepth":["1-bit (Monochrome)","4-bit (16 colors)","8-bit (256 colors)","24-bit (True Color)","32-bit (True Color with Alpha)"],"transparency":true,"animation":false,"metadata":{"exif":false,"xmp":false,"iccProfile":false},"alphaChannel":true,"progressiveLoading":false,"hdrSupport":false},"history":{"developer":"Microsoft Corporation","released":"1985","specification":"Microsoft Windows API documentation"},"browserSupport":{"chrome":true,"chromeVersion":"1","firefox":true,"firefoxVersion":"1","safari":true,"safariVersion":"1.2","edge":true,"edgeVersion":"12","internetExplorer":true},"softwareSupport":[{"name":"Microangelo","logo":""},{"name":"RealWorld Cursor Editor","logo":""},{"name":"ImageMagick","logo":""},{"name":"GIMP","logo":""}],"conversion":{"convertTo":["png","ico","svg"],"convertFrom":["png","ico"]},"developer":{"httpHeaders":[{"header":"Content-Type","value":"image/x-win-cursor"},{"header":"Content-Type","value":"image/cursor"}],"htmlAccept":"image/x-win-cursor, .cur","fileDetection":["Check the first 4 bytes for the exact hex signature 00 00 02 00.","Parse the image directory at offset 4 to extract the hotspot coordinates at bytes 4 and 6 of the directory entry."]},"prosCons":{"pros":["Natively supported by Windows for desktop cursor customization","Widely supported by modern web browsers for custom CSS cursors","Supports an exact hotspot coordinate, which standard image formats like PNG and JPEG lack"],"cons":["Legacy format that is being gradually replaced by SVG and PNG for web implementations","Does not support animation (animated cursors use the distinct .ani format)","The MIME type is highly fragmented across systems (e.g., image/cursor, image/x-win-cursor, application/x-cursor)"]},"specifications":{"url":"https://learn.microsoft.com/en-us/windows/win32/menurc/about-cursors","rfc":"","mimeAliases":["image/cursor","application/x-cursor","image/vnd.microsoft.icon"]},"developerSnippets":{"python":"import magic\nprint(magic.from_file('pointer.cur', mime=True)) # Outputs 'image/x-win-cursor'","nodejs":"const fs = require('fs');\nconst buffer = Buffer.alloc(4);\nconst fd = fs.openSync('pointer.cur', 'r');\nfs.readSync(fd, buffer, 0, 4, 0);\nfs.closeSync(fd);\nconst isCUR = buffer.toString('hex') === '00000200';\nconsole.log('Is CUR File:', isCUR);","go":"import \"net/http\"\n\nmimeType := http.DetectContentType(fileBytes)\n// Note: Go's standard library may detect this as application/octet-stream\nfmt.Println(mimeType)","php":"$mime = mime_content_type('pointer.cur');\necho $mime; // Typically resolves to image/x-win-cursor or application/octet-stream"},"relatedFormats":["ico","apple-icns","ani-st","bmp","png"]}
