Creating Bulk Pay Stubs from a Spreadsheet
Processing payroll means generating a pay stub for every employee each pay period — weekly, biweekly, or monthly. Doing this manually is slow and error-prone when your team grows beyond a handful of people. With Mergram, you upload a pay stub PDF template and a spreadsheet of payroll data, map the fields once, and generate every employee’s pay stub in a single operation. Each stub is personalized with that employee’s earnings, deductions, taxes, and net pay.
Prerequisites
Before you start, make sure you have:
- A pay stub PDF template — a designed pay stub layout saved as PDF, with blank areas for variable data
- An Excel or CSV file with your payroll data organized in columns and rows
- A Mergram account with credits for the number of pay stubs you need
Design your template first
Create your pay stub template in any design tool — Canva, Microsoft Word, Google Docs, or Adobe Illustrator — and export as PDF. Leave blank areas where variable data (employee name, earnings, deductions, net pay) will be placed. Mergram fills these areas with data from your spreadsheet.
Preparing Your Payroll Data
Organize your spreadsheet with one row per employee per pay period. Here is a recommended column structure:
| EmployeeName | EmployeeID | EmployeeEmail | PayPeriodStart | PayPeriodEnd | GrossPay | FederalTax | StateTax | SocialSecurity | Medicare | HealthInsurance | Retirement401k | OtherDeductions | NetPay | YTDGross | YTDNet |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Sarah Johnson | EMP-0142 | sarah@example.com | 2025-01-01 | 2025-01-15 | $3,200.00 | $480.00 | $192.00 | $198.40 | $46.40 | $125.00 | $160.00 | $0.00 | $1,998.20 | $38,400.00 | $23,978.40 |
| Miguel Alvarez | EMP-0087 | miguel@example.com | 2025-01-01 | 2025-01-15 | $4,500.00 | $675.00 | $225.00 | $279.00 | $65.25 | $125.00 | $225.00 | $50.00 | $2,855.75 | $54,000.00 | $34,269.00 |
| Priya Patel | EMP-0203 | priya@example.com | 2025-01-01 | 2025-01-15 | $2,800.00 | $420.00 | $0.00 | $173.60 | $40.60 | $125.00 | $140.00 | $0.00 | $1,900.80 | $33,600.00 | $22,809.60 |
Use Excel formulas for calculations
Let your spreadsheet handle the math. Use formulas like =GrossPay*0.062 for Social Security, =GrossPay*0.0145 for Medicare, and =GrossPay-SUM(FederalTax:OtherDeductions) for net pay. Mergram reads the calculated values the same as typed values — no need to paste as values first.
Designing Your Pay Stub Template
Layout Structure
A well-designed pay stub typically includes these sections:
| Template Section | Typical Fields | Position |
|---|---|---|
| Header | Company logo, company name, “PAY STUB” title | Top of page |
| Employee info | Employee name, employee ID, address | Upper-left, below header |
| Pay period | Pay period start, pay period end, pay date | Upper-right area |
| Earnings | Gross pay, hours worked, hourly rate | Center-left of page |
| Deductions | Federal tax, state tax, Social Security, Medicare, health insurance, 401(k), other | Center-right of page |
| Net pay | Net pay amount (bold, prominent) | Below earnings and deductions |
| Year-to-date | YTD gross, YTD deductions, YTD net | Bottom section |
| Footer | Company address, contact info, disclaimer | Bottom of page |
Placing Fields on the Canvas
For each column in your spreadsheet, drag it onto the canvas in the corresponding position:
- Employee name and ID — Place in the employee info section, top-left of the stub
- Pay period dates — Place
PayPeriodStartandPayPeriodEndnext to each other in the header area - Gross pay — Place in the earnings section as the first and most prominent earnings field
- Tax deductions — Place
FederalTax,StateTax,SocialSecurity, andMedicarein the deductions column - Voluntary deductions — Place
HealthInsurance,Retirement401k, andOtherDeductionsbelow the tax deductions - Net pay — Place in a highlighted area with larger font — this is the most important number on the stub
- Year-to-date totals — Place
YTDGrossandYTDNetin a separate row at the bottom
Adjust font sizes to match your template design — net pay should stand out clearly, while individual deduction line items can use a smaller, consistent size.
Custom Filename Templates
Use filename templates to keep your generated pay stubs organized by employee and pay period:
| Filename Template | Example Output |
|---|---|
PayStub_[[EmployeeID]]_[[PayPeriodEnd]] | PayStub_EMP-0142_2025-01-15.pdf |
[[PayPeriodEnd]]_[[EmployeeName]] | 2025-01-15_Sarah Johnson.pdf |
PayStub_[[EmployeeID]] | PayStub_EMP-0142.pdf |
Consistent filenames make it easy to locate specific pay stubs in your archive, whether you store them in a shared drive, upload to payroll software, or email them to employees.
Password Protection for Pay Stubs
Pay stubs contain sensitive financial information — Social Security numbers, salary details, and banking information. Password protection is strongly recommended.
Protect sensitive employee data
Pay stubs often include personally identifiable information (PII) and compensation details. Always use password protection when generating pay stubs, especially if you plan to email them or store them in shared locations.
Set a password template in the merge dialog using merge fields that only the employee would know:
| Password Template | Example Result | Use Case |
|---|---|---|
[[EmployeeID]] | EMP-0142 | Simple, employee-specific |
[[SSN_Last4]] | 4289 | Last 4 digits of Social Security number |
stub-[[EmployeeID]]-2025 | stub-EMP-0142-2025 | Employee ID plus year |
To use a custom field like SSN_Last4, add a column to your spreadsheet containing the last four digits of each employee’s SSN. Mergram uses that value as the password for that employee’s pay stub.
Sending Pay Stubs via Email Campaigns
Combine bulk pay stub generation with email delivery to send pay stubs directly to employees:
- Set up SMTP — Configure your email provider in Settings → SMTP (Gmail, SendGrid, Mailgun, or any SMTP provider)
- Map employee email — Ensure your spreadsheet has an
EmployeeEmailcolumn with each employee’s email address - Design email template — Use merge fields for personalization so each employee sees their own name and pay period
- Attach pay stubs — Mergram automatically attaches each employee’s generated pay stub PDF to their individual email
- Run the campaign — Review a preview, then send — each employee receives their own pay stub as a password-protected PDF attachment
Sample email template:
Subject: Your Pay Stub for [[PayPeriodStart]] – [[PayPeriodEnd]]
Hi [[EmployeeName]],
Your pay stub for the pay period of [[PayPeriodStart]] through [[PayPeriodEnd]] is attached.
The password to open your pay stub is your employee ID ([[EmployeeID]]).
If you have questions about your pay stub, please contact HR.
Best regards,
Payroll Team
Send pay stubs in individual mode
When emailing pay stubs, always use individual output mode so each employee receives only their own pay stub. Never send a combined PDF — that would expose every employee’s compensation to each recipient.
Best Practices for Pay Stub Generation
- Verify payroll calculations before merging — Double-check gross pay, all deductions, and net pay in your spreadsheet. A formula error propagates to every generated pay stub.
- Standardize date formats — Use a consistent format like YYYY-MM-DD across all pay period columns to avoid confusion.
- Include year-to-date totals — Employees and auditors expect YTD figures on every stub. Add
YTDGrossandYTDNetcolumns to your spreadsheet. - Test with 2–3 employees first — Generate a small batch, open the PDFs, and verify that every field is correctly placed and amounts match before running the full payroll.
- Always password-protect — Pay stubs contain PII and salary data. Use a password template so only the intended employee can open their stub.
- Archive each pay run — Download the generated pay stubs after each payroll cycle and store them in a secure, organized folder for compliance and audit purposes.
Common Issues and Troubleshooting
Currency symbols not rendering correctly: Ensure your spreadsheet cells are formatted as text or use consistent currency formatting. If the PDF displays unexpected characters, try using plain numbers without currency symbols and add the $ symbol as static text on the template.
Deductions with zero values showing blank: If an employee has no optional deductions (e.g., OtherDeductions is $0.00), the field may look empty. You can either place a static $0.00 label on the template or ensure your spreadsheet always contains a value — even zero — so the field renders consistently.
Employee names with special characters: Names containing accents (e.g., “José Martínez”), hyphens (e.g., “Mary-Jane Wilson”), or non-Latin characters (e.g., “Li Wei 李伟”) are fully supported. Ensure your CSV file is saved with UTF-8 encoding if exporting from Excel.
Pay stubs exceeding one page: If your template has many deduction categories, the layout may overflow. Reduce font sizes for deduction line items, or design your template with a compact two-column layout for earnings and deductions side by side.
Get Started
Upload your pay stub template and payroll spreadsheet to the Mergram editor. Map employee fields onto the canvas, preview with real data, enable password protection, and generate your entire batch of pay stubs in one click.