# File Format Doctor > Find out what a file really is from its bytes, why it will not open and how to convert it. Upload a file (or paste its first bytes as hex) and the doctor reads its magic number against a table of 74 formats, looks inside ZIP containers (DOCX, XLSX, ODT, EPUB, JAR, APK), and diagnoses wrong extensions, truncated or encrypted files, text encoding problems and disguised executables — with offline conversion commands. Part of usefulweb.site (https://usefulweb.site/). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://fileformatdoctor.usefulweb.site/ (interactive tool at https://fileformatdoctor.usefulweb.site/tool) - JSON API: POST https://fileformatdoctor.usefulweb.site/api/v1/calculate with a JSON object of inputs (schema: https://fileformatdoctor.usefulweb.site/api/v1/tool) - OpenAPI: https://fileformatdoctor.usefulweb.site/openapi.json - MCP (Streamable HTTP): https://fileformatdoctor.usefulweb.site/mcp - tool `file_format_doctor` ## Inputs - file (file): File - Analysed in memory and not stored. Max 10 MiB. - filename (text): File name (for hex input) - Used to compare the extension with the detected format. Ignored when a file is uploaded. - hexBytes (textarea): Or: first bytes as hex - E.g. from `xxd -l 512 file` or `Format-Hex`. At least 16 bytes recommended; 512+ for ZIP-based formats. ## Method - Magic numbers are matched at their documented offsets for 74 formats (e.g. "%PDF-" at 0, "ustar" at 257, "CD001" at 0x8001, "ftyp" brands at 4). - ISO-BMFF files are told apart by their ftyp brands (heic/heix → HEIC, mif1 → HEIF, avif → AVIF, qt → QuickTime, M4A → audio, isom/mp42 → MP4). - ZIP files are opened by reading the central directory (or local file headers in a sample): [Content_Types].xml + word/ → DOCX, xl/ → XLSX, ppt/ → PPTX, the stored "mimetype" entry → ODT/ODS/ODP/EPUB, AndroidManifest.xml → APK, META-INF/MANIFEST.MF → JAR. General-purpose bit 0 marks encrypted entries. - Without a binary signature the bytes are checked for BOMs, UTF-16 patterns, strict UTF-8 validity and typical mojibake sequences (e.g. "é", "’"), then for SVG/HTML/XML/JSON/CSV structure. - Truncation checks (uploads only): PDF must end with %%EOF, PNG with IEND, JPEG with FF D9, GIF with 3B, ZIP must have an end-of-central-directory record, RIFF/BMP declared sizes must fit. - Conversion suggestions use free, offline tools (LibreOffice, ImageMagick, FFmpeg, 7-Zip, iconv) with the exact command for your file name. ## Limits - Detection reads bytes only; it does not scan for malware. Never run an executable you did not expect to receive.