Converting PDF Invoices to XRechnung – Why I Built pdftoxrechnung.de
Since the start of 2025, electronic invoicing using XRechnung has become mandatory for B2B transactions in Germany. While that’s a step forward in terms of standardization and digitalization, the reality is that a lot of businesses still work with traditional PDF invoices — and converting those into a valid UBL XRechnung format isn't exactly trivial.
I ran into this myself when trying to generate compliant XRechnungen from existing PDFs. So I built pdftoxrechnung.de — a small web app that helps with exactly that.
Here’s how it works:
Step 1: Upload and Extract
You start by uploading a PDF invoice. The app parses the document and tries to extract all relevant invoice data into a structured format. It looks for things like:
- Seller and buyer info
- Invoice date, number, and line items
- Totals, VAT, payment terms, etc.
The extraction is based on a mix between layout analysis and LLM processing - it works pretty well for most standard invoice layouts, but of course it's not perfect.
Step 2: Validate and Fix
After extraction, you’re taken to a review screen where you can manually go through all the data that was pulled out of the PDF. If anything’s off or missing, you can correct it directly in the browser.
I added this step because fully automating invoice parsing is hard — there’s just too much variation in formats. Giving users the ability to quickly tweak the extracted data makes the whole thing a lot more reliable in practice.
You can also go back to the previous step anytime if something doesn’t look right.
Step 3: Generate and Validate the XRechnung
Once the data looks good, you can generate the XRechnung file (in UBL XML format). Behind the scenes, this maps your input to the official schema and builds a valid XRechnung document.
To make sure everything’s actually compliant, the app then runs the generated file through the KoSIT validator v1.5.0 — the same tool used by many institutions to check XRechnung validity.
If the validation passes, you can download the XRechnung and use it right away. If not, you’ll see the error messages and can go back and fix the relevant data.
A Few Notes
- The app runs entirely in the browser — no invoice data is saved on the server.
- It's meant to help small teams or individuals who don’t have a full invoicing system that supports XRechnung yet.
- It’s still evolving — I plan to add better OCR support and possibly support for more invoice formats (e.g. Factur-X) in the future.
If you’re a German business and want to deal with the XRechnung requirement, give it a try:
I’d love feedback, bug reports, or feature suggestions on GitHub. Feel free to reach out.