MIME type lookup by extension
Type .json and get application/json, or png for image/png, with or without the dot and in any letter case. A typo such as jsoon brings back three close spellings instead of a guessed type. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Extension
- .json
- Mime type
- application/json
Enter an extension with or without its leading dot, such as .json or png, and receive a normalized extension plus its standard MIME type. Unknown extensions return a clear error with nearby supported spellings, making the tool useful both for quick checks and for deterministic validation inside automated workflows.
From a file ending to its media type
A file extension is a naming convention, while a MIME type is the structured identifier software uses to describe content. Browsers, web servers, APIs, object stores, and email clients commonly rely on values such as application/json, image/png, or text/css when deciding how to handle a resource. This lookup provides the standard mapping for widely used document, image, audio, video, archive, font, and web formats.
Supply the extension alone or include its leading dot; surrounding whitespace is removed and letter case is normalized before lookup. The result deliberately contains both the normalized extension and the MIME type, so it can be read directly or passed to another step without reparsing a sentence. The operation does not inspect a file and does not claim that bytes match a filename.
It answers the narrower, deterministic question of which registered or established media type normally corresponds to the extension you supplied.
Understand normalization, errors, and close matches
After an optional leading dot is removed, the remaining value must contain only letters and numbers. Paths, filenames, wildcards, slashes, and compound punctuation are rejected because silently extracting a suffix would make accidental input look valid. When a well-formed extension is not recognized, the response is an invalid-input error rather than a guessed media type.
It also lists three close supported extensions, ranked deterministically by spelling distance with stable tie breaking. A suggestion is information, not an automatic correction: submit the intended extension explicitly to obtain a MIME type. This keeps integrations predictable and prevents a typo from turning into a plausible but incorrect Content-Type header.
Use the result safely in applications
The returned MIME type is suitable for configuration, metadata, allow-list preparation, documentation, and other workflows where the extension is the known source of truth. For example, a build tool can confirm the Content-Type assigned to a generated asset, an upload form can map an allowed suffix to its expected media type, and a support engineer can check an unfamiliar office format without searching a long registry. Security-sensitive systems should still inspect file signatures or parse the content, because filenames can be renamed and extensions can lie.
The lookup is intentionally local: it makes no network request, stores no submitted value, and produces the same result for the same input.
What you can do with it
Set a response Content-Type
Find the expected media type before configuring headers for a generated or statically served file.
Validate upload rules
Map an allowed file extension to a MIME type while keeping filename checks separate from content inspection.
Diagnose a format mismatch
Compare a file suffix with the media type reported by a server, storage object, or attachment.
FAQ
May I include the leading dot?
Yes. Values such as .png and png are normalized to the same extension.
Does this tool inspect an uploaded file?
No. It maps the supplied extension only; it does not read bytes, detect signatures, or verify content.
Are uppercase extensions supported?
Yes. Case is normalized, so JPG, jpg, and . JPG produce the same result.
Can I use the result as a security check?
Not by itself. A filename can be misleading, so security-sensitive validation should also inspect or parse the actual content.
What if I mistype an extension, such as jsoon?
You get a clear message with three close supported spellings instead of a guessed type. The suggestions are not applied automatically, so enter the extension you meant to get its media type.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/web/mime-type-lookup \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"extension":".json"}'const res = await fetch("https://api.kit.forhosting.com/web/mime-type-lookup", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"extension": ".json"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/web/mime-type-lookup",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"extension": ".json"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/web/mime-type-lookup", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"extension":".json"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"extension":".json"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/web/mime-type-lookup", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"extension": ".json"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "web.mime_type_lookup",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
timeout_sec | 30 |
max_crawl_pages | 25 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
This MIME type lookup turns a familiar file extension into the media type used in HTTP headers, uploads, email attachments, and content validation.
Understand normalization, errors, and close matches
Extensions are accepted in a human-friendly form: JSON, json, and .json all resolve to the same entry. That is especially helpful for mistakes such as jpgg, jsoon, or xslx, where the intended entry is usually obvious to a person but should not be silently selected by an API.
Use the result safely in applications
Likewise, an HTTP response may carry a type that differs from its URL suffix, so use the actual response header when auditing a live resource. It runs free in the browser on this page, while automated API requests are charged at $0.002 each.
Technical questions
What happens when an extension is unknown?
The request returns an invalid-input error that names the unrecognized extension and lists three close supported matches.
What does an API lookup cost?
Each API request costs $0.002; the browser tool on this page is free.