Skip to main content
CheckTown
Validadores

Busqueda de tipo MIME: Encuentre tipos de contenido para cualquier extension

Publicado 6 min de lectura
En este artículo

What Is a MIME Type?

A MIME type (Multipurpose Internet Mail Extensions type), also called a media type, is a standard label that indicates the nature and format of a file or data stream. Originally designed for email attachments, MIME types are now fundamental to how web browsers, servers, and APIs communicate about content formats.

Every HTTP response includes a Content-Type header with a MIME type that tells the browser how to handle the data — whether to render it as HTML, display an image, play audio, download a file, or parse it as JSON.

MIME Type Structure

A MIME type consists of a type, a subtype, and optional parameters, following the format: type/subtype;parameter=value.

  • Type — the general category: text, image, audio, video, application, multipart, font, or model
  • Subtype — the specific format within the type: html, png, mp4, json, pdf, octet-stream
  • Parameters — optional key-value pairs: charset=utf-8 for text types, boundary for multipart types

Pruébalo gratis — sin registro

Buscar un tipo MIME →

Common MIME Types

Hundreds of MIME types are registered with IANA (Internet Assigned Numbers Authority). Here are the most frequently used ones.

  • text/html — HTML documents, the foundation of every web page
  • application/json — JSON data, the standard format for REST API communication
  • image/png and image/jpeg — the two most common image formats on the web
  • application/pdf — PDF documents, universally used for printable documents
  • application/octet-stream — generic binary data, used when the specific type is unknown or for file downloads

How MIME Type Lookup Works

MIME type lookup maps file extensions to their corresponding MIME types and vice versa.

  • Extension to MIME — given a file extension like .png, the lookup returns image/png
  • MIME to extension — given a MIME type like application/pdf, the lookup returns .pdf
  • Content detection — when extensions are missing or misleading, some tools use magic numbers (file header bytes) to detect the actual content type

MIME Types in Web Development

Correct MIME types are essential for web security, performance, and functionality.

  • Content-Type header — servers must send the correct MIME type for every response. Serving JavaScript as text/html can create XSS vulnerabilities
  • X-Content-Type-Options: nosniff — this security header prevents browsers from guessing MIME types, enforcing the server-declared type
  • Accept header — clients send Accept headers to tell servers which content types they can handle, enabling content negotiation

Frequently Asked Questions

What is the difference between MIME type and Content-Type?

Content-Type is an HTTP header that contains a MIME type value. The MIME type is the format identifier (like application/json), while Content-Type is the header name that carries this value in HTTP communication.

Can I create my own MIME type?

Yes, using vendor-specific subtypes prefixed with vnd. (e.g., application/vnd.mycompany.myformat) or personal subtypes prefixed with prs. Experimental types use the x- prefix, though this convention is being phased out.

Why does my server return application/octet-stream for known file types?

The server does not have a mapping for that file extension in its MIME type configuration. Add the correct mapping to your web server configuration (nginx.conf, .htaccess, or Express middleware).

Herramientas relacionadas