Utilo

VCF MIME Type – Free, Online, Private

text/vcard is the type for a vCard contact file. RFC 6350 is version 4. Many files in the wild are still version 3.

What .vcf is

A vCard is a text object that starts with BEGIN:VCARD and ends with END:VCARD. The VERSION line says which specification the rest of the object follows. Version 3 is RFC 2426 and is still what a lot of phones emit. Version 4 is RFC 6350, which registers text/vcard. A file can hold more than one card. Properties such as FN, N, TEL, and EMAIL are lines. Version 4 prefers UTF-8. Version 3 files often name a charset on each property instead. When you serve version 4, send text/vcard; charset=utf-8. .vcf is the extension. .vcard is rare and is the same type if you accept it.

IANA registers text/vcard in RFC 6350. The media type is text/vcard. Extensions that use it on this page: .vcf. 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 text/vcard

What sends text/vcard: Send text/vcard; charset=utf-8 for a contact download. Content-Disposition with a filename ending in .vcf helps a phone offer 'add to contacts' instead of a generic save. Do not send text/x-vcard if you are writing new configuration. It is an old alias. A QR code that embeds a contact is not this HTTP type. The QR payload is text inside an image. The image response is image/png or whatever image you generated. Only the downloaded card file is text/vcard. The file on disk is still .vcf. Once the response exists, a client trusts text/vcard, not the filename. If you generate cards from a directory, omit fields the user did not consent to publish. The media type will happily carry a home address. Access control belongs on the URL. A public .vcf URL is a public contact, cached by every client that subscribed to it.

Content-Type for .vcf

Send text/vcard; charset=utf-8. The charset parameter names the encoding of the body. Leaving it off forces the client to guess, and for several text types the registered default is not UTF-8. Do not send a charset on a redirect. The header belongs on the response that contains the bytes.

Content-TypeContent-Type: text/vcard; charset=utf-8

nginx, Apache, and Express

These snippets map .vcf to text/vcard. 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 .vcf 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
text/vcard                  vcf;
charset utf-8;
charset_types text/vcard;
ApacheAddType text/vcard .vcf
AddCharset UTF-8 .vcf
Expressimport express from "express";

const app = express();
app.use(express.static("public", {
  setHeaders(res, filePath) {
    if (filePath.endsWith(".vcf")) {
      res.setHeader("Content-Type", "text/vcard; charset=utf-8");
    }
  },
}));

Pitfalls for text/vcard

Pitfalls that show up for text/vcard, and not for a neighboring type with a similar extension: Serving a version 3 card with a version 4 type does not upgrade the card. Clients read VERSION. Another bug is a photo inlined as base64 that a proxy truncates, so the card imports and the picture does not. Another is folding, which uses the same CRLF-plus-space rule as iCalendar. Another is a comma in a name that a CSV-minded exporter did not escape in the N property. A fifth is an HTML contact page saved as .vcf by a browser. The body will start with <!DOCTYPE or <html and the type will be a lie if you force text/vcard. Check for BEGIN:VCARD.

  • text/vcard is the registered type. text/x-vcard is legacy.
  • Multiple cards in one file are still one response and one type.
  • A charset on a single property in a version 3 file can disagree with the HTTP charset. Normalize to UTF-8 when you can.
  • Do not serve a vCard as text/html to 'preview' it. Preview in real HTML on a different URL.

Frequently asked questions

Which version does text/vcard imply?

The registration is tied to RFC 6350, version 4. The VERSION line inside the file is what a client actually branches on. Version 3 files are still common.

What is the signature?

The text BEGIN:VCARD. There is no binary magic.

Should I send charset=utf-8?

Yes for a version 4 card you encoded as UTF-8.

Is a contact QR code text/vcard?

The image is an image type. The card file you download is text/vcard.