# mimetype

> Detect MIME types and file extensions in Go from magic numbers

Source: https://talira.ai/catalog/mimetype-dfp1ggwg
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / file type detection](https://talira.ai/categories/libraries/file-type-detection), [languages / go](https://talira.ai/categories/languages/go)
- Licence: MIT[^1]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Gabriel Vasile](https://talira.ai/orgs/gabriel-vasile.md)

mimetype is a Go package that detects a file's MIME type and extension from its magic numbers, from a byte slice, a reader or a file path. It supports a long list of formats, prioritises common ones, tells text from binary files and can be extended with new formats. It has no external dependencies or C bindings and is safe for concurrent use. It's by Gabriel Vasile.

## Links

- GitHub: https://github.com/gabriel-vasile/mimetype
- Docs: https://pkg.go.dev/github.com/gabriel-vasile/mimetype

## Problems it solves

- detect the real file type of an upload in Go
- check an uploaded file's MIME type without trusting its extension
- tell text files from binary files in Go

## Features

- MIME type and extension detection by magic numbers
- detect from bytes, readers or files
- text vs binary detection
- extensible with new formats
- no dependencies, no cgo, goroutine safe

## Trust

Overall: 0.55 out of 1.
Signals: maintenance 0.73, adoption 0.66, momentum 0.40, community 0.76, backing 0.30, extensibility 0.00.

- last commit 2 days ago
- 19 commits in the last 90 days
- latest release v1.4.16 44 days ago
- 2.0k GitHub stars
- 79 contributors
- backed by Gabriel Vasile

## Sources

[^1]: https://github.com/gabriel-vasile/mimetype/blob/master/LICENSE (checked 29 Nov 2026)
