Schema Tax

1099-B to CSV: Column Layout for Every Sale

By Schema TaxPublished Updated

To turn a 1099-B to CSV, write one header row that names every lot field, then one row per sale: description, CUSIP, dates acquired and sold, proceeds, cost basis, wash sale loss, term and covered status. Keep dates in one format, amounts as plain numbers, and check the file's totals against the broker's summary page.

Column names for a 1099-B to CSV export

A 1099-B CSV export needs one column for each box that can hold a value for a single sale, plus a few columns that tell rows apart. The header row should use short, fixed names with no spaces, so that code, spreadsheets and import tools read the same field the same way every year.

Start from the form itself. The IRS Instructions for Form 1099-B (2026) define each box a broker fills in for a sale: Box 1a is the description, 1b the date acquired, 1c the date sold, 1d the proceeds, 1e the cost or other basis, 1f accrued market discount and 1g wash sale loss disallowed. Box 2 marks the gain or loss as short term, long term or ordinary. Box 4 holds federal income tax withheld, Box 5 marks a noncovered security, Box 7 marks a loss not allowed based on the amount in 1d, and Box 12 shows whether basis was reported to the IRS. Box 3 has checkboxes for collectibles and for a qualified opportunity fund (QOF).

Those boxes become columns. A CUSIP is the nine-character identifier for a security, and brokers usually print it next to the description even though it has no box number of its own. Add it, because it is the cleanest way to match a lot to a security. Add an account number and a broker name too, so that a file built from several statements stays sortable.

ColumnSource on the formType
brokerStatement headertext
accountAccount numbertext
descriptionBox 1atext
cusipPrinted beside the descriptiontext
date_acquiredBox 1bdate, may be blank
acquired_variousBlank 1b for lots bought on several datestrue or false
date_soldBox 1cdate
proceedsBox 1dnumber
cost_basisBox 1enumber, may be blank
market_discountBox 1fnumber
wash_sale_disallowedBox 1gnumber
termBox 2short, long or ordinary
noncoveredBox 5true or false
basis_reportedBox 12true or false
federal_withheldBox 4number

The CSV below is a sample of three fictional lots. The broker, account and CUSIPs are made up for the example, and the amounts do not describe any real trade.

broker,account,description,cusip,date_acquired,acquired_various,date_sold,proceeds,cost_basis,market_discount,wash_sale_disallowed,term,noncovered,basis_reported,federal_withheld
Example Securities,XXXX5678,"100 SH EXAMPLE CORP",000000AA1,2025-03-14,false,2026-02-09,4210.55,3980.00,0.00,0.00,short,false,true,0.00
Example Securities,XXXX5678,"40 SH SAMPLE INDEX FUND",000000BB2,,true,2026-06-30,6120.00,5544.20,0.00,0.00,long,false,true,0.00
Example Securities,XXXX5678,"25 SH DEMO HOLDINGS INC",000000CC3,2026-05-01,false,2026-08-12,890.40,1102.75,0.00,212.35,short,false,true,0.00

The third row shows a loss of 212.35 that the broker disallowed as a wash sale, so the wash sale column carries that amount. The second row has a blank acquisition date and a true flag, which is how this layout records a lot bought on several dates.

Keep the names stable. If next year's file calls the proceeds column gross_proceeds, every formula and script that reads it breaks. Choosing among CSV, Excel and JSON for the same data is a separate question, covered in the guides to CSV, Excel and JSON output.

How should dates, amounts and Various be written in a 1099-B CSV?

Dates in a 1099-B CSV read most reliably as year, month and day with hyphens, such as 2026-02-09. Amounts should be plain numbers with a decimal point, no dollar sign and no thousands separator. A lot bought on several dates is best recorded as a blank date plus a separate flag column, not as text in the date field.

The date order matters because 02/09/2026 can mean February 9 or 2 September, depending on who or what reads it. A program that guesses the order can swap day and month on every row where both are 12 or less, and nothing in the file shows the error. Year first removes the guess, and it also sorts correctly as plain text.

Amounts follow the same logic. A dollar sign turns a number into text for many tools. A thousands separator is worse in a CSV, because the comma is also the field separator. The informational RFC 4180 description of the CSV format says fields that contain commas, double quotes or line breaks should be enclosed in double quotes, and a double quote inside a field is escaped by doubling it. A value like 4,210.55 written without quotes splits into two columns. Writing 4210.55 avoids the problem.

Losses deserve a decision up front. The form reports proceeds and basis, not gain, so a 1099-B CSV usually has no negative values in those two columns. If you add a computed gain column, write losses with a leading minus sign, such as -212.35. Parentheses are the convention on paper: the 2025 Instructions for Form 8949 say to enter negative amounts in parentheses. In a data file, parentheses turn a number into text, so keep them for the printed form.

"Various" is the case that breaks many files. The 1099-B instructions tell brokers to leave Box 1b blank when the securities were acquired on a variety of dates. The Form 8949 instructions, for their part, allow "VARIOUS" in column (b) for a block of stock bought on different dates. A CSV date column that holds both dates and the word Various is no longer a date column, which is why the sample file keeps the date blank and moves the fact into acquired_various.

Tax software often wants its own layout for these fields. The steps for matching a 1099-B CSV to a software import template cover column order and header names for an upload.

Does Robinhood offer a 1099 CSV download?

Robinhood says it does. Its tax help page for the 2025 tax year says CSV transaction files for all 2025 transactions become available after the consolidated 1099s. That file is a transaction history, which is not the same thing as the official form, so a Robinhood 1099 CSV still needs checking against the PDF.

The same Robinhood "Taxes and forms" help page gives February 17, 2026 as the date tax documents would be ready for the 2025 tax year. It also says the cover page of the consolidated 1099 carries a document ID that can be used to import the forms directly into tax software providers it names, including TurboTax and H&R Block. Robinhood's separate page on how to access your tax documents says the consolidated 1099s are combined into a single PDF, found under Account, Menu and Tax center in the app.

Other brokers differ. Some offer a gain and loss download, some only a PDF, and the file names and columns change from one firm to the next. Check the tax documents area of each account before you plan the work, and expect the columns to differ from the layout above.

When a broker offers only a PDF, the lots have to come off the page. Typing them is fine for five rows and painful for five hundred. Schema Tax reads a 1099-B PDF into named fields per lot, with dates acquired and sold, proceeds, basis and wash sales, and exports the result as CSV; the list of supported forms shows what else it reads. If the 1099-B arrived inside a longer brokerage packet, the workbook layout for a consolidated 1099 shows how to keep the dividend and interest sections apart from the lots.

Whichever route you use, compare the row count and the column totals with the summary page of the official form before you rely on the file.

Why does a broker's realized gain CSV not match the 1099-B?

A realized gain CSV from a broker's website is a report of trades, while the 1099-B is an information return built under IRS rules. They often disagree on proceeds, basis, wash sales and which sales appear at all. When the two differ, the 1099-B is the document the broker filed, so reconcile the CSV to it.

Proceeds are a common source of difference. The 1099-B instructions say gross proceeds must be reduced by commissions and transfer taxes. A trade history may show the price times the shares and list commissions separately, so its proceeds column runs higher.

Wash sales are another. The instructions describe the broker's wash sale reporting for covered securities with the same CUSIP in the same account. A gain report on the website may show losses before any disallowance, or may apply a different rule across accounts. The 1099-B figure in Box 1g is the one the broker reported.

Grouping changes row counts. Robinhood's page on how to access your tax documents says its 1099 forms use an aggregated format based on key tax lot criteria, so one line on the form can stand for several fills that the transaction file lists one by one. The totals should still agree even when the rows do not.

Asset type can move a sale to another form entirely. The 2026 Form 1099-B instructions say that for each digital asset sale a broker effects for a customer in 2026, the broker must complete Form 1099-DA. A trade history that mixes stock and digital asset sales will hold rows that never appear on the 1099-B.

Timing matters too. A website report can be refreshed after the form is issued, and a broker can issue a corrected form later. Note which version of each document you used.

Once the file matches the form, the next step is getting it into tax software. The three routes for a 1099-B import explain broker download, file upload and summary entry. Developers who need the same lot data inside their own systems can read the posts on tax form APIs.

Opening a 1099-B CSV in Excel without mangling CUSIPs and dates

Excel changes some 1099-B CSV values the moment it opens the file. CUSIPs that start with zeros lose them, long digit strings turn into scientific notation, and date-like text is converted using your computer's regional settings. Importing the file with those columns set to Text keeps the values exactly as written.

Microsoft's support article on keeping leading zeros and large numbers in Excel says Excel automatically removes leading zeros and converts large numbers to scientific notation. It also says that digits past the fifteenth are rounded down to zero, which matters for long account numbers stored as numbers.

A CUSIP made only of digits shows the problem clearly. A fictional CUSIP such as 001234567 opens as 1234567, and a lookup against the original value then fails without an error. A CUSIP with letters in it stays text, so the damage is uneven and easy to miss.

The same article gives the import route. On the Data tab, choose From Text/CSV and pick the file, then choose to edit the query instead of loading it straight away. Select the cusip and account columns, set their data type to Text, replace the current type when asked, and then close and load. A refresh of the query reapplies the same steps the next time the file changes.

Dates need the same care. If the file uses year-month-day, Excel usually reads the values as real dates, which you want for sorting and term checks. If the file uses month and day in an order your computer does not expect, set the column to Text first, check a few rows, and convert afterward.

Saving the file back to CSV from Excel can undo the work. A CUSIP that already lost its zeros in the workbook stays short in the saved file. Keep the original CSV untouched and treat the workbook as a working copy.

All posts in 1099-B and Brokerage Statements