File format reference

OFX file: what it is, a sample, and how to read one

The Open Financial Exchange format, read line by line: the header, the transaction record, and why a file that looks fine can still fail to import.

Short answer

An OFX file is a plain-text file in the Open Financial Exchange format. It holds account details, a balance and a list of dated, signed transactions that accounting and personal-finance programs can import instead of retyping. Version 1.x writes its tags in SGML style; version 2.x is well-formed XML.

What is inside an OFX file

An OFX file is a block of tagged text. Related tags are grouped in aggregates: an opening tag, the elements it holds, and a closing tag. For a bank account the path is a sign-on response (SIGNONMSGSRSV1), then the banking messages (BANKMSGSRSV1) holding one statement response (STMTRS). That statement carries the currency (CURDEF), the account (BANKACCTFROM), the transactions (BANKTRANLIST, a start date, an end date and any number of STMTTRN records) and the ledger balance (LEDGERBAL).

Credit-card accounts use a parallel statement response (CCSTMTRS), and investment accounts useINVSTMTRS, whose records include stock buys and sells (BUYSTOCK,SELLSTOCK). This page follows the bank statement because it is the simplest complete example.

An annotated sample

This file is synthetic: the bank and account numbers are zeros and the payee is invented. The highlighted lines are one transaction. The table under it explains each field.

<?xml version="1.0" encoding="UTF-8" standalone="no"?><?OFX OFXHEADER="200" VERSION="220" SECURITY="NONE" OLDFILEUID="NONE" NEWFILEUID="NONE"?><OFX>  <SIGNONMSGSRSV1>    <SONRS>      <STATUS>        <CODE>0</CODE>        <SEVERITY>INFO</SEVERITY>      </STATUS>      <DTSERVER>20261015120000</DTSERVER>      <LANGUAGE>ENG</LANGUAGE>    </SONRS>  </SIGNONMSGSRSV1>  <BANKMSGSRSV1>    <STMTTRNRS>      <TRNUID>0</TRNUID>      <STATUS>        <CODE>0</CODE>        <SEVERITY>INFO</SEVERITY>      </STATUS>      <STMTRS>        <CURDEF>USD</CURDEF>        <BANKACCTFROM>          <BANKID>000000000</BANKID>          <ACCTID>0000000001</ACCTID>          <ACCTTYPE>CHECKING</ACCTTYPE>        </BANKACCTFROM>        <BANKTRANLIST>          <DTSTART>20261001</DTSTART>          <DTEND>20261015</DTEND>          <STMTTRN>            <TRNTYPE>DEBIT</TRNTYPE>            <DTPOSTED>20261008</DTPOSTED>            <TRNAMT>-12.50</TRNAMT>            <FITID>SAMPLE0001</FITID>            <NAME>EXAMPLE COFFEE</NAME>            <MEMO>Synthetic sample row</MEMO>          </STMTTRN>        </BANKTRANLIST>        <LEDGERBAL>          <BALAMT>1000.00</BALAMT>          <DTASOF>20261015</DTASOF>        </LEDGERBAL>      </STMTRS>    </STMTTRNRS>  </BANKMSGSRSV1></OFX>
Synthetic OFX 2.x bank statement with one transaction (highlighted)
The six fields of the highlighted record
TagIn the sampleMeaningFormat
TRNTYPEDEBITKind of transaction. It does not change the balance effect; the sign of TRNAMT does.One value from a fixed list (CREDIT, DEBIT, INT, DIV, FEE, SRVCHG, DEP, ATM and others)
DTPOSTED20261008Date the transaction was posted to the account.YYYYMMDD, optionally followed by HHMMSS.XXX and [offset:zone]. A bare date means the start of that day, GMT
TRNAMT-12.50Amount, signed by how the account is affected: a debit is negative.Decimal point or comma, optional sign, no thousands separators, up to 32 characters
FITIDSAMPLE0001Transaction ID issued by the financial institution. Programs use it to detect transactions they already have.Text identifier
NAMEEXAMPLE COFFEEPayee or short description.Up to 32 characters (EXTDNAME allows 100)
MEMOSynthetic sample rowExtra information that is not in NAME.Free text

Amounts are signed from the point of view of the account: a DEBIT carries a negativeTRNAMT, and for a credit-card account a purchase is negative and a payment positive.

Version 1.x and version 2.x

The format has two syntaxes. Versions 1.0 to 1.6 are SGML-based; version 2.0 moved to XML. The specification says the message content carried over and was extended; what changed is how it is written. The current specification (2.3, dated 16 October 2020) says a 1.0.2 sender need not write end tags for simple elements, while 2.x requires them on every element.

OFX 1.x compared with 2.x
Aspect1.x (SGML)2.x (XML)
SyntaxSGML-based (versions 1.0 to 1.6)XML (2.0 onward)
File headerPlain KEY:VALUE lines such as OFXHEADER:100, DATA:OFXSGML, VERSION:102An XML declaration, then a <?OFX OFXHEADER="200" VERSION="220" ...?> instruction
End tagsParsers must accept them, but senders need not write them for simple elements (see the 1.x sample)Required on every element, so the file is well-formed XML
EncodingStated in the header lines ENCODING and CHARSETStated in the XML declaration
Line endingsThe 2.3 specification notes that 1.0.2 clients mixed LF and CRLFStandard XML 1.0 handling

The same transaction in the 1.x style. Note the missing end tags on simple elements such as TRNAMT:

OFXHEADER:100DATA:OFXSGMLVERSION:102SECURITY:NONEENCODING:USASCIICHARSET:1252COMPRESSION:NONEOLDFILEUID:NONENEWFILEUID:NONE <OFX><SIGNONMSGSRSV1><SONRS><STATUS><CODE>0<SEVERITY>INFO</STATUS><DTSERVER>20261015120000<LANGUAGE>ENG</SONRS></SIGNONMSGSRSV1><BANKMSGSRSV1><STMTTRNRS><TRNUID>0<STATUS><CODE>0<SEVERITY>INFO</STATUS><STMTRS><CURDEF>USD<BANKACCTFROM><BANKID>000000000<ACCTID>0000000001<ACCTTYPE>CHECKING</BANKACCTFROM><BANKTRANLIST><DTSTART>20261001<DTEND>20261015<STMTTRN><TRNTYPE>DEBIT<DTPOSTED>20261008<TRNAMT>-12.50<FITID>SAMPLE0001<NAME>EXAMPLE COFFEE<MEMO>Synthetic sample row</STMTTRN></BANKTRANLIST><LEDGERBAL><BALAMT>1000.00<DTASOF>20261015</LEDGERBAL></STMTRS></STMTTRNRS></BANKMSGSRSV1></OFX>
The same synthetic statement written in the OFX 1.x style

To tell which you have, open the first lines. Lines such as OFXHEADER:100 mean 1.x; an<?xml line followed by <?OFX OFXHEADER="200" means 2.x. In 1.x files a blank line usually separates the header from <OFX>. The 2.x specification does not define that line, and readers such as ofxtools accept any whitespace there, so its absence is rarely the cause of an import problem.

Who uses OFX files

People who move bank or card transactions into personal-finance or accounting software without retyping them. Banks that offer an OFX download let you save the file and import it. Intuit's products use two related variants: Intuit describes .qbo as the QuickBooks file and .qfx as the Quicken file that its Web Connect imports use. Whether your bank offers the download, and in which version, varies by bank and country.

How to open or inspect one

  • Read it as text. An OFX file is plain text, so any text editor shows it. A 2.x file is also well-formed XML, so an XML viewer will validate it.
  • Check the version from the first lines, as above.
  • Import it into your software with its OFX or bank-file import. The menu names differ between programs, so this page does not name them.
  • Do an arithmetic check. Add every TRNAMT in the file. If the file holds the whole period and no pending items, the total should equal the ledger balance minus the balance you had before the first transaction (take that from your own records).

Common errors

  • A 1.x file given to an XML parser. Simple elements have no end tags, so a strict XML parser stops at the first one. Use a parser that accepts both, or convert the file.
  • Flipped signs. Statement transactions are signed by effect on the account. A tool that assumes "positive means spent" will reverse every row.
  • Shifted dates. A bare YYYYMMDD means the start of the day in GMT. Software that converts to local time can show it as the previous day in the Americas. Times with an offset, such as20261008120000[-5:EST], avoid the ambiguity.
  • Thousands separators. The specification says amounts must not contain punctuation separating thousands. 1,250.00 may be read as 1.25 by software that accepts a comma as the decimal mark.
  • Reused or changed FITID values. The specification says the ID uniquely identifies a transaction within an account and exists so a client can detect duplicate downloads. Two different transactions sharing an ID in one account can therefore be treated as duplicates, and a changed ID can bring a transaction in twice. What a program does with a duplicate is up to the program.
  • Wrong character set. If the header names one encoding and the bytes use another, accented letters in NAME and MEMO come out garbled.
  • Pending items. Pending transactions use a different record (STMTTRNP) that has noFITID. The specification says they should not be stored or used to reconcile the ledger balance.

Common questions

Is an OFX file XML?
Version 2.x is. Version 1.x is SGML-style: the tags look like XML but simple elements have no end tags, so a strict XML parser rejects it.
Is OFX the same as QFX or QBO?
No. .qbo (QuickBooks) and .qfx (Quicken) are the file types Intuit's Web Connect uses, and Intuit's help says the QuickBooks Web Connect import reads only .qbo files. Do not expect a plain .ofx file to import there.
Can OFX hold stock trades?
Yes. The specification defines investment statements with records for buying and selling stock, positions and balances. Whether your broker exports them as OFX is up to the broker.

What Statementizer does with this

Statementizer turns supported broker statement PDFs into rows you can review, then exports them as a spreadsheet or as an OFX file, among other formats.

See what Statementizer converts

Sources

Field meanings, formats, the header mapping, the FITID rule and the 1.x to 2.x differences come from the specification. The QBO and QFX statements come from Intuit's own pages. The ofxtools library is cited only for how real parsers read the 1.x header. The encyclopedia entry is context for the version history.

Verified on 2026-10-16 by the Statementizer Team. The specification is published by Financial Data Exchange.