{"uid":"cap_b2OsqGgrVm6ZfvgMkM6_u","slug":"file-format-inspector-magic-bytes-identifier-e7bdf17d","name":"File Format Inspector – Magic Bytes Identifier","description":"Identify a file type from the first bytes (hex): PNG, JPEG, PDF, ZIP, ELF, EXE, MP4, SQLite and 40+ more signatures.","url":"https://file-formats.x402tookit.com/magic-bytes?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["hex"],"properties":{"hex":{"type":"string","description":"First bytes of the file as hex, up to 512 bytes (1024 hex digits); spaces, colons and hyphens allowed"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"asOf":{"type":["null","string"]},"mime":{"type":["null","string"]},"type":{"type":["null","string"]},"source":{"type":["null","string"]},"matches":{"type":["array","null"],"items":{"type":"object","properties":{"mime":{"type":["null","string"]},"type":{"type":["null","string"]},"category":{"type":["null","string"]}}}},"reasons":{"type":["array","null"]},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"category":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"disclaimer":{"type":["null","string"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"bytesExamined":{"type":["null","number"]},"firstBytesHex":{"type":["null","string"]},"usualExtensions":{"type":["array","null"],"items":{"type":"string"}}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Dvn027S13SehWQgNqVaUK","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Identifies a file's type from its first bytes (magic bytes) by matching against 40+ signatures including PNG, JPEG, PDF, ZIP, ELF, EXE, MP4, and SQLite.","exampleAgentPrompt":"I have these hex bytes from the start of a file — '89504e470d0a1a0a' — can you identify what file format this is, including the MIME type and typical extensions?","exampleUseCases":[{"title":"Security scan for disguised executables","prompt":"I've got a suspicious file upload and I want to check its actual type from these first bytes: '4d5a9000030000000400000000ffff0000' — is this an executable or something else? Give me the MIME type and any security flags."},{"title":"Pipeline validation for uploaded media","prompt":"Before processing this user-uploaded file, check what it really is from its header bytes '667479706d703432' — I need to know the MIME type and file category to route it correctly."},{"title":"Forensic file type recovery","prompt":"I'm trying to recover files with missing extensions and I need to identify this one from its magic bytes: '255044462d312e34' — what file format is it, what MIME type should I assign, and what extension should it have?"}],"resultDescription":"Returns the detected MIME type, human-readable file type name, file category, a list of all matching signatures with their MIME types and categories, usual file extensions, a plain-language verdict and summary, the number of bytes examined, and flags for degraded confidence or unchecked signatures.","failureModes":["Too few bytes provided — fewer than the minimum required for any signature match returns null fields or low-confidence result","Unrecognized format — no matching signature returns null MIME and type with an empty matches array","Malformed hex input — non-hex characters beyond allowed separators (spaces, colons, hyphens) may cause an error","Ambiguous header — some formats share early bytes, resulting in multiple matches with no single verdict","Service unavailable or payment failure — returns HTTP error with no file type data"],"whenToPreferThis":"Use this endpoint when you need to programmatically determine a file's true format from its raw bytes rather than relying on file extensions or metadata. Ideal for security pipelines (detecting disguised executables), upload validation, forensic file recovery, and content routing. Prefer this over extension-checking when the file extension may be missing, incorrect, or untrusted. The sibling endpoints on this host offer deeper parsing for specific formats (PNG dimensions, JPEG markers, etc.) — use this one first for broad identification across 40+ types.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-29T13:14:28.250Z","isFirstParty":false,"canonicalSlug":"file-format-inspector-magic-bytes-identifier-e7bdf17d"}