Mime Type Lookup
Bounded off line common file-extension MIME inventory (10explicit entries), case fold/optional one leading dot. Not a completeIANA/media-type database, content-sniffing security verdict or evidence actual bytes match label.
Description
A media type describes a file or representation using a type/subtype name.
A media type describes a file or representation using a type/subtype name.1
File extensions can suggest common media types, but an extension does not prove what the file contains. The calculation and input requirements are explained below.
When to use Mime Type Lookup
Enter an extension token, optionally with one leading dot.
How to use Mime Type Lookup and how it works
- Prepare the measurements or independently established model inputs described below, with matching units and observation scope.
- Enter the required fields and run Mime Type Lookup.
- Read the result fields using the formula, output units, signs and ordering explained below.
- Correct any rejected inputs and rerun; interpret the result within the stated model and its assumptions.
| Input field | Meaning | Value type | Requirement |
|---|---|---|---|
| actualExtension | Actual Extension. Use the units and matching context stated in the calculation below. | string | Required; other constraints below |
Enter an extension token, optionally with one leading dot. Remove that dot and lowercase the remainder, requiring one or more ASCII letters or digits. Return the mapped media type from the ten-entry table, or empty text and found=false for an otherwise valid unknown extension. Whitespace, paths and compound dotted extensions fail this token grammar. No content sniffing occurs.
mimeType=inventory[normalizedExtension] or ''; found=inventoryContainsKey Apply the input ordering, units and branch conditions stated above.
| Extension | Media type |
|---|---|
| txt | text/plain |
| html | text/html |
| css | text/css |
| js | text/javascript |
| json | application/json |
| application/pdf | |
| png | image/png |
| jpg | image/jpeg |
| svg | image/svg+xml |
| wasm | application/wasm |
| Output field | Meaning | Value type |
|---|---|---|
| result | Object containing the calculated or selected fields below. | object |
| result.mimeType | Mime Type. Interpret its unit, sign, order or availability flag as explained above. | string |
| result.foundInBoundedInventory | Found In Bounded Inventory. Interpret its unit, sign, order or availability flag as explained above. | boolean |
{
"input": {
"actualExtension": "json"
},
"output": {
"result": {
"mimeType": "application/json",
"foundInBoundedInventory": true
}
}
} Limitations and assumptions
The calculation uses the supplied observations and model inputs. It does not collect measurements, select a reference population or coefficient, or establish that the model applies to the actual case. The stated branch conditions and output units remain part of the result.
All fields require explicit values. Unexpected fields, wrong types, nonfinite numbers and sparse arrays are rejected. Alignment, bounds and supported-token rules are explained above; extremely large inputs or nonfinite results can also fail. Input errors differ from successful false comparisons, unavailable-domain flags and empty match lists.
Alternative or Complementary methods
Use Extension Lookup for a complementary operation: A media type may have several associated file extensions.
Use Content Encoding Detector for a complementary operation: Content-Encoding declares transformations applied to an HTTP representation, such as compression.
References
-
Mime Type Lookup — tool.io
Similar or alternative tools
- Extension Lookup
A media type may have several associated file extensions.
- Content Encoding Detector
Content-Encoding declares transformations applied to an HTTP representation, such as compression.