ETEvoraTools
File Utilities

MIME Type Detector

MIME Type Detector shows File.type and the text after the final dot in each selected filename. Browsers commonly derive File.type from operating-system mappings or the filename, and may return an empty value shown here as unknown. The page does not inspect magic bytes or parse file structure, so neither its MIME result nor the extension establishes what a hostile or malformed file really contains.

Runs locally — files stay on your device
Quick answer

Does this tool identify a file from its bytes?

No. It reports browser metadata plus the filename extension.

Declared type differs from content detection

A MIME type is a media-type label such as image/png. Reliable identification may require signature and structural inspection rather than trusting a name or supplied label.

How it works

Each File object's name and type are read. The extension is the substring after the last dot, or none when no dot exists.

Key concepts

File.type can be empty

The browser is not required to determine a media type.

Extensions are labels

Renaming bytes does not convert their format.

When to use it

  • Inspect what type a browser will report for an upload.
  • Spot missing or surprising extensions.
  • Compare filename labeling across selected files.

When not to use it

  • Do not use it as a security gate.
  • Do not use it to prove a codec or internal format.
  • Do not assume unknown means the bytes are invalid.

Worked examples

Common PNG

Input
photo.png
Expected output
image/png · extension png

This is typical, not byte validation.

No extension

Input
LICENSE
Expected output
possibly unknown · extension none

The file can still contain meaningful text.

Misnamed executable

Input
payload.jpg
Expected output
may appear image-labeled

Content inspection is absent.

Common mistakes

Calling it magic-byte detection

No bytes are examined. Correction: Use a trusted signature/parser tool.

Treating MIME as safe

Labels can be wrong or manipulated. Correction: Validate and scan untrusted uploads server-side.

Assuming extension conversion

Changing a suffix does not transcode data. Correction: Use a format converter.

Best practices

  • Treat both values as hints.
  • Validate file structure at the security boundary.
  • Use allowlists plus content scanning for uploads.

Related operations and differences

Add Prefix to Filenames

Choose Add Prefix to Filenames when you need to add a prefix to selected filenames.; use MIME Type Detector specifically for mime.

Add Suffix to Filenames

Choose Add Suffix to Filenames when you need to add a suffix before every extension.; use MIME Type Detector specifically for mime.

Compare Two Files

Choose Compare Two Files when you need to compare two files securely by SHA-256.; use MIME Type Detector specifically for mime.

File Checksum Comparator

Choose File Checksum Comparator when you need to compare a file digest with an expected checksum.; use MIME Type Detector specifically for mime.

File Hash Calculator

Choose File Hash Calculator when you need to calculate a local cryptographic file digest.; use MIME Type Detector specifically for mime.

File Size Calculator

Choose File Size Calculator when you need to inspect exact and human-readable file sizes.; use MIME Type Detector specifically for mime.

Limitations and privacy

  • No signature, container, codec, malware, or structural analysis.
  • Extension case is preserved and compound extensions are not recognized.
  • Results depend on browser and operating-system metadata.

Processing happens in this browser. Selected file contents are not uploaded by this tool.

Downloads and copied results remain on this device; handle them according to their sensitivity.

Frequently asked questions

Why does it say unknown?

The browser supplied an empty File.type.

Can a file lie about its type?

Its name or supplied type can disagree with its bytes.

Does it read file contents?

Not for this operation.

Is the extension authoritative?

No.

References