How to convert e-invoice XML to Excel
You can convert the XML to Excel in two ways to bring it into your accounting software or spreadsheet. We explain both without losing line items or VAT.
SHORT ANSWER
The fastest way to convert an e-invoice XML file to Excel is to upload it to a tool that reads the UBL-TR format. In Entrfy you upload the XML or the e-archive PDF, open a free account and download the Excel file; each field becomes one row on the “Fields” sheet and each line item one row on the “kalemler” sheet. Excel’s own XML import also works, but line items and tax details need manual editing.
- Upload the XML file or the e-archive PDF.
- Check the fields we read and the rule results.
- Download as Excel or CSV.
What is an e-invoice XML file?
A Turkish e-invoice (e-Fatura) is an XML file in the UBL-TR format defined by the Turkish Revenue Administration (GİB). The invoice you see on screen is rendered from this file; if the two differ, the XML prevails. It holds the seller and buyer details, the ETTN (the unique number given to each invoice), the invoice date, and each line’s quantity, unit price, VAT rate and amount in separate fields.
These fields are nested: one invoice can contain many lines (InvoiceLine), and each line can carry several taxes. The real difficulty in moving it to Excel is flattening this nested structure into a table.
Method 1: Excel’s XML import
- In Excel, open Data › Get Data › From File › From XML and select the XML file. Excel for Mac can import XML with Power Query in version 16.69 and later with a Microsoft 365 subscription.
- In the Navigator window, select the Invoice node and click Transform Data; the Power Query editor opens.
- Line items sit nested in the InvoiceLine column. Open it with the expand button in the column header; quantity, unit price and tax fields each need one more level of expansion.
- Change the type of the amount columns to decimal number Using Locale “English (United States)”, then click Close & Load.
Note: This method opens each file separately; to combine several invoices you need a query that loads from a folder. You also have to check the totals by hand.
Method 2: One step with Entrfy
Upload the XML, the e-archive PDF or a photo of a paper invoice; you can select several files at once. We recognise the document type in XML and PDF (for a photo you pick the type when uploading), split the line items and check the totals and VAT. The result is one Excel file: one row per field on the “Fields” sheet, one row per line item on the “kalemler” sheet and each rule’s result on the “Checks” sheet.
Comparing the two methods
| Criterion | Excel’s XML import | Entrfy |
|---|---|---|
| Batch processing | Each file opened separately | Hundreds of files selected at once |
| Line items | Land in a separate table, merged by hand | Ready on the “kalemler” sheet |
| Amount format | May stay as text, converted by hand | Arrives as numbers |
| Checks | None; you check the totals | Totals, VAT, QR code and tax ID checks |
| Photos and PDF | The XML import reads XML only | e-Archive PDF and paper invoice photos |
Common mistakes
- Decimal separator: Amounts in the XML use a dot, as in 1250.50. Excel with Turkish regional settings does not treat this as a number; it leaves it as text or a date, and it is left out of sums.
- Invoices with VAT withholding: Withheld VAT sits in a separate element (
WithholdingTaxTotal) from the calculated VAT. Taking only the calculated VAT shows the wrong payable amount. - Duplicate invoices: The same invoice (same ETTN) can be imported twice; check for repeats by ETTN.
- Line totals: The sum of line amounts minus document-level discounts plus surcharges must equal the invoice’s tax base (
TaxExclusiveAmount). If it does not, one of the lines was not imported.
Frequently asked questions
Can I convert an e-archive PDF to Excel too?
Yes. Since 1 September 2023 every e-archive invoice image carries the QR code required by GİB. We read the invoice from the page, decode the QR code separately and compare the two; any field that does not match goes to review.
Does a photo of a paper invoice work?
Yes. You can upload a phone photo as JPG or PNG. If the photo is too blurry to read, we reject the document and ask you to take it again; a rejected document uses no credit.
Is it free?
Pricing will be announced soon. Opening an account is enough to see the result; no credit card is needed.
Sources
- Turkish Revenue Administration (GİB), UBL-TR guides (e-invoice legislation and guides page)
- Turkish Revenue Administration (GİB), e-Invoice Integration Guide (PDF, Turkish)
- Turkish Revenue Administration (GİB), Electronic Archive Guide (PDF, Turkish)
- Turkish Revenue Administration (GİB), QR Code Standard Guide (PDF, Turkish)
- Microsoft Support, Import data from data sources (Power Query)
- Microsoft Support, Import and shape data in Excel for Mac (Power Query)
- Microsoft Learn, Data types in Power Query
- W3C, XML Schema Part 2: Datatypes, decimal
We build an API that reads Turkish documents. Regulatory facts are based on the Turkish Revenue Administration’s (GİB) guides and legal texts, and we update the article when they change. This article is not tax advice.