Utilo

FLAC MIME Type – Free, Online, Private

audio/flac is the registered type for native FLAC. The file starts with fLaC.

What .flac is

Native FLAC starts with the four bytes 66 4C 61 43, which are fLaC, then a sequence of metadata blocks. The last metadata block has its high bit set, and the STREAMINFO block is first. STREAMINFO carries the sample rate, the channel count, and the total samples, so duration is exact, unlike a naked MP3. Audio frames follow. FLAC is lossless. RFC 9639 registers audio/flac for this native framing. FLAC inside Ogg is a different mapping and uses audio/ogg, not this type.

IANA registers audio/flac in RFC 9639. The media type is audio/flac. Extensions that use it on this page: .flac. A client compares the type, not the filename, once the response has arrived. The filename still matters on disk and in Content-Disposition, which is why a wrong extension and a wrong header are two different bugs.

What sends audio/flac

What sends audio/flac: Send audio/flac for a .flac download and for an audio element if you have confirmed the browser can decode it. Firefox has played FLAC for a long time. If you need the widest coverage, also offer a lossy alternate at another URL rather than lying about the type. Range requests matter more here than on a short clip, because masters are large. Accept-Ranges: bytes plus a correct Content-Length lets a player seek without downloading the metadata twice. The file on disk is still .flac. Once the response exists, a client trusts audio/flac, not the filename. If you transcode FLAC to MP3 for delivery, keep the master URL on audio/flac and the delivery URL on audio/mpeg. Do not overwrite the master in place. Clients that cached the URL will mix lossless and lossy bytes under one cache key if you forget to change the URL or the validator.

Content-Type for .flac

Send audio/flac and do not add a charset parameter. The body is binary. A charset tells a text decoder to reinterpret bytes that are not text, which corrupts a download and does not help a browser sniff the format.

Content-TypeContent-Type: audio/flac

nginx, Apache, and Express

These snippets map .flac to audio/flac. nginx reads the types block when it picks a type from the URL's extension. A location that sets default_type, or an application that sets the header itself, overrides that map. Apache AddType applies in the directory context where you put it. The Express static example writes the header for files ending in .flac so a stale mime database in the framework cannot disagree with the type on this page.

nginx# /etc/nginx/mime.types, inside the types { } block
audio/flac                  flac;
ApacheAddType audio/flac .flac
Expressimport express from "express";

const app = express();
app.use(express.static("public", {
  setHeaders(res, filePath) {
    if (filePath.endsWith(".flac")) {
      res.setHeader("Content-Type", "audio/flac");
    }
  },
}));

Pitfalls for audio/flac

Pitfalls that show up for audio/flac, and not for a neighboring type with a similar extension: Serving Ogg-FLAC as audio/flac fails the signature check. Ogg-FLAC starts with OggS. Serving native FLAC as audio/ogg fails the other way. Another trap is a metadata block that says the stream is longer than the body, which happens when a cutter truncates the file and leaves STREAMINFO alone. Players then seek past EOF. A third is gzip on top of FLAC. The audio is already compressed with a predictor. A second compression pass rarely pays.

  • audio/x-flac is unofficial. RFC 9639's type is audio/flac.
  • A PICTURE block can embed a cover image. It does not change the media type. It can make the file much larger than the audio.
  • 16-bit and 24-bit FLAC share audio/flac. The bits-per-sample field is in STREAMINFO.
  • Do not add a charset parameter.

Frequently asked questions

What is the FLAC signature?

The four bytes fLaC. An Ogg FLAC file starts with OggS instead and should be audio/ogg.

Is audio/flac registered?

Yes. RFC 9639 registers it.

Does the browser always play it?

No. Check the audio element can decode audio/flac before you depend on it. Offer another type when you cannot.

Is FLAC already compressed?

Yes, losslessly. Content-Encoding: gzip on top is usually wasted work.