All articles

How Do I Add a Save Contact Button to My Website?

Add a save contact button to your website by hosting a .vcf file, linking a button to it, and serving it as text/vcard so phones import it.

Cover card with the title 'How Do I Add a Save Contact Button to My Website?' on a dark background

To add a save contact button to your website, create a vCard (.vcf) file with your details, upload it to your own site, and link a button to it. Serve the file as text/vcard so phones open it in Contacts instead of showing raw text. The whole job takes one file, one line of HTML and one server setting.

What a save contact button on a website actually does

A save contact button on a website is a plain link to a vCard file. When a visitor taps it, the phone downloads the file and offers to add the person to Contacts. Nothing runs in the background, and no app or plugin is needed on the visitor’s side.

The vCard specification, RFC 6350, defines the format and gives it the text/vcard content type. Our guide on what a vCard file is walks through each field.

What you need before you start

You need three things for a working button:

  • A .vcf file with your name, phone, email and anything else you want saved.
  • Somewhere on your own domain to upload it, such as a file manager, CMS media library or static folder.
  • Control of one server setting (the content type for .vcf files), or a host that already sends the right one.

Skip the third and you get the raw-text failure in the table further down.

Step 1: Write the vCard file

The vCard file is a short block of text you can write in any plain text editor. Under RFC 6350, a card must begin with BEGIN:VCARD, end with END:VCARD, and include VERSION and FN (the formatted name).

Here is a minimal file using the example phone and email lines from the spec:

BEGIN:VCARD
VERSION:4.0
FN:Jane Example
TEL;VALUE=uri;PREF=1;TYPE="voice,home":tel:+1-555-555-5555;ext=5555
EMAIL;TYPE=work:jqpublic@xyz.example.com
END:VCARD

Three rules keep the file readable on every phone:

  1. Save it as UTF-8. The spec fixes the character set to UTF-8, and “there is no way to override this,” so accented names break in other encodings.
  2. Use CRLF line endings. Each line in a vCard ends with a carriage return plus line feed.
  3. Keep lines short. The spec says content lines should be folded at 75 octets, which matters for long addresses or notes.

Name the file something people will recognise later, like jane-example.vcf. IANA lists both .vcf and .vcard as the file extensions, but .vcf is the one people expect.

Step 2: Upload the file to your own domain

Upload the .vcf file to the same domain as the page with the button. Browsers treat download links from other domains differently.

The HTML download attribute only works for same-origin URLs, plus same-origin blob: and data: links. Point it at a file on another domain and the browser ignores the attribute and opens the file instead. So a Dropbox or Drive link won’t behave like a file on your site, even though one Webflow forum answer suggests exactly that workaround for builders that won’t host .vcf files.

Step 3: Add the button HTML

The button itself is an ordinary link. A forum user answering this question said to link the button straight to the .vcf file. Paste this where the button should appear:

<a href="/contact/jane-example.vcf" download="jane-example.vcf" class="button">
  Save Jane's contact to your phone
</a>

The download value suggests a filename. The link text should say what happens. WCAG 2.4.4 Link Purpose is a Level A rule that a link’s purpose should be clear from its text or its context, so “Save Jane’s contact” beats a bare “Download”.

Step 4: Send the right server headers

The server should send the vCard with two headers. Set Content-Type to text/vcard, and add Content-Disposition: attachment if you want a download rather than an in-browser view:

Content-Type: text/vcard; charset=utf-8
Content-Disposition: attachment; filename="jane-example.vcf"

The Content-Disposition header tells the browser to show content inline (the default) or save it as a file. Put the filename in quotes if it contains spaces. Avoid percent-escaped characters in it, because Firefox and Chrome decode them while Safari does not.

If your host sends an old type, change it. IANA marks text/x-vcard, text/directory and text/directory; profile=vcard as deprecated in favour of text/vcard.

Why save contact buttons fail, and the fix for each

Most broken buttons come from one of a handful of causes. This table maps what visitors see to the likely fix:

What the visitor sees Likely cause Fix
Raw text in a browser tab Wrong or missing content type Serve the file as text/vcard
Leaves the page instead of downloading File is on another domain Host the .vcf on the same domain
Wrong file name Content-Disposition filename wins Match the header filename to the download value
Garbled accents in the name File not saved as UTF-8 Re-save as UTF-8
Contact imports with missing fields Missing FN or broken lines Check required fields and line endings

Even a correct setup can surprise you. MDN notes that download behaviour “varies by browser, user settings, and other factors”, so a file may save quietly or open in another app. On iPhone specifically, see why a vCard won’t import on iPhone if the contact sheet never appears.

How to check it worked

Test the button on a real phone, not just a desktop browser. Open the page on an iPhone and an Android phone, tap the button, and confirm the contact sheet shows the right name, number and email before you save.

Then check the headers. In your browser’s developer tools, open the Network tab and click the .vcf request. The content type should read text/vcard.

Desktop visitors can’t save to a phone from a laptop, so put a QR code next to the button that points to the same page or file. Our post on the vCard QR code covers which kind to use.

The limitation: a saved contact never updates itself

A vCard button hands visitors a copy of your details, and the copy never refreshes. Change your number next year and replace the file, and everyone who already saved you keeps the old one until they tap the button again.

My take: if your details change often, or you have several people on the team, stop hand-maintaining .vcf files. Link to a profile page that generates the vCard for you. On QRCard, the Save Contact button builds a vCard 3.0 file from your current profile each time, and it opens in the native Contacts app on iOS or Android without any app.

That fixes new saves, not old ones, so keeping your card current still means getting people back to the page. If you’re weighing a full profile page against a plain site section, see digital business card vs website, or try the button on the features page.

FAQ

What file does a save contact button download?

A vCard, a plain text file with the .vcf extension. Phones read it as a contact and offer to add it to the address book.

Why does my vCard open as text instead of saving?

The server is usually sending the wrong content type. Serve the file as text/vcard; older types such as text/x-vcard are deprecated.

Can I use the download attribute with a file on Dropbox or Google Drive?

Not reliably. The download attribute only works for same-origin links, so on another domain the browser ignores it and just navigates to the file.

Will people get my new number if I change the file?

Only if they tap the button again. A saved contact is a copy, so updating the file on your site doesn’t change what is already in someone’s phone.

Sources