To turn a tax form to CSV, extract each box into a named field, write one header row, then one row per box or per form. Quote any field with a comma, such as a payer name, save the file as UTF-8, and keep amounts as plain numbers with two decimals. Check the row count and one total before importing.
What a tax form to CSV export looks like row by row
A tax form to CSV export is a plain text file where the first line names the columns and every later line is one record: either one box from a form or one whole form. Each line has the same number of fields, separated by commas. Any spreadsheet, database or script can read it.
Here is a six-line sample: a header and five data rows taken from two fictional 1099-NEC forms and two fictional 1099-MISC forms. Every name, TIN and amount is an example.
form_type,tax_year,payer_name,payer_tin,recipient_tin,box,field_name,amount
1099-NEC,2026,"Harbor, Lane & Co",XX-XXX4821,XXX-XX-1234,1a,nonemployee_compensation,12500.00
1099-NEC,2026,Sample Design Studio,XX-XXX7710,XXX-XX-1234,1a,nonemployee_compensation,3200.00
1099-NEC,2026,Sample Design Studio,XX-XXX7710,XXX-XX-1234,4,federal_income_tax_withheld,0.00
1099-MISC,2026,Example Property Mgmt,XX-XXX3009,XXX-XX-1234,1,rents,9600.00
1099-MISC,2026,"Example Royalties, Inc.",XX-XXX5562,XXX-XX-1234,2,royalties,415.75
Read it left to right. form_type and tax_year say which form and year the row belongs to. payer_name and payer_tin identify who issued it. recipient_tin is masked to the last four digits. box holds the label printed on the form, field_name holds a fixed name for what that box means, and amount holds the value.
This sample uses one row per box, sometimes called a long layout. It suits mixed stacks of forms, because a new form type only adds rows. The other common choice is one row per form, with a column for each box. The post on the one-row-per-form wide tax layout compares the two in detail.
The masked TINs are deliberate. The IRS Instructions for Forms 1099-MISC and 1099-NEC allow a filer to truncate a recipient's TIN on the statement sent to the recipient, but not a payer's TIN. A CSV built for your own records rarely needs the full number, and leaving it out means one less place a full SSN is stored. Schema Tax, for one, masks SSNs and TINs to the last four digits before storing anything, as its security section states.
The field_name column is what keeps a long CSV readable. Box 1 on a 1099-MISC is rents, while Box 1a on a 1099-NEC is nonemployee compensation, according to the same instructions. Without a named field, a filter on box = 1 mixes values that have nothing to do with each other.
Two quick checks catch most export problems. First, count the data rows and compare them with what you expect: in the sample, four forms produced five rows because one 1099-NEC reported both Box 1a and Box 4. Second, pick one payer and compare its rows with the printed form. If the two Sample Design Studio rows show $3,200.00 for Box 1a and $0.00 for Box 4, just as the form does, that payer's rows are complete. A mismatch usually means a row was split by an unquoted comma or dropped during extraction.
Which tax form fields need quoting in a CSV?
Tax form fields need quoting in a CSV whenever they contain a comma, a double quote or a line break. On tax forms, that mostly means payer names, street addresses and property descriptions. Wrap the whole field in double quotes and the comma stays inside one column instead of splitting it into two.
The rule comes from the CSV format description in RFC 4180: fields containing line breaks, double quotes and commas should be enclosed in double quotes. In the sample above, "Harbor, Lane & Co" is quoted because of its comma. Without the quotes, a reader sees Harbor in the payer column and Lane & Co in the TIN column, and every field after it shifts one place right.
Double quotes inside a name need one more step. RFC 4180 says a double quote inside a quoted field is escaped by doubling it. A fictional payer called The "Blue" Fund, LLC is written as "The ""Blue"" Fund, LLC". A reader that follows RFC 4180 turns each doubled pair back into one quote.
Addresses deserve care. A payer address printed on two lines on the form can carry a line break into the extracted text. Either quote the field so the break stays inside it, or replace the break with a comma and space before writing the CSV. Splitting an address into street, city, state and ZIP columns avoids the issue and makes the data easier to sort.
Spaces count as data. RFC 4180 says spaces are part of a field and should not be ignored, so Sample Design Studio and Sample Design Studio with a trailing space are two different payers to a strict reader. Trim names before writing them.
Amounts should not need quotes. Write them without a dollar sign and without a thousands comma: 12500.00, not $12,500.00. A thousands comma inside an unquoted amount is the most common way a tax CSV ends up with an extra column.
Tax form CSV encoding and delimiters
Tax form CSV encoding decides whether names with accents or symbols survive the trip into a spreadsheet. Save the file as UTF-8, and add a byte order mark when the main reader is Excel. The delimiter decides how fields are split: commas in most places, semicolons where the region uses a comma as the decimal mark.
The CSV format description in RFC 4180 treats US-ASCII as the common case and lets a file declare another character set through a charset parameter. In practice, payer names such as "Peña Consulting" or "Société Example" need more than ASCII, and UTF-8 is the usual choice.
Excel has its own expectation. Microsoft's page on opening CSV UTF-8 files correctly in Excel says a UTF-8 CSV opens normally if it was saved with a byte order mark (BOM). A BOM is a short invisible marker at the very start of the file that tells the reader which encoding follows. Without it, the same page points to Get Data, From Text/CSV as the way to open the file.
A worked example shows the risk. A fictional 1099-MISC from "Peña Consulting" is saved as UTF-8 with no BOM. Microsoft only promises a normal open when the BOM is there, so a double-click on this file may show the name with stray symbols where the ñ was. The amount is still right, but the payer name no longer matches your records, and a lookup on it fails. Saving with a BOM, or importing through From Text/CSV and choosing UTF-8, gives the correct name.
Delimiters depend on the region. Microsoft's guide to importing and exporting text or CSV files says the default separator is a comma, that the Windows list separator setting controls it, and that with a comma as the decimal separator Excel uses a semicolon instead. A comma-separated tax file opened on such a machine can land entirely in column A.
The fix on the reading side is an import, not a double-click. Data, From Text/CSV lets you pick the delimiter and see a preview before loading. Leading zeros in ZIP codes and account numbers are a related problem; the post on why Excel strips leading zeros from a CSV covers it.
How do repeating boxes fit in a flat tax form CSV?
Repeating boxes fit in a flat tax form CSV in one of two ways: as extra rows, one per entry, or as numbered columns, one set per slot. Extra rows work for any count. Numbered columns work only when the form sets a maximum and you are sure every entry fits.
Several common forms repeat. The IRS General Instructions for Forms W-2 and W-3 say Copy A of a W-2 holds up to four Box 12 entries, each a code with an amount, and that boxes 15 through 20 cover two states and two localities. The 1099 instructions allow state figures for up to two states on a 1099-NEC or a 1099-MISC.
In a long CSV like the sample, each repeat is simply another row. A W-2 with Box 12 codes D and DD becomes two rows, with box set to 12a and 12b and the code kept in its own column:
form_type,tax_year,payer_name,box,code,field_name,amount
W-2,2026,Example Bakery Inc,12a,D,box_12_elective_deferrals_401k,3000.00
W-2,2026,Example Bakery Inc,12b,DD,box_12_employer_health_coverage,6840.00
In a wide CSV with one row per form, the same data needs columns such as box_12a_code, box_12a_amount, box_12b_code and so on to box_12d_amount. Most rows leave most of them empty. The layout is easy to read but fragile: an employer that issues a second W-2 for a fifth code produces a second row, and a reader adding up "one row per form" counts the employer twice.
State lines follow the same pattern. A long CSV writes one row per state per box. A wide CSV needs state_1_* and state_2_* column sets. Whichever you pick, keep the code and its amount on the same row, because a code without its amount is meaningless.
Keep a form_id column when forms repeat. It ties every row back to one source document, so two W-2s from the same employer stay separate even when every other column matches.
When a tax form CSV drops too much detail
A tax form CSV drops too much detail when the document has records inside records, when the reader needs types the file cannot carry, or when one file must hold several tables. In those cases JSON or an Excel workbook keeps what the CSV would lose, and you can still produce a CSV from either later.
A consolidated brokerage statement is the usual example. It can carry a 1099-B with dozens of sales, a 1099-DIV and a 1099-INT in one PDF. A single CSV either repeats the broker's details on every sale or splits the statement into several files that have to be kept together. For that kind of document, tax form JSON with nested fields holds the parent and its children in one record.
Types are the second gap. A CSV cannot say whether a field is a number, a date or text, and it cannot tell an empty box from a zero. If code downstream treats blank as zero, a box that was never filled in looks like a box that reported nothing. JSON can store null for the first and 0 for the second.
Multiple tables are the third. A year summary with totals by payer, plus the detail behind it, needs two CSV files or one workbook. A workbook keeps them together with formulas that update.
None of this makes CSV the wrong default for simple forms. A stack of 1099-NECs, each with a handful of boxes, fits a CSV well, and the 1099 forms category covers those forms box by box. The comparison of when CSV is the right format for tax data sets out the trade-offs side by side.
Scanned paper forms add a step before any of this. The scan has to be read and checked first; the guide to getting a scanned tax form into Excel covers that part. Schema Tax exports CSV on every plan, including the free one, which is enough to test a real form before you build anything around the file.