Mail merge

On this page 7

Mail merge is a feature of office applications that combines a template document containing placeholders with a structured data source, such as a spreadsheet or contact list, to generate many personalized copies automatically. Each record in the data source produces one output document, letter, envelope, label or email in which the placeholders are replaced by that record’s values.

Mail merge is built into word processors such as Microsoft Word and LibreOffice Writer, and similar functions exist in Google Docs through add-ons. It remains one of the most practical document automation tools in office software, because it turns hours of repetitive copying and editing into a single repeatable operation.

How mail merge combines a template with data

Mail merge works by linking a main document to a data source and inserting merge fields that refer to the column names of that source. When the merge runs, the word processor iterates over every record, substitutes the field values and writes the result to a new document, a printer or an email client.

The data source is treated as a table of records: the first row holds the field names and every following row holds one recipient. Common sources include XLSX and CSV files, database queries, Outlook or system address books and ODF spreadsheets in LibreOffice.

ComponentRoleTypical example
Main documentHolds fixed text and layoutLetter template in DOCX format
Data sourceSupplies one record per outputSpreadsheet with 500 customer rows
Merge fieldPlaceholder for a column valueFirstName, City, InvoiceTotal
Rules or conditionsChange content per recordIf Country is Germany, insert German text
Output targetReceives the finished resultsNew document, printer or email
Core components of a mail merge

Before running the full merge, users can preview results record by record and filter or sort the recipient list, which catches broken fields or empty values before hundreds of copies are produced.

Types of mail merge output

Mail merge produces several output types, and the choice determines page setup, field placement and delivery. The same data source can feed letters, envelopes and labels for one mailing.

Output typeLayout characteristicTypical use
LettersOne full page or more per recordContracts, notices, cover letters
EnvelopesAddress placed on an envelope sizePostal mailings
LabelsMany records on one sheet in a gridAddress labels, name badges
Email messagesOne message sent per recordInvitations, account notifications
Directory or catalogAll records listed in one documentPrice lists, member directories
Mail merge output types and their uses

Email merge deserves particular care. In Microsoft Word it sends messages through the desktop Outlook client, and it typically cannot add individual attachments per recipient without additional tools, which surprises many first-time users.

Mail merge compared with other personalization methods

Mail merge is the simplest way to personalize documents within an office suite, but it is not the only one. Spreadsheet formulas, scripts and dedicated marketing platforms solve related problems with different trade-offs in scale, tracking and control.

ApproachStrengthLimitation
Word processor mail mergeNo programming, full page layout controlLimited logic and tracking
Spreadsheet formulasQuick text assembly in cellsPoor formatting for printed letters
Scripts and macrosCustom logic, attachments, PDF exportRequires coding and maintenance
Email marketing platformsDelivery tracking, consent managementNot suited to formal printed documents
Document generation servicesHigh volume, integration with systemsHigher cost and setup effort
Mail merge and alternative personalization approaches

For occasional batches of letters, labels or certificates, built-in mail merge is usually the right choice. When a process runs daily, requires per-recipient PDFs or must log delivery, a scripted or system-based approach becomes more reliable.

Preparing data and fields correctly

Most mail merge problems originate in the data, not in the template. A clean data source has one header row, unique and simple column names, one record per row and no merged cells, blank rows or subtotals inside the table.

Formatting needs special attention. Numbers, dates and currency often lose their spreadsheet formatting during the merge, so teams either store them as preformatted text or apply field format switches in the word processor to control decimal places and date patterns.

SymptomLikely causeFix
Dates appear in the wrong formatUnderlying date value is mergedUse a date format switch or text column
Leading zeros disappearPostal codes stored as numbersStore the column as text
Extra blank lines in addressesEmpty optional fieldsUse conditional rules or address blocks
Wrong recipients includedNo filter on the record listFilter or sort before merging
Fields show codes, not valuesField code view is turned onToggle field codes off
Common mail merge problems and their fixes

Conditional rules, such as If-Then-Else fields in Word, add flexibility: one template can choose a salutation, a paragraph or a language depending on a field value, which avoids maintaining several near-identical templates.

Limitations, privacy and common mistakes

Mail merge handles personal data in bulk, so errors have a wide reach. A misaligned column or an unfiltered list can send the wrong name, amount or confidential detail to hundreds of people at once, and an email merge cannot be recalled once sent.

  • Skipping the preview: a quick review of the first, last and a few random records catches most field errors.
  • Sending without a test: always merge a test batch to an internal address before the real run.
  • Ignoring consent rules: bulk email to individuals must respect data protection and anti-spam requirements such as the GDPR.
  • Editing the data source during a merge: open files can lock or produce inconsistent results.
  • Keeping merged output too long: generated documents duplicate personal data and should follow retention policies.

Mail merge also has practical scale limits. It works well for hundreds or a few thousand records, but very large batches can be slow in a desktop word processor, and email sending may hit mail server rate limits.

A plain-language summary

Mail merge is like a form letter with blanks that fill themselves in. You write the letter once, leave gaps for the name, address and other details, and point the program to a list of people.

The program then makes one finished copy for every person on the list, each with the right details in the right places. It saves the time of typing the same letter again and again, and it reduces copy-and-paste mistakes.

An example from practice

The office manager of a regional sports club must send annual membership renewal letters to 640 members. The member list already exists in a spreadsheet with columns for first name, surname, address, membership type and renewal fee.

She creates one letter template in the word processor, inserts merge fields for the name, address and fee, and adds a conditional rule that inserts a youth discount paragraph only for junior members. After previewing ten records and fixing postal codes that had lost their leading zeros, she merges the letters and a matching sheet of address labels. A task that previously took two days of manual editing is finished in about an hour, with no misaddressed letters reported.