API & MCP

Everything a person can do on File Format Doctor, a program or AI agent can do with the same inputs and get the identical result.

HTTP API

File Format Doctor

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.

Inputs of File Format Doctor
FieldTypeDefaultDescription
filefile—File. Analysed in memory and not stored. Max 10 MiB.
filenametext—File name (for hex input). Used to compare the extension with the detected format. Ignored when a file is uploaded.
hexBytestextarea—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.

Example request

iPhone photo renamed to .jpg (HEIC inside)

curl -X POST https://fileformatdoctor.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"filename":"IMG_0420.jpg","hexBytes":"00 00 00 18 66 74 79 70 68 65 69 63 00 00 00 00 6d 69 66 31 68 65 69 63"}'

Every result contains

inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.

MCP (Model Context Protocol)

{
  "mcpServers": {
    "file-format-doctor": { "type": "http", "url": "https://fileformatdoctor.usefulweb.site/mcp" }
  }
}