GnuCash to QIF and IIF
Converts GnuCash XML files into QIF and IIF
This Java program converts a GnuCash XML file into either a QIF file or a QuickBooks IIF file. Go directly to the source Java files. It's in the Public Domain, so you can do whatever you want with it, though the compiled distributions contain licensed libraries (Apache Software License and GNU LGPL). GnuCashToQIF was written by Steven Lawrance.

I wrote this program to help with my desktop migration from Linux to Mac OS X, but it can also be used for other conversion paths and to programs other than Quicken or QuickBooks.
To use GnuCashToQIF, download and launch the latest JAR file and read through the instructions. You will need Java 8 (1.8) or higher to run this program.

All versions may be found in the download folder. This folder is WebDAV-enabled for convenience.

The source code exists in Subversion at https://gnucashtoqif.us/svn .

Intuit, Quicken, and QuickBooks are registered trademarks of Intuit Inc.
GnuCashToQIF and this web site are not affiliated with, maintained, authorized, endorsed, or sponsored by Intuit Inc.
  1. Prerequisites
    1. Software Compatibility
    2. GnuCash File Format
    3. Licensed Components
  2. Target Use Cases
  3. Running
    1. Graphical User Interface
      1. JAR File
    2. Command Line
      1. Options
      2. Source
      3. Output
      4. Examples
  4. Conversion Detail
    1. Converted Account Types
    2. Memo Extraction from Transaction Descriptions
    3. Unused Account Ignoring
    4. Income and Expense Account Handling
    5. Cleared Transaction Handling

Prerequisites

Software Compatibility

The newest release of GnuCashToQIF requires Java 8 (1.8) or higher. Earlier versions of Java are obsolete and are no longer supported by Oracle.

The older releases 1.3 to 1.6 require Java 5 (1.5) or newer. The releases before that may work on Java 1.2 or newer.

The QIF output from GnuCashToQIF should import properly into Quicken 2005 and newer. The IIF output from GnuCashToQIF should import properly into QuickBooks versions that support the import of IIF files.

GnuCash File Format

Because this program works with GnuCash XML files, either compressed or uncompressed, you must have saved it at least once with an XML-capable version of GnuCash, which covers all versions above and including 1.6.0. Files saved by GnuCash 1.4.x and below are not supported, though it's easy to convert it to XML by opening it up using 1.6.0 or above and then saving it. I'm not sure if 1.5.x's files are XML and/or compatible with GnuCashToQIF, but if it is not, then the procedure for making it compatible with GnuCashToQIF is the same as it is for 1.4.x and below files.

As of version 1.7 of GnuCashToQIF, compressed and uncompressed GnuCash files are supported. In earlier versions of GnuCashToQIF, only uncompressed GnuCash files were supported.

Licensed Components

This product includes software developed by the Apache Software Foundation (http://www.apache.org/). The GnuCashToQIF Jar file includes Apache Xerces 1.4.4, which is licensed under the Apache Software License 1.1.

The bundled GNU Getopt library is licensed under the GNU Library General Public License, version 2.

Target Use Cases

The current version is geared towards GnuCash files that are set up for personal finance where you have bank accounts and credit cards to store your money along with income and expense accounts for spending/income allocations. QIF accounts get created for asset accounts while the other accounts turn into Categories. Other scenarios may require modification to the source code and/or your GnuCash account configurations before running. See the section on converted account types for more information.

Running

Graphical User Interface

JAR File

For Linux, Solaris, Windows, OS X, and other Java-capable Systems
  1. Download the JAR file.
  2. Double-click on the JAR file and then skip to step 6. If nothing happens, then open up a Terminal window.

  3. Go to the folder that contains the download JAR file with the cd command.

  4. Ensure that java is in your $PATH (or %PATH% for Windows). Most likely, it is, but if the next step says that it cannot find java, then ensure that your PATH environment variable contains Java. At this time, I don't have instructions for how to do this, but a Google search on that subject should give you insight for your operating system (even Windows has completely different ways to do it depending on the revision (95/98/ME vs. NT vs. 2000 vs. XP)). Mac OS X users don't need to worry about this step.

  5. Type java -jar GnuCashToQIF-1.7.jar into the Terminal window and press Enter.

  6. When asked, select the source GnuCash file. Press Open.
    Select the GnuCash file to convert

  7. The next window asks for the destination QIF or IIF file. By default, the name of the GnuCash file is used but with a .qif extension. If you do not want GnuCashToQIF to not convert unused accounts, then uncheck "ignore unused accounts." If you do not want to extract the QIF transaction memos from the GnuCash transaction descriptions, then uncheck "extract memos from descriptions." If you are exporting to an IIF file, then you might need to manually change the file extension to iif. Press Save once you are satisfied with the location and name of the output QIF or IIF file.
    Select the destination folder for QIFs
  8. GnuCashToQIF will now convert the input GnuCash file into a QIF or IIF file. At this time, no progress bar or other indication of activity comes up during this process.

  9. When the conversion process is complete, GnuCashToQIF will let you know. Press OK.
    GnuCashToQIF complete
  10. Launch Quicken or QuickBooks.

  11. Quicken: In the File menu, choose "Import QIF..." to bring up a file chooser. Choose the QIF file press Open. If all goes well, all the accounts, transactions, and categories should import into Quicken properly.

  12. Verify your balances and reconciliation statuses.

  13. (Optional) E-mail me about how it went, or if you came across any bugs or problems. My address is gnucashtoqif2@moonlightdesign.org. I don't check that e-mail box every day, so responses might occur after a few days.

Command Line

GnuCashToQIF has a command line interface to permit scripted conversions. Since version 1.4, GnuCashToQIF exposes the new behavior options that were introduced in the graphical user interface. Version 1.4 also permits users to specify a hyphen as a filename to indicate stdin and/or stdout for easier piping.

To bring up the help page, run:
java -jar GnuCashToQIF-1.7.jar --help

The general form of this interface is the following:
java -jar GnuCashToQIF-1.7.jar [options] [source [output]]

Options

Option Description Values Default
--extract-memos Extract memos from the descriptions. yes
no
yes
--ignore-unused Ignore unused accounts and categories, leaving them out of the output QIF. yes
no
yes
--output-format Set the output file compatibility format. 2003
2004
2004

Source

The source GnuCash file name or - for stdin

Output

The destination GnuCash file name or - for stdout

Examples

Use the GUI, but disable memo extraction by default:
java -jar GnuCashToQIF-1.7.jar --extract-memos=no

Use the GUI, but disable memo extraction and unused account ignoring by default:
java -jar GnuCashToQIF-1.7.jar --extract-memos=no --ignore-unused=no

Use the GUI, but set the input file and Quicken <= 2003 file format:
java -jar GnuCashToQIF-1.7.jar --output-format=2003 my.gnucash

Read a GnuCash file and output the QIF file in the 2004 format to stdout:
java -jar GnuCashToQIF-1.7.jar --output-format=2004 my.gnucash -

Read a GnuCash file and output the QIF file in the IIF format to stdout:
java -jar GnuCashToQIF-1.7.jar --output-format=iif my.gnucash -

Read a GnuCash file from stdin and write to stdout:
java -jar GnuCashToQIF-1.7.jar - -

Conversion Detail

Converted Account Types

Here are the GnuCash account types supported by GnuCashToQIF. All other account types are turned into QIF Categories.
GnuCash Account
QIF Mapping
Accounts Payable Bank Account *
Accounts Receivable Bank Account *
Asset
Asset Account
Bank
Bank Account
Cash
Cash Account
Credit Card
Credit Card Account
Currency
Cash Account
Equity General Catagory Type
Expense
Expense Category Type
Income
Income Category Type
Liability Bank Account *
Mutual Fund
Bank Account *
Stock
Bank Account *

* I have not yet had time to implement better mappings for Accounts Payable, Accounts Receivable, Liability, Mutual Fund, and Stock. Please feel free to add better support for these GnuCash account types if you need them to map cleanly to QIF (the transactions, amounts, and dates are properly imported, but the account metadata such as stock ticker symbol and such are not). Otherwise, it's always possible to fix the account types once they're in Quicken or whatever program you are importing into.

Release 1.2.1 added mappings for more GnuCash account types. Previous versions of GnuCashToQIF converted these new mappings into categories. If all of your asset accounts were Asset and Cash, as an example, versions 1.2 and below processed them as categories and, as a result, wrote out no accounts nor any transactions into the QIF file. While 1.2.1 addresses the extra account types that were previously not mapped, other account types may come up in the future. If one or more of your accounts are not showing up in Quicken after you import the QIF, try changing that account's type to Bank inside of GnuCash and then convert the file again in GnuCashToQIF.

Memo Extraction from Transaction Descriptions

As an optimization for users like me, who did not know that GnuCash had memo fields in transactions, descriptions are split into Payee/Description and Memo using "at," "from," and "via" as the delimiters if those delimiters exist in a transaction's description. You can disable this behavior when setting the destination file. The first letter of the payee is capitalized in the extraction process. Note that, since version 1.5, real GnuCash transaction split memos are always used if they exist. Memo extraction from the transaction descriptions only happens when a GnuCash transaction split memo does not exist.

Examples:
"Coffee at Daily Perk" in GnuCash will convert as "Daily Perk" as the payee and "Coffee" as the memo.
"Boxes from the Containment Store" in GnuCash will convert as "The Containment Store" as the payee and "Boxes" as the memo.

Memos in GnuCash transaction splits are properly converted to QIF since version 1.5; previously, GnuCash memos were ignored.

Unused Account Ignoring

By default, accounts in your GnuCash file that have no transactions will not carry over into the output QIF file. If you want to convert all GnuCash accounts into QIF accounts and categories, then either uncheck the "ignore unused accounts" checkbox when asked for the destination QIF file name or pass --ignore-unused=no as a command line option.

Note that if you want to use the graphical user interface but want this option disabled by default, you can run GnuCashToQIF on the command line or in a shell script or batch file as java -jar GnuCashToQIF-1.7.jar --ignore-unused=no

Income and Expense Account Handling

The double-entry income and expense accounts are converted into QIF Categories while transfers between bank and credit card accounts remain intact as transfers, assuming the account names remain consistent during the QIF Import.

Cleared Transaction Handling

Cleared transactions carry through as Cleared in the QIF file while outstanding transactions remain outstanding. This used to not work in version 1.1, but it should now work in 1.2 and above. Please let me know if it does not. Special thanks go to Dan Poirier for sending in the patch that fixes this and adds subcategory support.