Skip to content

US W-2 EFW2

Generate tax-year 2026 SSA EFW2 and optional Maryland MW508 and Pennsylvania myPATH W-2 files from JSON or CSV payroll.

$0.15/employee-state · $1 free credit every month, no card · MCP and REST

curl https://api.kanagu.dev/v1/efw2/generate \
  -H "Authorization: Bearer $KANAGU_KEY" \
  -H "Content-Type: application/json" \
  -d '{"taxYear":2026,"submitter":{"ein":"123456789","name":"Susquehanna Payroll","street":"210 Main St","city":"York","state":"PA","zip":"17401","bsoUserId":"TEST2026","software":{"kind":"in_house"},"preparerCode":"S","contact":{"name":"Pay Support","phone":"7175550101","email":"payroll@example.com"}},"employer":{"ein":"232345678","name":"Susquehanna Machine","street":"212 Main St","city":"York","state":"PA","zip":"17401","kind":"N","employment":"R","contact":{"name":"Pat Baker","phone":"7175550102","email":"Pat.Baker@example.com"}},"employees":[{"ssn":"123456780","firstName":"Dana","lastName":"Wood","street":"1 Maple St","city":"York","state":"PA","zip":"17401-1234","wages":"40321.77","federalTax":"4261.16","socialSecurityWages":"42500","socialSecurityTax":"2635","medicareWages":"42500","medicareTax":"616.25","D":"2178.23","retirementPlan":"1","paWages":"42500","paTax":"1304.75"}],"pennsylvania":{"accountId":"12345678"}}'
const res = await fetch("https://api.kanagu.dev/v1/efw2/generate", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KANAGU_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "taxYear": 2026,
    "submitter": {
      "ein": "123456789",
      "name": "Susquehanna Payroll",
      "street": "210 Main St",
      "city": "York",
      "state": "PA",
      "zip": "17401",
      "bsoUserId": "TEST2026",
      "software": {
        "kind": "in_house"
      },
      "preparerCode": "S",
      "contact": {
        "name": "Pay Support",
        "phone": "7175550101",
        "email": "payroll@example.com"
      }
    },
    "employer": {
      "ein": "232345678",
      "name": "Susquehanna Machine",
      "street": "212 Main St",
      "city": "York",
      "state": "PA",
      "zip": "17401",
      "kind": "N",
      "employment": "R",
      "contact": {
        "name": "Pat Baker",
        "phone": "7175550102",
        "email": "Pat.Baker@example.com"
      }
    },
    "employees": [
      {
        "ssn": "123456780",
        "firstName": "Dana",
        "lastName": "Wood",
        "street": "1 Maple St",
        "city": "York",
        "state": "PA",
        "zip": "17401-1234",
        "wages": "40321.77",
        "federalTax": "4261.16",
        "socialSecurityWages": "42500",
        "socialSecurityTax": "2635",
        "medicareWages": "42500",
        "medicareTax": "616.25",
        "D": "2178.23",
        "retirementPlan": "1",
        "paWages": "42500",
        "paTax": "1304.75"
      }
    ],
    "pennsylvania": {
      "accountId": "12345678"
    }
  }),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const result = await res.json();
curl https://api.kanagu.dev/mcp \
  -H "Authorization: Bearer $KANAGU_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"call_operation","arguments":{"operation":"efw2.generate","input":{"taxYear":2026,"submitter":{"ein":"123456789","name":"Susquehanna Payroll","street":"210 Main St","city":"York","state":"PA","zip":"17401","bsoUserId":"TEST2026","software":{"kind":"in_house"},"preparerCode":"S","contact":{"name":"Pay Support","phone":"7175550101","email":"payroll@example.com"}},"employer":{"ein":"232345678","name":"Susquehanna Machine","street":"212 Main St","city":"York","state":"PA","zip":"17401","kind":"N","employment":"R","contact":{"name":"Pat Baker","phone":"7175550102","email":"Pat.Baker@example.com"}},"employees":[{"ssn":"123456780","firstName":"Dana","lastName":"Wood","street":"1 Maple St","city":"York","state":"PA","zip":"17401-1234","wages":"40321.77","federalTax":"4261.16","socialSecurityWages":"42500","socialSecurityTax":"2635","medicareWages":"42500","medicareTax":"616.25","D":"2178.23","retirementPlan":"1","paWages":"42500","paTax":"1304.75"}],"pennsylvania":{"accountId":"12345678"}}}}}'

Checked against SSA Publication 42-007 Tax year 2026, version 4 (2026-11-12). Reviewed 2026-11-26. All sources

Coverage and standards

Pinned jurisdictions, specification versions, official sources, and verification method from the API registry.

Jurisdictions
Jurisdictions: US
Last reviewed
How output is verified
efw2.generate checks generated files and efw2.validate checks submitted files locally against published fixed-width, sequence, field and total rules.
StandardVersionOfficial source
SSA Publication 42-007

2026-11-12

Tax year 2026, version 4Sourcefor SSA Publication 42-007
Maryland Employer Reporting of W-2s Instructions and Specifications

2026-09-27

Tax year 2026, version 1.0Sourcefor Maryland Employer Reporting of W-2s Instructions and Specifications
Pennsylvania myPATH W-2 Wage Records (EFW2)

2026-11-26

Undated web specification, snapshot 2026-11-26Sourcefor Pennsylvania myPATH W-2 Wage Records (EFW2)
26 CFR § 1.224-1(h), Table 1

2026-04-13

TD 10044Sourcefor 26 CFR § 1.224-1(h), Table 1

Run it on the live API

The sample request is ready to run. Sign in to run it on your $1 of monthly free credit.

$0.15/employee-state

 

Response

Run the request to see the live response here.

Operations, REST and MCP

OperationPrice
efw2.generate

Generate tax-year 2026 SSA EFW2 and optional Maryland MW508 and Pennsylvania myPATH W-2 files from JSON or CSV payroll. Up to 1,000 employees. Price per employee-state, or one employee-state for an employee with federal data only.

$0.15/employee-state
efw2.validate

Check a tax-year 2026 SSA, Maryland or Pennsylvania EFW2 file against the published format and reconcile its count and money totals. Price per employee-state, based on complete fixed-width records with an employee identity.

$0.15/employee-state
curl https://api.kanagu.dev/v1/efw2/generate \
  -H "Authorization: Bearer $KANAGU_KEY" \
  -H "Content-Type: application/json" \
  -d '{"taxYear":2026,"submitter":{"ein":"123456789","name":"Susquehanna Payroll","street":"210 Main St","city":"York","state":"PA","zip":"17401","bsoUserId":"TEST2026","software":{"kind":"in_house"},"preparerCode":"S","contact":{"name":"Pay Support","phone":"7175550101","email":"payroll@example.com"}},"employer":{"ein":"232345678","name":"Susquehanna Machine","street":"212 Main St","city":"York","state":"PA","zip":"17401","kind":"N","employment":"R","contact":{"name":"Pat Baker","phone":"7175550102","email":"Pat.Baker@example.com"}},"employees":[{"ssn":"123456780","firstName":"Dana","lastName":"Wood","street":"1 Maple St","city":"York","state":"PA","zip":"17401-1234","wages":"40321.77","federalTax":"4261.16","socialSecurityWages":"42500","socialSecurityTax":"2635","medicareWages":"42500","medicareTax":"616.25","D":"2178.23","retirementPlan":"1","paWages":"42500","paTax":"1304.75"}],"pennsylvania":{"accountId":"12345678"}}'
const res = await fetch("https://api.kanagu.dev/v1/efw2/generate", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KANAGU_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "taxYear": 2026,
    "submitter": {
      "ein": "123456789",
      "name": "Susquehanna Payroll",
      "street": "210 Main St",
      "city": "York",
      "state": "PA",
      "zip": "17401",
      "bsoUserId": "TEST2026",
      "software": {
        "kind": "in_house"
      },
      "preparerCode": "S",
      "contact": {
        "name": "Pay Support",
        "phone": "7175550101",
        "email": "payroll@example.com"
      }
    },
    "employer": {
      "ein": "232345678",
      "name": "Susquehanna Machine",
      "street": "212 Main St",
      "city": "York",
      "state": "PA",
      "zip": "17401",
      "kind": "N",
      "employment": "R",
      "contact": {
        "name": "Pat Baker",
        "phone": "7175550102",
        "email": "Pat.Baker@example.com"
      }
    },
    "employees": [
      {
        "ssn": "123456780",
        "firstName": "Dana",
        "lastName": "Wood",
        "street": "1 Maple St",
        "city": "York",
        "state": "PA",
        "zip": "17401-1234",
        "wages": "40321.77",
        "federalTax": "4261.16",
        "socialSecurityWages": "42500",
        "socialSecurityTax": "2635",
        "medicareWages": "42500",
        "medicareTax": "616.25",
        "D": "2178.23",
        "retirementPlan": "1",
        "paWages": "42500",
        "paTax": "1304.75"
      }
    ],
    "pennsylvania": {
      "accountId": "12345678"
    }
  }),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const result = await res.json();
claude mcp add --transport http kanagu https://api.kanagu.dev/mcp \
  --header "Authorization: Bearer $KANAGU_KEY"
{
  "mcpServers": {
    "kanagu": {
      "url": "https://api.kanagu.dev/mcp",
      "headers": {
        "Authorization": "Bearer ${env:KANAGU_KEY}"
      }
    }
  }
}
curl https://api.kanagu.dev/mcp \
  -H "Authorization: Bearer $KANAGU_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"call_operation","arguments":{"operation":"efw2.generate","input":{"taxYear":2026,"submitter":{"ein":"123456789","name":"Susquehanna Payroll","street":"210 Main St","city":"York","state":"PA","zip":"17401","bsoUserId":"TEST2026","software":{"kind":"in_house"},"preparerCode":"S","contact":{"name":"Pay Support","phone":"7175550101","email":"payroll@example.com"}},"employer":{"ein":"232345678","name":"Susquehanna Machine","street":"212 Main St","city":"York","state":"PA","zip":"17401","kind":"N","employment":"R","contact":{"name":"Pat Baker","phone":"7175550102","email":"Pat.Baker@example.com"}},"employees":[{"ssn":"123456780","firstName":"Dana","lastName":"Wood","street":"1 Maple St","city":"York","state":"PA","zip":"17401-1234","wages":"40321.77","federalTax":"4261.16","socialSecurityWages":"42500","socialSecurityTax":"2635","medicareWages":"42500","medicareTax":"616.25","D":"2178.23","retirementPlan":"1","paWages":"42500","paTax":"1304.75"}],"pennsylvania":{"accountId":"12345678"}}}}}'

Every request field, response schema, and error code is in the efw2.generate reference.

$0.15/employee-state, billed only on success

$1 of free credit every month after sign-in. Then pay as you go with no base fee, or the $9/month Bundle with $9 of usage included across every Kanagu product. Compare plans

Sign in with GitHub or Google to create a key and spend $1 of free credit each month, no card needed. Subscribe from your dashboard when you need higher volume. Polar is the merchant of record and handles payment, tax, and invoices.

Create an API key

Sign in with GitHub or Google for $1 of monthly free credit, no card needed. Run calls from the console, your code, or an MCP agent.