v0.2.1 Now Available
Content Types Lite
A lightweight, zero-dependency utility for MIME type lookups. Get file extensions from MIME types and vice versa with ease.
Zero Dependencies
TypeScript Ready
50+ MIME Types
Everything you need for MIME type handling
Simple, fast, and reliable MIME type lookups for your projects
Lightning Fast
Zero dependencies and optimized for performance with instant lookups.
Lightweight
Tiny bundle size that won't bloat your application.
Comprehensive
Support for 50+ common MIME types across all categories.
Type Safe
Full TypeScript support with proper type definitions.
Bidirectional
Lookup MIME types from extensions and vice versa.
Easy to Use
Simple, intuitive API that just works.
Interactive Demo
Try it yourself
Lookup MIME types and extensions in real-time
MIME Type Lookup
Enter a file extension (e.g., .pdf) or MIME type (e.g., application/pdf) to lookup
Try:
Documentation
Get started in minutes with our simple API
Installation
bash
npm install content-types-lite
# or
pnpm add content-types-lite
# or
yarn add content-types-liteGet MIME Type from Extension
typescript
import { getMimeType } from 'content-types-lite';
const mimeType = getMimeType('.pdf');
console.log(mimeType); // 'application/pdf'
const pngType = getMimeType('image.png');
console.log(pngType); // 'image/png'Get Extension from MIME Type
typescript
import { getExtension } from 'content-types-lite';
const ext = getExtension('application/json');
console.log(ext); // '.json'
const htmlExt = getExtension('text/html');
console.log(htmlExt); // '.html'Get All Extensions
typescript
import { getTypeExtensions } from 'content-types-lite';
const extensions = getTypeExtensions('image/jpeg');
console.log(extensions); // ['.jpg', '.jpeg']
const pngExts = getTypeExtensions('image/png');
console.log(pngExts); // ['.png']Browse MIME Types
Explore all supported MIME types and their extensions
Category:
image/jpeg
JPEG image format
.jpg.jpeg
image/png
Portable Network Graphics
.png
image/gif
Graphics Interchange Format
.gif
image/webp
WebP image format
.webp
image/svg+xml
Scalable Vector Graphics
.svg
image/bmp
Bitmap image format
.bmp
image/tiff
Tagged Image File Format
.tif.tiff
image/x-icon
Icon image format
.ico
audio/mpeg
MP3 audio format
.mp3
audio/wav
Waveform Audio File Format
.wav
audio/ogg
Ogg Vorbis audio
.ogg
audio/webm
WebM audio format
.weba
audio/aac
Advanced Audio Coding
.aac
audio/flac
Free Lossless Audio Codec
.flac
audio/midi
Musical Instrument Digital Interface
.mid.midi
video/mp4
MPEG-4 video format
.mp4
video/webm
WebM video format
.webm
video/ogg
Ogg video format
.ogv
video/quicktime
QuickTime video format
.mov
video/x-msvideo
Audio Video Interleave
.avi
video/x-matroska
Matroska video format
.mkv
text/plain
Plain text file
.txt
text/html
HyperText Markup Language
.html.htm
text/css
Cascading Style Sheets
.css
text/javascript
JavaScript source code
.js.mjs
text/typescript
TypeScript source code
.ts.tsx
text/csv
Comma-separated values
.csv
text/xml
Extensible Markup Language
.xml
text/markdown
Markdown document
.md.markdown
text/calendar
iCalendar format
.ics
application/json
JavaScript Object Notation
.json
application/xml
XML document
.xml
application/pdf
Portable Document Format
.pdf
application/zip
ZIP archive
.zip
application/x-tar
Tape Archive
.tar
application/gzip
Gzip compressed archive
.gz.gzip
application/x-rar-compressed
RAR archive
.rar
application/x-7z-compressed
7-Zip archive
.7z
application/msword
Microsoft Word document
.doc
application/vnd.openxmlformats-officedocument.wordprocessingml.document
Microsoft Word (OpenXML) document
.docx
application/vnd.ms-excel
Microsoft Excel spreadsheet
.xls
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Microsoft Excel (OpenXML) spreadsheet
.xlsx
application/vnd.ms-powerpoint
Microsoft PowerPoint presentation
.ppt
application/vnd.openxmlformats-officedocument.presentationml.presentation
Microsoft PowerPoint (OpenXML) presentation
.pptx
application/x-shockwave-flash
Adobe Flash
.swf
application/x-font-ttf
TrueType Font
.ttf
application/font-woff
Web Open Font Format
.woff
application/font-woff2
Web Open Font Format 2
.woff2
application/octet-stream
Binary data
.bin.exe.dll
application/x-www-form-urlencoded
Form data encoding
No extensions
application/graphql
GraphQL query language
.graphql
application/ld+json
JSON-LD linked data
.jsonld
application/x-yaml
YAML Ain't Markup Language
.yaml.yml
application/toml
Tom's Obvious, Minimal Language
.toml
font/woff
Web Open Font Format
.woff
font/woff2
Web Open Font Format 2
.woff2
font/ttf
TrueType Font
.ttf
font/otf
OpenType Font
.otf
font/eot
Embedded OpenType
.eot
Showing 59 of 59 MIME types
Ready to get started?
Install content-types-lite today and simplify your MIME type handling