Skip to content

Features

Overview of KSeF Guard offline pre-submission validation capabilities

XSD Validation

Structural XML verification against the official FA(3) schema from the Ministry of Finance. Powered by libxml2 — an industry-standard XML validation engine. Precise error messages with exact locations in your XML.

FA_2026_03_0001.xml
Valid
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?xml version="1.0" encoding="UTF-8"?>
<Faktura xmlns="http://crd.gov.pl..." xmlns:etd="http://crd.gov.pl..." xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org...">
<Naglowek>
<KodFormularza kodSystemowy="FA (3)" wersjaSchemy="1-0E">FA</KodFormularza>
<WariantFormularza>3</WariantFormularza>
<DataWytworzeniaFa>2026-03-10T09:00:00Z</DataWytworzeniaFa>
<SystemInfo>KSeF Guard Showcase</SystemInfo>
</Naglowek>
<Podmiot1>
<DaneIdentyfikacyjne><NIP>1111111111</NIP><Nazwa>ACME Sp. z o.o.</Nazwa></DaneIdentyfikacyjne>
<Adres><KodKraju>PL</KodKraju><AdresL1>ul. Marszalkowska 1, Warszawa</AdresL1></Adres>
</Podmiot1>
<Podmiot2>
<DaneIdentyfikacyjne>
<NIP>2222222222</NIP>
<Nazwa>XYZ Trading Sp. z o.o.</Nazwa>
</DaneIdentyfikacyjne>
<Adres><KodKraju>PL</KodKraju><AdresL1>ul. Poznanska 10, Poznan</AdresL1></Adres>
<JST>2</JST><GV>2</GV>
</Podmiot2>
<Fa>
<KodWaluty>PLN</KodWaluty>
<P_1>2026-03-10</P_1>
<P_2>FV/2026/03/0001</P_2>
<P_13_1>1000.00</P_13_1><P_14_1>230.00</P_14_1>
<P_15>1230.00</P_15>
<Adnotacje>
<P_16>2</P_16><P_17>2</P_17><P_18>2</P_18><P_18A>2</P_18A>
<Zwolnienie><P_19N>1</P_19N></Zwolnienie>
<NoweSrodkiTransportu><P_22N>1</P_22N></NoweSrodkiTransportu>
<P_23>2</P_23>
<PMarzy><P_PMarzyN>1</P_PMarzyN></PMarzy>
</Adnotacje>
<RodzajFaktury>VAT</RodzajFaktury>
<FaWiersz>
<NrWierszaFa>1</NrWierszaFa><P_7>Uslugi konsultingowe IT</P_7>
<P_8A>godz</P_8A><P_8B>10.00</P_8B><P_9A>100.00</P_9A><P_9B>123.00</P_9B>
<P_11>1000.00</P_11><P_11A>1230.00</P_11A><P_11Vat>230.00</P_11Vat><P_12>23</P_12>
</FaWiersz>
</Fa>
</Faktura>
FA_2026_03_0156.xml
XSD Error
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?xml version="1.0" encoding="UTF-8"?>
<Faktura xmlns:etd="http://crd.gov.pl..." xmlns:xsi="http://www.w3.org..."
xmlns="http://crd.gov.pl...">
<Naglowek>
<KodFormularza kodSystemowy="FA (3)" wersjaSchemy="1-0E">FA</KodFormularza>
<WariantFormularza>3</WariantFormularza>
<DataWytworzeniaFa>2026-03-18T15:30:00Z</DataWytworzeniaFa>
<SystemInfo>KSeF Guard Showcase</SystemInfo>
</Naglowek>
<Podmiot1>
<DaneIdentyfikacyjne>
<NIP>999-999-99-99</NIP>
Fix: NIP must be exactly 10 digits without dashes — e.g. 9999999999
<Nazwa>TechStar Sp. z o.o.</Nazwa>
</DaneIdentyfikacyjne>
<Adres>
<KodKraju>PL</KodKraju>
<AdresL1>ul. Wspolna 30, Wroclaw</AdresL1>
</Adres>
</Podmiot1>
<Podmiot2>
<DaneIdentyfikacyjne>
<NIP>1111111111</NIP>
<Nazwa>DataCenter Sp. z o.o.</Nazwa>
</DaneIdentyfikacyjne>
<Adres>
<KodKraju>PL</KodKraju>
<AdresL1>ul. Serwerowa 5, Poznan</AdresL1>
</Adres>
<JST>2</JST>
<GV>2</GV>
</Podmiot2>
<Fa>
<KodWaluty>PLN</KodWaluty>
<P_1>2026-03-18</P_1>
<P_2>FV/2026/03/0156</P_2>
<P_13_1>1666.66</P_13_1>
<P_14_1>383.33</P_14_1>
<P_13_3>0.95</P_13_3>
<P_14_3>0.05</P_14_3>
<P_15>2051.00</P_15>
<Adnotacje>
<P_16>2</P_16>
<P_17>2</P_17>
<P_18>2</P_18>
<P_18A>2</P_18A>
<Zwolnienie>
<P_19N>1</P_19N>
</Zwolnienie>
<NoweSrodkiTransportu>
<P_22N>1</P_22N>
</NoweSrodkiTransportu>
<P_23>2</P_23>
<PMarzy>
<P_PMarzyN>1</P_PMarzyN>
</PMarzy>
</Adnotacje>
<RodzajFaktury>VAT</RodzajFaktury>
<FP>1</FP>
<FaWiersz>
<NrWierszaFa>1</NrWierszaFa>
<P_7>Serwery i osprzet sieciowy</P_7>
<P_8A>szt</P_8A>
<P_8B>1</P_8B>
<P_9A>1626.01</P_9A>
<P_11>1626.01</P_11>
<P_12>23</P_12>
</FaWiersz>
<FaWiersz>
<NrWierszaFa>2</NrWierszaFa>
<P_7>Konfiguracja i wniesienie sprzetu</P_7>
<P_8A>szt</P_8A>
<P_8B>1</P_8B>
<P_9A>40.65</P_9A>
<P_11>40.65</P_11>
<P_12>23</P_12>
</FaWiersz>
<FaWiersz>
<NrWierszaFa>3</NrWierszaFa>
<P_7>Kabel sieciowy promocyjny</P_7>
<P_8A>szt</P_8A>
<P_8B>1</P_8B>
<P_9A>0.95</P_9A>
<P_11>0.95</P_11>
<P_12>5</P_12>
</FaWiersz>
<Platnosc>
<Zaplacono>1</Zaplacono>
<DataZaplaty>2026-03-17</DataZaplaty>
<FormaPlatnosci>6</FormaPlatnosci>
</Platnosc>
</Fa>
</Faktura>
PASS FA_2026_03_0001.xml FAIL FA_2026_03_0156.xml
XSD Error Line 14: NIP pattern violation — expected [0-9]{10}, got 999-999-99-99
XSD: schema FA(3) 1-0E • 128 rules • libxml2

128 Validation Rules

Substantive rules based on Art. 106e of the VAT Act, Ministry of Finance regulations, and the official FA(3) information brochure. 71 government-mandated, the rest best-practice, heuristic, security, batch, and inferred. Every rule includes bilingual problem/fix descriptions and SHA-256 verified source quotes.

Rule Explorer 128 rules
Search rules...
Rule ID
Description
Classification
KSeF Gov Enforced
Severity
KSEF-BUS-003
All P_14_*W fields required for foreign currency in corresponding rate brackets
GOV_MANDATED
ERROR
KSEF-BUS-006
Exchange rate missing for foreign currency invoice
GOV_MANDATED
ERROR
KSEF-BUS-030
Invoice issue date exceeds the allowed future-date window
GOV_MANDATED
KSeF Gov Enforced
ERROR
KSEF-BUS-044
Line net value consistent with quantity × adjusted unit price
GOV_MANDATED
ERROR
KSEF-BUS-072
Tax rate must be consistent with net amount bucket (simplified invoices exempt)
BEST_PRACTICE
ERROR
KSEF-BUS-074
P_19=1 without providing exemption basis (P_19A/B/C)
GOV_MANDATED
KSeF Gov Enforced
ERROR
↓ 122 more rules
KSEF-BUS-006 GOV MANDATED ERROR KSEF GUARD ONLY

Exchange rate missing for foreign currency invoice

Brak kursu waluty dla faktury w walucie obcej

Problem

Foreign currency invoice has VAT amounts in foreign currency (P_14_*W), but no exchange rate is provided. Either KursWalutyZ (global invoice rate) or KursWaluty (per-line rate) must be specified.

How to Fix

Provide the exchange rate in KursWalutyZ (global rate for the entire invoice) or KursWaluty (per-line rate). The rate should follow Art. 31a — the average NBP rate from the last business day before the tax obligation arises.

Source Quote

“The exchange rate used to calculate the amount of tax, in cases referred to in sec. VI of the Act. When amounts used for determining the tax base are provided in a foreign currency, the exchange rate applicable to a given line of the invoice shall be indicated.”

DESCRIPTION SHA-256: c2fd221e087382ca…

5 Export Formats

Text and Summary (Free). CSV, JSON, and PDF (Standard+). PDF includes legal citations, risk scores, and source quotes. All formats bilingual — Polish and English.

PDF A4 · DejaVu Sans · EN
Expand
KSeF Guard
Validation Report
Date: 2026-05-03
KSeF Guard
KSeF Guard
Walidator FA(3)
Executive Summary
Files
6
PASS
1
FAIL
5
Pass Rate
17%
Rules evaluated: 128 | Errors: 9 | Warnings: 4 | XSD: 1
File Index
# Status Filename Błędy Ostrz. XSD Risk Str.
1 FAIL FA_2026_01_0201.xml 1 1 0 25 1
2 FAIL FA_2026_02_0042.xml 3 1 0 65 2
3 FAIL FA_2026_02_0099.xml 1 1 0 25 4
4 FAIL FA_2026_02_0187.xml 2 1 0 25 6
5 PASS FA_2026_03_0001.xml 0 0 0 0 7
6 FAIL FA_2026_03_0156.xml 2 0 1 40 9
FAIL FA_2026_01_0201.xml Errors: 1 | Warnings: 1
[ERROR] KSEF-BUS-044 Legal
Problem:
Line net value (P_11 — net amount) does not match the formula: quantity (P_8B) × (unit price P_9A − discount P_10 + surcharge P_10_Dodatki). Please check the line calculation.
What to fix:
Check the invoice line calculations — the net amount (P_11) should equal P_8B × (P_9A − P_10 + P_10_Dodatki), rounded to grosz (tolerance: 0.02 PLN).
Evidence:
Value: NrWierszaFa=2; P_8B=10.00; P_9A=50.00; P_11=0.00
Path: /Faktura/Fa/FaWiersz/P_11
Line: 44
XML Preview Line 44
41<FaWiersz>
42 <NrWierszaFa>2</NrWierszaFa><P_7>Instalacja paneli</P_7>
43 <P_8A>szt</P_8A><P_8B>10.00</P_8B><P_9A>50.00</P_9A><P_9B>0.00</P_9B>
44 <P_11>0.00</P_11><P_11A>0.00</P_11A><P_11Vat>0.00</P_11Vat><P_12>23</P_12>
45</FaWiersz>
Fix: P_11 = 500.00
Quote:
"11) Value of goods delivered or services provided covered by the transaction, excluding tax amount (net sales value)"
Source: Ustawa o VAT Art. 106e ust. 1 pkt 11
TXT Expand
ksef-guard v1.0.0 | Preset: recommended | 128 rules
────────────────────────────────────────────────────
✗ FA_2026_01_0201.xml — FAIL
XSD: pass | Rules: 128 evaluated, 1 error(s), 1 warning(s)
[FAIL] KSEF-BUS-044 [GOV_MANDATED]
Problem: Wartość netto wiersza (P_11 — kwota netto) nie odpowiada formule…
Line net value (P_11 — net amount) does not match the formula…
Fix:Sprawdź obliczenia na pozycjach faktury — wartość netto (P_11)…
Check the invoice line calculations — the net amount (P_11)…
Evidence: NrWierszaFa=2; P_8B=10.00; P_9A=50.00; P_11=0.00
Path:/Faktura/Fa/FaWiersz/P_11
Source:Ustawa o VAT Art. 106e ust. 1 pkt 11
[WARN] KSEF-BUS-140 [BEST_PRACTICE]
Problem: Pozycja faktury ma zerową kwotę netto (P_11 — kwota netto = 0) przy stawce opodatkowanej…
Invoice line has zero net amount (P_11 — net amount = 0) with a taxable rate…
✗ FA_2026_02_0042.xml — FAIL
✗ FA_2026_02_0099.xml — FAIL
✗ FA_2026_02_0187.xml — FAIL
✓ FA_2026_03_0001.xml — PASS
✗ FA_2026_03_0156.xml — FAIL
────────────────────────────────────────────────────
Summary: 1 pass, 5 fail (6 files) in 285ms
Schema: FA(3) 1-0E | Registry: 1.0.0
CSV Expand
file_name file_status risk_score violation_type code severity classification
FA_2026_01_0201.xml FAIL 25 RULE KSEF-BUS-044 error GOV_MANDATED
FA_2026_02_0042.xml FAIL 65 RULE KSEF-BUS-003 error GOV_MANDATED
FA_2026_02_0099.xml FAIL 25 RULE KSEF-BUS-030 error GOV_MANDATED
FA_2026_02_0187.xml FAIL 25 RULE KSEF-BUS-006 error GOV_MANDATED
FA_2026_03_0001.xml PASS 0 - - - -
FA_2026_03_0156.xml FAIL 40 XSD FA3-XSD-E001 error -
15 rows · 18 columns · UTF-8 BOM
JSON Expand
{
"rule_id": "KSEF-BUS-044",
"result": "FAIL",
"severity": "error",
"classification_tag": "GOV_MANDATED",
"source_ref": "Ustawa o VAT Art. 106e ust. 1 pkt 11",
"problem_pl": "Wartość netto wiersza (P_11)…",
"problem_en": "Line net value (P_11 — net amount)…",
"reason_code": "KSEF-BUS-044_LINE_ARITHMETIC_MISMATCH|xml_line=44",
"fix_pl": "Sprawdź obliczenia na pozycjach…",
"fix_en": "Check the invoice line calculations…",
"quote_pl": "11) wartość dostarczonych towarów…",
"quote_en": "11) Value of goods delivered…",
"evidence_value": "NrWierszaFa=2; P_8B=10.00…",
"evidence_path": "/Faktura/Fa/FaWiersz/P_11",
"evidence_line": 44,
"correction_hint": "P_11 = 500.00",
"legal_basis": [
{ "title_pl": "Wymogi ustawowe…", "source": "Art. 106e ust. 1 pkt 8", }
]
}

Batch Operations

Process up to 5,000 files per day (Standard) or unlimited (Pro). Recursive folder scanning with cross-invoice rules: duplicate numbers, NIP inconsistencies, and chronological order issues. Free tier: 10 files/day.

ksef-guard validate ./invoices/
ksef-guard v1.0.0 (windows/amd64) | Preset: recommended | 128 rules
Plan: Standard | Limit: 5,000/day | Used: 4,213
787 / 787
────────────────────────────────────────────────────
⋮ (780 results above)
✓ FA_2026_Q1_0781.xml — PASS
✓ FA_2026_Q1_0782.xml — PASS
✗ FA_2026_Q1_0783.xml — FAIL
XSD: pass | Rules: 128 evaluated, 3 error(s), 0 warning(s)
[FAIL] KSEF-BUS-300 [GOV_MANDATED]
Problem: W partii faktur wykryto zduplikowany numer faktury (P_2)…
Duplicate invoice number (P_2) detected in the batch…
Fix: Sprawdź numerację faktur w partii — każda faktura musi mieć unikalny numer (P_2)…
Check the invoice numbering in the batch — each invoice must have a unique number…
Evidence: P_2="FV/2026/03/0214" (duplicate: FA_2026_Q1_0214.xml)
Path: /Faktura/Fa/P_2
[FAIL] KSEF-BUS-044 [GOV_MANDATED]
Problem: Wartość netto wiersza (P_11 — kwota netto) nie odpowiada formule…
Line net value (P_11 — net amount) does not match the formula…
[FAIL] KSEF-BUS-302 [BATCH_CHECK]
Problem: Regresja daty wystawienia (P_1) w sekwencji numerów faktur…
Issue date (P_1) regression in the invoice number sequence…
✓ FA_2026_Q1_0784.xml — PASS
✓ FA_2026_Q1_0785.xml — PASS
✓ FA_2026_Q1_0786.xml — PASS
✓ FA_2026_Q1_0787.xml — PASS
────────────────────────────────────────────────────
Summary: 782 pass, 5 fail (787 files) in 1,420ms
Schema: FA(3) 1-0E | Registry: 1.0.0
3 warnings | Risk avg: 1/100
✓ Compliance: Offline-verifiable subset checked.
Batch Stats
782 pass
5 fail
Pass rate: 99.4%

Configuration Profiles

Three built-in presets: essential (government-mandated rules only), recommended (balanced), and maximum (all rules, warnings promoted to errors). Override individual rules via .ksef-guard.yml (Pro).

Profil: Preset:
Podstawowy Essential Zalecany Recommended Maksymalny Maximum
Essential 71 rules
Only government-mandated rules. Legal minimum.
71 GOV_MANDATED only
GOV_MANDATED: on
BEST_PRACTICE: off
HEURISTIC: off
SECURITY: off
Recommended Default
All rules. Warnings noted, do not affect verdict.
128 rules
55% GOV · 20% BEST · 9% HEUR · 16% other
All categories: on
Warnings: show
Per-rule overrides
Active
Maximum 128 rules
All rules. Warnings treated as errors.
128 rules · all promoted to error
warning → error
Zero tolerance
Strictest compliance
.ksef-guard.yml | Shareable config for CLI & CI/CD
↑ Importuj Import ↓ Eksportuj Export
# Export from GUI: Settings → Rules → Eksportuj/Export
# Place in project root or ~/.config/ksef-guard/
# CLI auto-discovers: walks up from cwd → user config dir
preset: recommended # essential | recommended | maximum

rules: # per-rule: "error" | "warning" | "off"
KSEF-BUS-140: "off" # disable zero-amount heuristic
KSEF-BUS-193: "warning" # demote to warning
KSEF-BUS-044: "error" # enforce line arithmetic
5-Level Priority Chain — higher level always wins
L5
Registry
defaults
lowest
L4
.yml
preset:
file
L3
.yml
rules:
overrides
L2
CLI
--preset
flag
L1
CLI
--disable-rule
highest
← lower priority
higher priority →

CI/CD Pipeline Integration

Single binary, zero dependencies — download, run, done. Ships with ready-made GitHub Actions and GitLab CI templates. Auto-discovers .ksef-guard.yml from your repo. Exit codes distinguish XSD failures from business rule violations.

ksef-validate.yml GitHub Actions
name: KSeF Validation
on: [push, pull_request]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download ksef-guard
run: |
curl -fsSL -o kg.tar.gz
ksefguard.pl/dl/linux-amd64.tar.gz
tar xzf kg.tar.gz
- name: Validate invoices
run: |
./ksef-guard validate
--preset maximum
--output results.txt
./invoices/
- uses: actions/upload-artifact@v4
if: always()
with:
name: ksef-results
path: results.txt
Validate invoices
exit code 2
$ ./ksef-guard validate --preset maximum --output results.txt ./invoices/
Validated: 2/2 files.
ksef-guard v1.0.0 | Preset: maximum | 128 rules
────────────────────────────────────────────────
✗ FA_2026_03_0042.xml — FAIL
XSD: pass | Rules: 128 evaluated, 3 error(s), 0 warning(s)
[FAIL] KSEF-BUS-044 [GOV_MANDATED]
Problem: Wartość netto wiersza (P_11) nie odpowiada...
Fix: ... | Evidence: ... | Path: .../FaWiersz/P_11
[FAIL] KSEF-BUS-110 [INFERRED]
Problem: Kwota netto wiersza przekracza ilość × cena...
Fix: ... | Evidence: ... | Path: .../FaWiersz/P_11
[FAIL] KSEF-BUS-177 [GOV_MANDATED]
Problem: Wartość brutto (P_11A) nie jest zgodna...
Fix: ... | Evidence: ... | Path: .../FaWiersz/P_11A
✓ FA_2026_03_0001.xml — PASS
XSD: pass | Rules: 128 evaluated, 0 error(s), 0 warning(s)
────────────────────────────────────────────────
Summary: 1 pass, 1 fail (2 files) in 109ms
Schema: FA(3) 1-0E | Registry: 1.0.0
Exit code: 2
0
ALL PASS
1
XSD FAIL
2
RULE FAIL
10–13
ARGS / IO
Single binary Zero dependencies Offline — no API calls .ksef-guard.yml auto-discovery

White-label PDF

PDF reports with your own logo and company header (Pro). KSeF Guard branding hidden — perfect for sharing with clients and auditors.

Default
PDF A4 · DejaVu Sans
KSeF Guard
Validation Report
Date: 2026-05-03
KSeF Guard
KSeF Guard
Walidator FA(3)
Files
6
PASS
1
FAIL
5
Rate
17%
FAILFA_2026_01_0201.xmlBUS-044
FAILFA_2026_02_0042.xmlBUS-044, BUS-110
FAILFA_2026_03_0088.xmlBUS-140
PASSFA_2026_03_0001.xml
... 2 more files
Powered by KSeF Guard
White-label PRO
PDF A4 · DejaVu Sans
Acme Księgowość Sp. z o.o.
Validation Report
Date: 2026-05-03
AC
Acme
Księgowość
Files
6
PASS
1
FAIL
5
Rate
17%
FAILFA_2026_01_0201.xmlBUS-044
FAILFA_2026_02_0042.xmlBUS-044, BUS-110
FAILFA_2026_03_0088.xmlBUS-140
PASSFA_2026_03_0001.xml
... 2 more files
Powered by KSeF Guard
White-label PRO
PDF Export Settings
Logo firmy / Company logo
PNG, JPG · max 2 MB
acme-logo.png
Ukryj branding / Hide branding
Removes "KSeF Guard" from PDF footer
Nazwa firmy / Company name
Replaces "KSeF Guard" as report title
Acme Księgowość Sp. z o.o.

Session History

Automatic saving of validation results (all plans; Free keeps the last 5 sessions, Standard 25, Pro 100). Browse previous sessions, track pass rates and recurring violations, and restore full results with a single click.

KSeF Guard
Walidator FA(3)
FA(3) Validator
IDLE
Usage: 0/inf
Użycie:
Preset: Profil:
Drag XML files or folder here
Przeciągnij pliki lub folder XML tutaj
Recent Scans | Ostatnie skanowania
23 godz. temu | 23h ago 9 files recommended
33% KSEF-BUS-197 KSEF-BUS-044 KSEF-BUS-140
Yesterday | Wczoraj 12 files recommended
100%
Yesterday | Wczoraj 48 files maximum
78% KSEF-BUS-044 KSEF-BUS-110
2 days ago | 2 dni temu 5 files essential
100%
4 / 100 scans saved | skanowań zapisanych

Stop guessing. Start validating.

Free for up to 10 invoices/day. No account required. Invoice data stays on your machine.

Download Free