File Extension
Definition
Extensions are a naming convention that several different systems happen to agree on. An operating system uses one to choose which application opens a document; a web server uses one to look up a MIME type for the response header; a build tool uses one to decide which compiler to run. Most are between one and four characters, though .webmanifest and similar longer ones exist, and compound forms such as .tar.gz stack two of them. Case handling differs in a way that causes real trouble: Windows and macOS usually treat names case-insensitively, while Linux file systems and object storage keys do not, so IMG.JPG and img.jpg are one file on a laptop and two objects in a bucket. A file can have no extension at all, in which case nothing downstream has anything to look up.
Why It Matters
The classic failure is a static site that works locally and 404s in production. A page references hero.jpg, the file on disk is Hero.JPG, and macOS quietly resolves the difference until the files are uploaded somewhere that does not. Nothing in the browser explains this; you get a broken image and a 404 in the network tab. A missing extension is quieter still: the server has no lookup key, falls back to application/octet-stream, and a perfectly good HTML page downloads instead of rendering. Extensions are also a small security surface, because a name displayed as invoice.pdf in a narrow column may actually end invoice.pdf.exe.
How It Works
Serving software splits the name at the final dot and looks the remainder up in a table — nginx ships one, and every static host maintains an equivalent. Object stores keep no table, so the extension in the key matters only because upload tooling reads it to decide which Content-Type to attach. Some hosts add extensionless routing, where a request for /about is answered with about.html, which is a convenience layered on top rather than anything the file system knows about. Genuine detection ignores names entirely and reads the first few bytes: a PDF begins with the characters %PDF-, a PNG with a fixed eight-byte signature, a ZIP with PK followed by two control bytes. That is what a server should use when the name came from a stranger.
Real-World Example
Someone builds a static site on a Mac and publishes it through 99helpers. One photograph was saved as Hero.JPG but the markup asks for hero.jpg, and on the Mac it always worked. Object keys preserve the exact name, so at coastline.99helpers.site the image is missing until the file is renamed to match. The fix is thirty seconds; finding it took an hour, because nothing in the local preview ever hinted at a problem.
Common Mistakes
- ✕Relying on case-insensitive local behaviour — a reference to hero.jpg for a file called Hero.JPG breaks the moment it is hosted
- ✕Treating the extension as proof of content — renaming a file does not change a single byte inside it, and nothing validates the claim
- ✕Saving an image as .jpg when it is actually WebP data, which fails in exactly the old clients the rename was meant to satisfy
- ✕Leaving file extensions hidden in the operating system's file manager, then saving report.pdf and ending up with report.pdf.pdf
Related Terms
MIME Type
A MIME type, also called a media type or content type, is the short label a server sends to say what kind of data a response contains — text/html, image/png, application/pdf. The browser decides what to do with the bytes based on that label, not on the file name.
Content-Disposition
Content-Disposition is an HTTP response header that tells the browser whether to show a file in the window or save it to disk, and what name to suggest when it saves. It is how one URL can either open a PDF in a tab or start a download.
ZIP Archive
A single .zip file that holds many files and folders, each compressed separately. On a host it is used two ways: served as one download, or unpacked on upload so its contents are served individually.
URL Slug
The readable, hand-picked part of a web address that names one particular thing — the 'acme-pitch' in acme-pitch.99helpers.site. It is chosen, short and made only of lowercase letters, digits and hyphens.
Relative Path
A relative path points at a file starting from the page that mentions it, rather than from the site root. It has no leading slash — styles.css, img/logo.png, ../fonts/inter.woff2.
Put a file online in seconds
Drop in a document, an image, a page or a whole static website and share the link — free, with no build step and no server to set up.
Host a file free →