filetype is a fast, dependency-free Go package for identifying binary file formats from their magic-number signatures. It examines file headers rather than relying on filename extensions, making detection useful for uploads and untrusted input. The API can match raw byte buffers and return a detected extension and MIME type. Developers can also check whether data belongs to supported categories such as images, audio, video, archives, or documents. Custom file-type matchers can be registered when an application needs formats outside the built-in set. The package is intentionally small and avoids external runtime dependencies. It is useful for validation, content routing, upload inspection, and lightweight file discovery in Go applications.

Features

  • Magic-number-based file detection
  • Extension and MIME type inference
  • Dependency-free Go implementation
  • Binary buffer inspection
  • Custom file-type matcher registration
  • Upload and content validation support

Project Samples

Project Activity

See All Activity >

Categories

File Managers

License

MIT License

Follow filetype

filetype Web Site

Other Useful Business Software
99.99% Uptime for MySQL and PostgreSQL Databases Icon
99.99% Uptime for MySQL and PostgreSQL Databases

Sub-second maintenance. 2x read/write performance. Built-in vector search for AI apps.

Cloud SQL Enterprise Plus delivers near-zero downtime with 35 days of point-in-time recovery. Supports MySQL, PostgreSQL, and SQL Server.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of filetype!

Additional Project Details

Programming Language

Go

Related Categories

Go File Managers

Registered

2026-08-11