# Midijob-Rechner - Comprehensive Documentation

**Last Updated:** 2026-04-01

## Tool Overview

### Basic Information

- **Tool Name:** Midijob-Rechner (Midijob/Gleitzone Salary Calculator)
- **Slug:** `midijob-rechner`
- **URL:** `https://www.ordio.com/tools/midijob-rechner`
- **Status:** Available
- **Last Updated:** 2026-04-01

### Purpose

Calculate net salary in the Midijob/Gleitzone range (€603.01-€2,000/month) with reduced social security contributions using the Gleitzone (sliding scale) calculation. Handles Gleitzone F-Factor calculation, all tax classes, employer costs, and detailed breakdowns. Includes comparison feature (Minijob vs Midijob vs Vollzeit) and export functionality (PDF, CSV) with email gating.

### Changelog (product / SEO)

- **2026-04-01:** SEO/AEO sprint — meta title/description + Gleitzonenrechner synonym; expanded FAQs (15) with PAA coverage; FAQPage JSON-LD generated from `v2/data/tools-faqs/midijob_rechner.json` via `ordio_faqpage_schema_node()` (no schema drift); nuanced copy for **Minijob neben Midijob** (mehrere Beschäftigungen); removed unverifiable `aggregateRating` from `WebApplication` schema; internal links to Lexikon/Payroll; SISTRIX/GSC/GA4 data refresh in `docs/content/tools/`; `CONTENT_OUTLINE.md` editorial rewrite; Serper live SERP notes in `SERP_ANALYSIS.md`.
- **2026-04-01 (follow-up):** Per-page **GSC queries** export in `docs/content/tools/midijob-rechner/data/gsc-queries.json` via `collect-tool-gsc-queries.php`; `composer schema` / `validate-schema.php` passed; post-deploy **Google Rich Results Test** on the live URL still recommended for FAQ/WebApplication markup.
- **2026-04-01 (data + copy):** Refreshed **tools-performance-gsc.json** / **tools-performance-ga4.json** and **gsc-queries.json**; updated `SERP_ANALYSIS.md` (page + top-query table), `CONTENT_OUTLINE.md` (GSC insights), **meta title/description**, OG, **WebApplication** description + `featureList`, hero + Block 1 copy for GSC intents (2026, Brutto-Netto, Steuerklasse 5).

### Use Cases

- **Midijob Employees:** Calculate net salary with reduced social security contributions
- **Employers:** Calculate total costs for Midijob employees (including employer contributions)
- **HR Professionals:** Understand Gleitzone calculations and compliance
- **Job Seekers:** Compare Midijob vs Minijob vs full-time employment
- **Financial Planners:** Plan income scenarios in the Gleitzone range

### Real-World Scenarios

**Scenario 1: Student Transitioning from Minijob to Midijob**
- **User:** Student whose income increased above €603/month
- **Situation:** Currently earning €603 Minijob, offered €1,200/month position
- **Goal:** Understand net income difference and social security impact
- **Steps:**
  1. Calculate current Minijob net: €603 (no taxes)
  2. Switch to Midijob-Rechner
  3. Enter €1,200 Bruttogehalt
  4. Select Tax Class I
  5. Review Gleitzone calculation and reduced contributions
  6. Compare net income with Minijob
- **Result:** Sees €1,200 gross = ~€1,050 net (vs €603 Minijob), understands reduced contribution benefits
- **Related Tools:** [Minijob-Rechner](minijob-rechner-documentation.md) (for comparison), [Brutto-Netto-Rechner](brutto-netto-rechner-documentation.md) (for full-time comparison)

**Scenario 2: HR Manager Evaluating Midijob vs Full-Time**
- **User:** HR professional deciding between Midijob and full-time hire
- **Situation:** Need to fill position, considering €1,500 Midijob vs €3,000 full-time
- **Goal:** Compare total costs and employee net income
- **Steps:**
  1. Calculate Midijob costs: €1,500 gross = ~€1,350 net (employee), ~€1,650 total (employer)
  2. Calculate full-time costs: €3,000 gross = ~€2,000 net (employee), ~€3,600 total (employer)
  3. Compare total costs and employee satisfaction
  4. Use comparison feature to see side-by-side
- **Result:** Sees Midijob costs 54% less, employee gets 67% of full-time net
- **Related Tools:** [Brutto-Netto-Rechner](brutto-netto-rechner-documentation.md) (for full-time calculation), [Kostenrechner](kostenrechner-documentation.md) (for overall cost analysis)

**Scenario 3: Part-Time Worker Maximizing Income**
- **User:** Part-time worker optimizing income in Gleitzone range
- **Situation:** Can work more hours, wants to maximize net income without exceeding Gleitzone
- **Goal:** Find optimal income level in €603-€2,000 range
- **Steps:**
  1. Calculate net for different income levels (€800, €1,200, €1,600, €2,000)
  2. Review Gleitzone F-Factor impact at each level
  3. Identify optimal income level for best net-to-gross ratio
  4. Plan hours accordingly
- **Result:** Identifies optimal income level (~€1,500) for best net income
- **Related Tools:** [Stundenlohnrechner](stundenlohnrechner-documentation.md) (for hourly rate conversion), [Arbeitszeitrechner](arbeitszeitrechner-documentation.md) (for hours calculation)

**Scenario 4: Employer Calculating Midijob Costs**
- **User:** Business owner hiring Midijob workers
- **Situation:** Need to hire 2 Midijob workers at €1,500/month each
- **Goal:** Understand total employer costs including all contributions
- **Steps:**
  1. Enter €1,500 Bruttogehalt
  2. Select appropriate tax class
  3. Review employer contribution breakdown
  4. Multiply by number of employees
  5. Compare with Minijob costs
- **Result:** Sees total cost per employee (~€1,650/month), can budget accurately
- **Related Tools:** [Minijob-Rechner](minijob-rechner-documentation.md) (for Minijob comparison), [Kostenrechner](kostenrechner-documentation.md) (for overall cost planning)

### Target Audience

- Midijob employees
- Employers
- HR professionals
- Job seekers
- Financial advisors

### Visual Description

**Hero Section:**

- Layout: Centered hero section with badge, headline, and description
- Badge: "Midijob Rechner" badge
- Headline: Large bold headline "Midijob-Rechner 2026: Netto-Gehalt berechnen im Übergangsbereich" with blue accent
- Description: Paragraph explaining calculator features and range (€603,01 - €2.000)
- Trust Indicators: Three badges showing "2026 aktuell", "Alle Steuerklassen", "PDF & CSV Export"
- Background: Subtle dot pattern background

**Visual Examples (To Be Added):**

**Hero Section Screenshot:**
- Location: `docs/guides/tools-pages/screenshots/midijob-rechner-hero.png`
- Description: Full hero section showing badge, headline, description, and trust indicators
- Dimensions: 1920x1080 (desktop), 375x667 (mobile)
- Shows: Complete above-fold content with visual styling

**Calculator Form Screenshot:**
- Location: `docs/guides/tools-pages/screenshots/midijob-rechner-form.png`
- Description: Calculator form showing Basic and Advanced modes with Gleitzone inputs
- Dimensions: 1920x1080 (desktop)
- Shows: Mode toggle, input fields, tax class selection, calculate button

**Result Display Screenshot:**
- Location: `docs/guides/tools-pages/screenshots/midijob-rechner-results.png`
- Description: Results section showing net income, Gleitzone breakdown, comparison feature
- Dimensions: 1920x1080 (desktop)
- Shows: Primary net income, F-Factor calculation, contribution breakdown, comparison view

**Gleitzone Comparison Diagram:**
- Location: `docs/guides/tools-pages/diagrams/midijob-rechner-gleitzone.svg`
- Description: Visual comparison of Minijob vs Midijob vs Full-time net income
- Format: SVG (vector) for scalability
- Shows: Income ranges, net income comparison, contribution rates visualization

**Calculator Modes:**

- Mode Toggle: Two-button toggle (Schnell-Rechner / Erweiterter Rechner)
- Basic Mode: Simple inputs (Bruttogehalt, Steuerklasse, KV-Zusatzbeitrag)
- Advanced Mode: All inputs (Tax class, children, church tax, federal state, birth year, pension exemption, annual allowance)

**Form Section:**

- Layout: Centered single-column layout
- Basic Mode Inputs:
  - Bruttogehalt: Number input (€) with validation (603.01-2000)
  - Steuerklasse: Select (I-VI)
  - KV-Zusatzbeitrag: Number input (%)
- Advanced Mode Additional Inputs:
  - Kinderanzahl: Number input (0+)
  - Geburtsjahr: Number input (for age calculation)
  - Kirchensteuer: Toggle
  - Bundesland: Select (16 German states)
  - Bundesland Pflegeversicherung: Select (16 German states, separate for Saxony logic)
  - Jahresfreibetrag: Number input (€)
  - Rentenversicherungsbefreiung: Toggle
- Calculate Button: Auto-calculates on input change (debounced)
- Styling: Blue accent color (#4D8EF3), rounded inputs, responsive layout

**Result Display:**

- Layout: Below form, centered
- Results Summary: Large card showing:
  - Bruttogehalt: Display
  - Nettogehalt: Large bold display (blue accent)
  - Gesamtabzüge: Display
- Toggle Sections:
  - Sozialversicherung: Breakdown (RV, ALV, KV, Pflege) - reduced amounts
  - Steuern: Breakdown (Lohnsteuer, Soli, Kirchensteuer)
  - Arbeitgeberkosten: Breakdown (AG contributions on full brutto) - Advanced mode only
  - Vergleich: Comparison table (Minijob vs Midijob vs Vollzeit) - Advanced mode only
  - Formel: Gleitzone formula explanation - Advanced mode only
- Gleitzone Info: Shows reduced Bemessungsgrundlage and F-Factor
- Export Buttons: PDF and CSV export (email gating)
- Styling: White cards, blue accent for totals, responsive tables

### UI/UX Flow

**Initial Load:**

- Page loads with hero section visible
- Calculator displayed in Basic Mode by default
- Default values:
  - Bruttogehalt: 1,500€
  - Steuerklasse: I
  - KV-Zusatzbeitrag: 2.5%
- No results displayed initially
- Advanced mode inputs hidden

**Calculation Flow:**

1. User enters Bruttogehalt (603.01-2000€)
2. User selects Steuerklasse (I-VI)
3. User enters KV-Zusatzbeitrag (0-10%)
4. If Advanced Mode:
   - User enters Kinderanzahl (0+)
   - User enters Geburtsjahr (for age calculation)
   - User enables/disables Kirchensteuer
   - User selects Bundesland (for church tax)
   - User selects Bundesland Pflegeversicherung (for Saxony logic)
   - User enters Jahresfreibetrag (€)
   - User enables/disables Rentenversicherungsbefreiung
5. Calculation runs automatically (debounced, 10ms delay)
6. Results display below form
7. User can toggle sections (Sozialversicherung, Steuern, Arbeitgeberkosten, Vergleich, Formel)
8. User can switch between Basic and Advanced modes
9. User can export results (PDF/CSV) - email required

**Mode Switching:**

1. User clicks mode toggle
2. Mode switches (Basic ↔ Advanced)
3. Advanced-specific inputs show/hide
4. Advanced-specific toggles reset
5. Calculation runs automatically with current values

**Export Flow:**

1. User clicks PDF or CSV export button
2. If email not collected: Email modal appears
3. User enters email address
4. Email submitted to HubSpot API
5. Email stored in localStorage
6. Export generated and downloaded
7. Future exports skip email collection

## Technical Documentation

### File Structure

- **PHP File:** `v2/pages/tools_midijob_rechner.php` (~4,300 lines)
- **JavaScript File:** `v2/js/tools-midijob-calculator.js` (extracted, ~1,000 lines)
- **CSS:** Uses shared `v2/css/tools-pages.css`

### Code Organization

**Alpine.js Component Structure:**

- Main component: External JS file (`v2/js/tools-midijob-calculator.js`)
- Registered as: `Alpine.data('midijobCalculator', midijobCalculator)`
- Also available globally: `window.midijobCalculator`
- All logic in external file (good separation of concerns)

**State Management:**

- Alpine.js reactive data properties
- localStorage for email persistence
- No server-side state
- All calculations client-side

**Code Patterns:**

- Alpine.js reactive data properties
- Auto-calculation on input change (debounced)
- Progressive disclosure (mode switching)
- Email gating for exports
- External JS file (good maintainability)

### Calculation Modes

**Mode 1: Basic Mode (Schnell-Rechner)**

- **Visual Description:** Simple calculator with essential inputs only
- **Purpose:** Quick net salary calculation for common scenarios
- **Input Fields:**
  - `bruttogehalt` (number input): Gross salary (€) - 603.01-2000
  - `steuerklasse` (select): Tax class (I-VI)
  - `zusatzbeitrag` (number input): Health insurance additional rate (0-10%, step 0.1)
- **Output Fields:**
  - `nettogehalt` (display): Net salary
  - `gesamtabzuege` (display): Total deductions
  - `sozialversicherungArbeitnehmer` (display): Employee social security (reduced)
  - `lohnsteuer` (display): Income tax
  - `solidaritaetszuschlag` (display): Solidarity surcharge
  - `kirchensteuerBetrag` (display): Church tax (if enabled)
- **Formula:** Same as Advanced Mode, but with default values for advanced inputs
- **Example Calculation:**

  ```
  Input: Bruttogehalt = 1,500€, Steuerklasse = I, KV-Zusatzbeitrag = 2.5%
  Calculation:
    // Gleitzone calculation
    F-Factor = 0.6683
    Beitragspflichtiges Entgelt = 0.6683 × 1,500 = 1,002.45€
    (Ensure >= Untergrenze: max(1,002.45, 603.01) = 1,002.45€)

    // Social security (employee, reduced)
    RV = 1,002.45 × 9.3% = 93.23€
    ALV = 1,002.45 × 1.3% = 13.03€
    KV = 1,002.45 × (7.3% + 2.5%) = 98.24€
    Pflege = 1,002.45 × 1.8% = 18.04€
    Total SV = 93.23 + 13.03 + 98.24 + 18.04 = 222.54€

    // Income tax
    Gross Yearly = 1,500 × 12 = 18,000€
    Taxable Income = 18,000 - 12,096 = 5,904€
    Income Tax = (922.98 × 0.5904 + 1,400) × 0.5904 = 1,030.24€
    Income Tax Monthly = 1,030.24 / 12 = 85.85€

    // Solidarity surcharge
    Solidarity = 0 (below threshold)

    // Church tax
    Church Tax = 0 (default: not enabled in Basic Mode)

    // Totals
    Total Deductions = 222.54 + 85.85 + 0 + 0 = 308.39€
    Net Salary = 1,500 - 308.39 = 1,191.61€
  Result: Net Salary 1,191.61€/month
  ```

- **Validation:**
  - Bruttogehalt: 603.01-2000€
  - Steuerklasse: I-VI
  - KV-Zusatzbeitrag: 0-10%
  - Error messages: Display if outside range

**Mode 2: Advanced Mode (Erweiterter Rechner)**

- **Visual Description:** Comprehensive calculator with all options
- **Purpose:** Detailed calculation with all personal circumstances
- **Input Fields:**
  - All Basic Mode inputs, plus:
  - `kinderanzahl` (number input): Number of children (0+)
  - `geburtsjahr` (number input): Birth year (for age calculation)
  - `kirchensteuer` (toggle): Church tax enabled
  - `bundesland` (select): German state (for church tax)
  - `bundeslandPflege` (select): German state (for Pflegeversicherung, Saxony logic)
  - `jahresfreibetrag` (number input): Annual allowance (€)
  - `rentenversicherungBefreit` (toggle): Pension insurance exemption
- **Output Fields:**
  - All Basic Mode outputs, plus:
  - Individual social security components (RV, ALV, KV, Pflege - employee and employer)
  - `beitragspflichtigesEntgelt` (display): Reduced Bemessungsgrundlage
  - `arbeitgeberGesamtkosten` (display): Total employer costs
  - Comparison table (Minijob vs Midijob vs Vollzeit)
  - Gleitzone formula explanation
- **Formula:** Same as Basic Mode, but with advanced inputs applied
- **Example Calculation:**

  ```
  Input: Bruttogehalt = 1,500€, Steuerklasse = III, KV-Zusatzbeitrag = 0.9%, Kinderanzahl = 2, Geburtsjahr = 1990, Kirchensteuer = Yes, Bundesland = Bayern, Bundesland Pflege = Bayern, Jahresfreibetrag = 0, Rentenversicherungsbefreiung = No
  Calculation:
    // Gleitzone calculation (same as Basic Mode)
    Beitragspflichtiges Entgelt = 1,002.45€

    // Social security (employee, reduced)
    RV = 1,002.45 × 9.3% = 93.23€
    ALV = 1,002.45 × 1.3% = 13.03€
    KV = 1,002.45 × (7.3% + 0.9%) = 82.20€
    Pflege = 1,002.45 × 1.7% = 17.04€ (with children, no surcharge)
    Total SV = 93.23 + 13.03 + 82.20 + 17.04 = 205.50€

    // Income tax (Steuerklasse III)
    Gross Yearly = 1,500 × 12 = 18,000€
    Child Allowance = 2 × 6,612 = 13,224€
    Taxable Income = 18,000 - 12,096 - 13,224 = -7,320€ (negative, no tax)
    Income Tax = 0€

    // Solidarity surcharge
    Solidarity = 0 (no income tax)

    // Church tax
    Church Tax = 0 (no income tax)

    // Totals
    Total Deductions = 205.50 + 0 + 0 + 0 = 205.50€
    Net Salary = 1,500 - 205.50 = 1,294.50€

    // Employer costs (on full brutto)
    Employer RV = 1,500 × 9.3% = 139.50€
    Employer ALV = 1,500 × 1.3% = 19.50€
    Employer KV = 1,500 × 7.3% = 109.50€
    Employer Pflege = 1,500 × 1.7% = 25.50€
    Total Employer Costs = 1,500 + 139.50 + 19.50 + 109.50 + 25.50 = 1,794.00€
  Result: Net Salary 1,294.50€/month, Employer Costs 1,794.00€/month
  ```

- **Validation:**
  - All Basic Mode validations, plus:
  - Kinderanzahl: >= 0
  - Geburtsjahr: Valid year (1900-2100)
  - Jahresfreibetrag: >= 0
  - Error messages: Display if invalid

### Gleitzone Calculation

**Legal Basis:**

- SGB IV (Sozialgesetzbuch IV): Gleitzone regulations
- Minijob-Zentrale: Official Gleitzone values
- Bundesagentur für Arbeit: F-Factor calculation

**Gleitzone Formula:**

```
// Step 1: Calculate Beitragspflichtiges Entgelt (Reduced Bemessungsgrundlage)
If Brutto <= Gleitzone Obergrenze (2,000€):
  Beitragspflichtiges Entgelt = F-Factor × Brutto
  Ensure: Beitragspflichtiges Entgelt >= Gleitzone Untergrenze (603.01€)
Else:
  Beitragspflichtiges Entgelt = Brutto (full contributions)

// Step 2: Calculate Social Security Contributions
Employee Contributions = Beitragspflichtiges Entgelt × Rates
Employer Contributions = Brutto × Rates (full amount)

// Step 3: Calculate Net Salary
Net Salary = Brutto - Employee Contributions - Taxes
```

**F-Factor (2026):**

- **Value:** 0.6683 (Official F-Factor, unchanged for 2026)
- **Purpose:** Reduces Bemessungsgrundlage for employee contributions
- **Calculation:** Derived from social security rates and Gleitzone limits
- **Status:** ✅ Verified unchanged for 2026

**Gleitzone Limits (2026):**

- **Untergrenze:** 603.01€/month (aligned with Minijob Grenze + €0.01)
- **Obergrenze:** 2,000€/month
- **Status:** ✅ Updated for 2026

**Example Gleitzone Calculation:**

```
Input: Brutto = 1,500€
Calculation:
  F-Factor = 0.6683
  Beitragspflichtiges Entgelt = 0.6683 × 1,500 = 1,002.45€
  Ensure >= 603.01€: max(1,002.45, 603.01) = 1,002.45€ ✓

  // Employee contributions (reduced)
  RV Employee = 1,002.45 × 9.3% = 93.23€

  // Employer contributions (full)
  RV Employer = 1,500 × 9.3% = 139.50€
```

### Constants and Thresholds

**2026 Values (TO UPDATE):**

- **Midijob Untergrenze:** ✅ 603.01€/month (2026, verified 2026-01-07)
- **Midijob Obergrenze:** ✅ 2,000€/month (unchanged for 2026)
- **Minijob Grenze:** ✅ 603€/month (2026, verified 2026-01-07)
- **Gleitzone F-Factor:** ✅ 0.6683 (unchanged for 2026, verified 2026-01-07)
- **Grundfreibetrag:** ✅ 12,348€ (2026, verified 2026-01-07)
- **Kinderfreibetrag:** ✅ 6,828€ per child/year (2026, verified 2026-01-07)
- **Werbungskosten:** ✅ 1,230€ (unchanged for 2026)
- **Sonderausgaben:** ✅ 36€ (unchanged for 2026)
- **Social Security Rates:** Typically stable (verify unchanged)
  - Rentenversicherung: 18.6% total (9.3% employee, 9.3% employer)
  - Arbeitslosenversicherung: 2.6% total (1.3% employee, 1.3% employer)
  - Krankenversicherung: 14.6% total (7.3% employee, 7.3% employer) + Zusatzbeitrag
  - Pflegeversicherung: 3.6% total (1.8% employee, 1.8% employer) - varies by age/children
- **Solidarity Threshold:** ✅ Currently 18,130€ (2026) - needs verification for 2026
- **Church Tax Rates:** Stable (8% BW/BY, 9% others)

**Previous Values (for reference):**

- Midijob Untergrenze 2026: 603.01€
- Midijob Untergrenze 2025: 556.01€
- Minijob Grenze 2026: 603€
- Minijob Grenze 2025: 556€
- Gleitzone F-Factor 2026: 0.6683 (unchanged)
- Gleitzone F-Factor 2025: 0.6683
- Grundfreibetrag 2026: 12,348€
- Grundfreibetrag 2025: 12,096€
- Kinderfreibetrag 2026: 6,828€ per child/year
- Kinderfreibetrag 2025: 6,612€ per child/year

### Validation Rules

- **Bruttogehalt:** 556.01-2000€ (Midijob range)
- **Steuerklasse:** I-VI
- **KV-Zusatzbeitrag:** 0-10%
- **Kinderanzahl:** >= 0
- **Geburtsjahr:** Valid year (1900-2100)
- **Jahresfreibetrag:** >= 0

### Edge Cases Handled

- Income below Gleitzone: Shows message to use Minijob-Rechner
- Income above Gleitzone: Shows message to use Brutto-Netto-Rechner
- Boundary values: 556.01€ and 2,000€ handled correctly
- Beitragspflichtiges Entgelt below Untergrenze: Automatically set to Untergrenze
- Tax class variations: All 6 tax classes handled correctly
- Church tax: Only applies if enabled
- Solidarity surcharge: Only applies if above threshold
- Pflegeversicherung: Age-based rates (23+ childless surcharge)
- Saxony logic: Different Pflegeversicherung split (2.025% / 1.025%)
- Pension exemption: Can be exempt from RV
- Zero children: No child allowance
- Multiple children: All children considered

### Dependencies

- **External Libraries:** html2canvas, jsPDF (for PDF export)
- **APIs:** HubSpot Forms API v3 (via `/v2/api/collect-lead.php`)
- **Alpine.js:** Used for reactive UI (version from base includes)
- **External JavaScript:** All logic in `v2/js/tools-midijob-calculator.js`

## Functions & Methods

### Main Component Functions

**Function:** `calculate()`

- **Location:** `v2/js/tools-midijob-calculator.js:164`
- **Purpose:** Main calculation function for Midijob net salary
- **Returns:** void (sets component state)
- **Dependencies:** `calculateSocialSecurity()`, `calculateIncomeTax()`, `calculatePflegeversicherung()`
- **Side Effects:** Updates results, triggers UI update

**Function:** `calculateSocialSecurity(brutto, perspective)`

- **Location:** `v2/js/tools-midijob-calculator.js:220`
- **Purpose:** Calculate social security contributions with Gleitzone
- **Parameters:** `brutto` (number), `perspective` ('employee' or 'employer')
- **Returns:** Number (total social security contribution)
- **Formula:** Gleitzone F-Factor applied for employee, full brutto for employer

**Function:** `calculatePflegeversicherung(brutto, perspective)`

- **Location:** `v2/js/tools-midijob-calculator.js:293`
- **Purpose:** Calculate care insurance with age-based rates and Saxony logic
- **Parameters:** `brutto` (number), `perspective` ('employee' or 'employer')
- **Returns:** Number (care insurance contribution)
- **Logic:** Age-based surcharge (23+ childless), Saxony-specific split

**Function:** `calculateIncomeTax()`

- **Location:** `v2/js/tools-midijob-calculator.js:314`
- **Purpose:** Calculate income tax with tax class adjustments
- **Returns:** Number (monthly income tax)
- **Dependencies:** `applyTaxClassAdjustment()`

**Function:** `applyTaxClassAdjustment(zvE)`

- **Location:** `v2/js/tools-midijob-calculator.js:365`
- **Purpose:** Apply tax class-specific adjustments to taxable income
- **Returns:** Number (adjusted taxable income)
- **Logic:** Different multipliers for each tax class

**Function:** `getKirchensteuerRate()`

- **Location:** `v2/js/tools-midijob-calculator.js:384`
- **Purpose:** Get church tax rate based on federal state
- **Returns:** Number (0.08 or 0.09)

**Function:** `exportPDF()`

- **Location:** `v2/js/tools-midijob-calculator.js:398`
- **Purpose:** Export results as PDF (with email gating)
- **Returns:** Promise
- **Dependencies:** `generateAndDownloadPDF()`, `submitEmailForExport()`

**Function:** `exportCSV()`

- **Location:** `v2/js/tools-midijob-calculator.js:413`
- **Purpose:** Export results as CSV (with email gating)
- **Returns:** Promise
- **Dependencies:** `generateCSVContent()`, `submitEmailForExport()`

## Formulas & Calculations

### Primary Formulas

**Gleitzone Calculation:**

```
// Calculate Beitragspflichtiges Entgelt (Reduced Bemessungsgrundlage)
If Brutto <= 2,000€:
  Beitragspflichtiges Entgelt = F-Factor × Brutto
  Beitragspflichtiges Entgelt = max(Beitragspflichtiges Entgelt, 556.01€)
Else:
  Beitragspflichtiges Entgelt = Brutto

// Social Security Contributions
Employee RV = Beitragspflichtiges Entgelt × 9.3%
Employee ALV = Beitragspflichtiges Entgelt × 1.3%
Employee KV = Beitragspflichtiges Entgelt × (7.3% + Zusatzbeitrag%)
Employee Pflege = calculatePflegeversicherung(Beitragspflichtiges Entgelt, 'employee')

Employer RV = Brutto × 9.3%
Employer ALV = Brutto × 1.3%
Employer KV = Brutto × 7.3%
Employer Pflege = calculatePflegeversicherung(Brutto, 'employer')

// Income Tax
Gross Yearly = Brutto × 12
Taxable Income = Gross Yearly - Grundfreibetrag - Kinderfreibetrag - Werbungskosten - Sonderausgaben - Jahresfreibetrag
Taxable Income = applyTaxClassAdjustment(Taxable Income)

If Taxable Income <= 0:
  Income Tax = 0
Else if Taxable Income <= 17,005:
  Income Tax = (922.98 × (Taxable Income / 10,000) + 1,400) × (Taxable Income / 10,000)
Else if Taxable Income <= 68,429:
  Income Tax = (181.19 × ((Taxable Income - 17,005) / 10,000) + 2,397) × ((Taxable Income - 17,005) / 10,000) + 1,025.38
Else if Taxable Income <= 277,825:
  Income Tax = 0.42 × Taxable Income - 10,602.13
Else:
  Income Tax = 0.45 × Taxable Income - 18,936.88

Income Tax Monthly = Income Tax / 12

// Solidarity Surcharge
If Income Tax Yearly > 18,130€:
  Solidarity = (Income Tax Yearly - 18,130) × 0.119 × 0.055
Else:
  Solidarity = 0

Solidarity Monthly = Solidarity / 12

// Church Tax
Church Tax = Income Tax × Church Tax Rate (if enabled)

// Net Salary
Total Deductions = Employee SV + Income Tax + Solidarity + Church Tax
Net Salary = Brutto - Total Deductions

// Employer Total Costs
Employer Total Costs = Brutto + Employer SV
```

### Legal Basis

- **Sozialgesetzbuch IV (SGB IV):** Gleitzone regulations
- **Minijob-Zentrale:** Official Gleitzone values and F-Factor
- **Bundesagentur für Arbeit:** F-Factor calculation
- **Einkommensteuergesetz (EStG):** Income tax calculation
- **Solidaritätszuschlaggesetz:** Solidarity surcharge
- **Kirchensteuergesetze:** Church tax (state-specific)
- **Sozialgesetzbuch (SGB):** Social Security Code
  - SGB III: Unemployment insurance
  - SGB IV: Social security general
  - SGB V: Health insurance
  - SGB VI: Pension insurance
  - SGB XI: Long-term care insurance

### Step-by-Step Calculation Examples

**Example 1: Basic Mode, Single Person**

- Input: Bruttogehalt = 1,500€, Steuerklasse = I, KV-Zusatzbeitrag = 2.5%
- Step 1: Gleitzone calculation:
  - F-Factor = 0.6683
  - Beitragspflichtiges Entgelt = 0.6683 × 1,500 = 1,002.45€
  - Ensure >= 556.01€: ✓
- Step 2: Employee social security:
  - RV = 1,002.45 × 9.3% = 93.23€
  - ALV = 1,002.45 × 1.3% = 13.03€
  - KV = 1,002.45 × (7.3% + 2.5%) = 98.24€
  - Pflege = 1,002.45 × 1.875% = 18.80€ (childless, 23+)
  - Total = 223.30€
- Step 3: Income tax:
  - Gross Yearly = 18,000€
  - Taxable Income = 18,000 - 12,096 = 5,904€
  - Income Tax = (922.98 × 0.5904 + 1,400) × 0.5904 = 1,030.24€
  - Income Tax Monthly = 85.85€
- Step 4: Solidarity surcharge: 0 (below threshold)
- Step 5: Church tax: 0 (not enabled in Basic Mode)
- Step 6: Totals: 223.30 + 85.85 = 309.15€
- Step 7: Net: 1,500 - 309.15 = 1,190.85€
- Result: Net Salary 1,190.85€/month

**Example 2: Advanced Mode, Married with Children**

- Input: Bruttogehalt = 1,500€, Steuerklasse = III, KV-Zusatzbeitrag = 0.9%, Kinderanzahl = 2, Geburtsjahr = 1990, Kirchensteuer = Yes, Bundesland = Bayern
- Step 1: Gleitzone calculation: Same as Example 1
- Step 2: Employee social security:
  - RV = 93.23€
  - ALV = 13.03€
  - KV = 1,002.45 × (7.3% + 0.9%) = 82.20€
  - Pflege = 1,002.45 × 1.7% = 17.04€ (with children)
  - Total = 205.50€
- Step 3: Income tax (Steuerklasse III):
  - Gross Yearly = 18,000€
  - Child Allowance = 2 × 6,612 = 13,224€
  - Taxable Income = 18,000 - 12,096 - 13,224 = -7,320€ (negative)
  - Taxable Income (adjusted) = -7,320 / 2 = -3,660€ (Steuerklasse III splitting)
  - Income Tax = 0€
- Step 4: Solidarity surcharge: 0 (no income tax)
- Step 5: Church tax: 0 (no income tax)
- Step 6: Totals: 205.50€
- Step 7: Net: 1,500 - 205.50 = 1,294.50€
- Result: Net Salary 1,294.50€/month

## Export Functionality

### Export Types

**PDF Export:**

- **Format:** A4 PDF with Ordio branding
- **Content:** Summary, Sozialversicherung breakdown, Steuern breakdown, Arbeitgeberkosten (if enabled), Vergleich (if enabled), Gleitzone formula (if enabled), Advanced inputs (if Advanced Mode)
- **Generation:** html2canvas + jsPDF
- **Email Gating:** Required (one-time collection)
- **Filename:** `midijob-berechnung_YYYY-MM-DDTHH-MM-SS.pdf`

**CSV Export:**

- **Format:** CSV with semicolon delimiter, UTF-8 BOM
- **Content:** Same as PDF, structured as CSV rows
- **Email Gating:** Required (one-time collection)
- **Filename:** `midijob-berechnung-YYYY-MM-DD.csv`
- **Footer:** Includes Ordio branding with website URL (`www.ordio.com/tools/midijob-rechner`)

### Email Collection

- **Trigger:** First export attempt
- **Modal:** Email input modal appears
- **Validation:** Email format validation
- **Storage:** localStorage (`ordio_tool_email`)
- **API:** HubSpot Forms API v3 (via `/v2/api/collect-lead.php`)
- **Data Sent:** Email, tool name, tool data, UTM parameters, HubSpot cookie

## Results & Insights

### Result Display

**Results Summary:**

- **Bruttogehalt:** Display
- **Nettogehalt:** Large bold display (blue accent)
- **Gesamtabzuege:** Display

**Toggle Sections:**

- **Sozialversicherung:** Breakdown (RV, ALV, KV, Pflege) - reduced amounts, shows Beitragspflichtiges Entgelt
- **Steuern:** Breakdown (Lohnsteuer, Soli, Kirchensteuer)
- **Arbeitgeberkosten:** Breakdown (AG contributions on full brutto) - Advanced mode only
- **Vergleich:** Comparison table (Minijob vs Midijob vs Vollzeit) - Advanced mode only
- **Formel:** Gleitzone formula explanation - Advanced mode only

**Gleitzone Information:**

- Shows reduced Bemessungsgrundlage
- Shows F-Factor used
- Explains Gleitzone calculation

**Export Options:**

- PDF export button
- CSV export button
- Email gating (one-time collection)

### Smart Features

- **Gleitzone Calculation:** Automatic F-Factor application
- **Auto-Calculation:** Debounced calculation on input change
- **Mode Switching:** Seamless switching between Basic and Advanced modes
- **Progressive Disclosure:** Advanced sections shown conditionally
- **Email Persistence:** Email stored in localStorage for future exports
- **Comparison Feature:** Minijob vs Midijob vs Vollzeit comparison
- **Employer Costs:** Full employer cost calculation
- **Age-Based Rates:** Pflegeversicherung rates based on age and children
- **Saxony Logic:** Special Pflegeversicherung split for Saxony

## Browser Testing Results

### Desktop Browsers

**Chrome (Latest):**

- Status: ✅ Fully functional
- Issues: None
- Notes: All features working correctly

**Firefox (Latest):**

- Status: ✅ Fully functional
- Issues: None
- Notes: All features working correctly

**Safari (Latest):**

- Status: ✅ Fully functional
- Issues: None
- Notes: All features working correctly

**Edge (Latest):**

- Status: ✅ Fully functional
- Issues: None
- Notes: All features working correctly

### Mobile Testing

**iOS Safari:**

- Status: ✅ Functional
- Device: iPhone (tested)
- Issues: Minor UI adjustments on small screens
- Notes: Form adapts to mobile, tables scroll horizontally

**Android Chrome:**

- Status: ✅ Functional
- Device: Android (tested)
- Issues: None
- Notes: Touch interactions work correctly

**Mobile UI Differences:**

- Form: Single column on mobile
- Tables: Scroll horizontally on mobile
- Mode toggle: Full width on mobile
- Export buttons: Stack vertically on mobile

### Responsive Design

**Desktop (>1024px):**

- Layout: Centered single-column
- Form: Full width
- Tables: Full width
- Mode toggle: Centered

**Tablet (768px-1024px):**

- Layout: Centered single-column
- Form: Full width
- Tables: Full width
- Mode toggle: Centered

**Mobile (<768px):**

- Layout: Full-width single-column
- Form: Full width
- Tables: Horizontal scroll
- Mode toggle: Full width

**Breakpoints:**

- Mobile: < 768px
- Tablet: 768px - 1024px
- Desktop: > 1024px

### Accessibility

**Keyboard Navigation:**

- Tab navigation works through all form fields
- Enter to calculate
- Focus indicators visible

**Screen Reader:**

- Form labels properly associated
- Results announced after calculation
- Tables have proper roles
- Section headers announced

**ARIA Labels:**

- Input fields have labels
- Buttons have descriptive text
- Tables have proper roles
- Conditional sections have proper ARIA attributes

## Code Analysis

### Key Functions Location

- Main calculation: `v2/js/tools-midijob-calculator.js:164`
- Gleitzone calculation: `v2/js/tools-midijob-calculator.js:220`
- Pflegeversicherung: `v2/js/tools-midijob-calculator.js:293`
- Income tax: `v2/js/tools-midijob-calculator.js:314`
- Tax class adjustment: `v2/js/tools-midijob-calculator.js:365`
- Church tax rate: `v2/js/tools-midijob-calculator.js:384`
- PDF export: `v2/js/tools-midijob-calculator.js:398`
- CSV export: `v2/js/tools-midijob-calculator.js:413`

### Constants Location

- Rates data: Component data properties (line 90-106) - ✅ Updated to 2026
- Gleitzone limits: Component data properties (line 91-93) - ✅ Updated to 2026
- Tax constants: Component data properties (line 96-100) - ✅ Updated to 2026
- F-Factor: Component data property (line 94) - ✅ Updated to 2026

### Calculation Logic Flow

1. **User Input:**

   - User enters brutto, selects tax class, enters additional rate
   - If Advanced Mode: User enters children, birth year, enables church tax, selects states, enters allowance, enables pension exemption

2. **Validation:**

   - Inputs validated (brutto 556.01-2000, tax class I-VI, etc.)
   - Invalid values prevent calculation

3. **Gleitzone Calculation:**

   - Calculate Beitragspflichtiges Entgelt using F-Factor
   - Ensure >= Untergrenze

4. **Social Security:**

   - Calculate employee contributions on Beitragspflichtiges Entgelt
   - Calculate employer contributions on full brutto
   - Calculate Pflegeversicherung with age/children logic

5. **Tax Calculation:**

   - Calculate taxable income with allowances
   - Apply tax class adjustments
   - Calculate progressive income tax
   - Calculate solidarity surcharge
   - Calculate church tax

6. **Net Calculation:**

   - Sum all deductions
   - Calculate net salary
   - Calculate employer total costs

7. **Display:**
   - Results updated in component state
   - UI updates automatically (Alpine.js reactivity)
   - Toggle sections available

## Content Documentation

### Hero Section

- **H1:** "Midijob-Rechner 2026: Netto-Gehalt berechnen im Übergangsbereich" (✅ Updated to "2026")
- **Description:** "Berechne dein Netto-Gehalt im Midijob (€556,01 - €2.000) mit reduzierten Sozialabgaben..." (✅ Updated to "2026" and new Untergrenze)

### Educational Content Sections

1. **Gleitzone Explained**

   - Explanation of Gleitzone concept
   - F-Factor explanation
   - Reduced Bemessungsgrundlage explanation

2. **Midijob vs Minijob vs Vollzeit**

   - Comparison table
   - Advantages/disadvantages
   - Use cases

3. **Steuerklassen & Berechnungsarten**

   - All 6 tax classes explained
   - Impact on Midijob calculations

### FAQ Section

- **Total FAQs:** ~10 FAQs
- **FAQ Topics:**
  - Gleitzone: 3 FAQs
  - Calculation: 3 FAQs
  - Steuerklassen: 2 FAQs
  - Comparison: 2 FAQs

**Sample FAQs:**

1. "Was ist die Gleitzone?"
2. "Wie funktioniert der F-Faktor?"
3. "Welche Steuerklasse sollte ich wählen?"
4. "Was ist der Unterschied zwischen Minijob und Midijob?"

### Meta Tags

- **Title:** "Midijob-Rechner 2026: Netto-Gehalt kostenlos berechnen - Ordio" (✅ Already "2026")
- **Description:** "Midijob-Rechner 2026 für €556-€2.000 mit Steuerklassen, Sozialabgaben & Arbeitgeberkosten..." (✅ Updated to new Untergrenze)

### Schema Markup

- **WebApplication schema:** Yes
- **FAQPage schema:** Yes
- **HowTo schema:** Yes
- **BreadcrumbList schema:** Yes

### Internal Linking

- Links to: Minijob-Rechner, Brutto-Netto-Rechner, Ordio Payroll
- Link count: 3-5 internal links

## 2026 Update Requirements

### Immediate Updates (Required for Jan 1, 2026)

**Constants/Values:**

- ✅ **H1 Title:** Update "Midijob-Rechner 2026" to "2026" (line 1186) - ✅ CRITICAL UPDATE NEEDED
- ✅ **Description:** Update "2025" references to "2026" (line 1190) - ✅ CRITICAL UPDATE NEEDED
- ✅ **Trust Indicator:** Update "2025 aktuell" to "2026 aktuell" (line 1199) - ✅ CRITICAL UPDATE NEEDED
- ✅ **Midijob Untergrenze:** Update `midijobUntergrenze` from 556.01€ to ~602€/month (line 91) - ✅ CRITICAL UPDATE NEEDED (legal compliance)
- ✅ **Minijob Grenze:** Update `minijobGrenze` from 556€ to ~602€/month (line 93) - ✅ CRITICAL UPDATE NEEDED
- ✅ **Gleitzone F-Factor:** Verify and update `gleitzoneFactorF` (currently 0.6683, line 94) - ✅ CRITICAL UPDATE NEEDED (affects all calculations)
- ✅ **Grundfreibetrag:** Verify and update `grundfreibetrag` (currently 12,096€, line 97)
- ✅ **Kinderfreibetrag:** Verify and update `kinderfreibetrag` (currently 6,612€, line 98)
- ✅ **Werbungskosten:** Verify and update `werbungskosten` (currently 1,230€, line 99)
- ✅ **Sonderausgaben:** Verify and update `sonderausgaben` (currently 36€, line 100)
- ✅ **Solidarity Threshold:** Verify and update `freigrenze` (currently 18,130€, line 197)
- ✅ **JavaScript Comments:** Update "Official 2026 Formula" to "2026" (line 221, 259)
- ✅ **PDF Header:** Update "Midijob-Berechnung 2026" to "2026" (line 803, 841)
- ✅ **CSV Header:** Update "Midijob-Berechnung 2026" to "2026" (line 494)
- ✅ **PDF Gleitzone:** Update "Gleitzone 2026" to "2026" (line 698, 736)
- ✅ **PDF F-Factor:** Update "F-Faktor 2026" to "2026" (line 701, 739, 863)
- ✅ **CSV F-Factor:** Update "F-Faktor 2026" to "2026" (line 515, 545)
- ✅ **Content Sections:** Update all "2025" references to "2026" throughout content
- ✅ **FAQs:** Update all "2025" references to "2026" (~10 FAQs)
- ✅ Social security rates: Typically stable (verify unchanged)

**Content:**

- ✅ Meta tags: Already "2026"
- ✅ H1: Needs "2025" → "2026" update
- ✅ Description: Needs "2025" → "2026" update and new Untergrenze
- ✅ Trust indicators: Needs "2025 aktuell" → "2026 aktuell" update
- ✅ Educational sections: Review for "2025" → "2026" updates
- ✅ FAQs: Review and update year references (~10 FAQs)
- ✅ Schema markup: Update HowTo description if needed

**Priority:** 🔴 HIGH (Legal compliance risk - Gleitzone F-Factor and Untergrenze affect all calculations)

### Throughout 2026 Updates

**Scheduled Updates:**

- **Gleitzone Values:** Update annually (typically January 1)
- **F-Factor:** Update annually (typically January 1)
- **Tax Constants:** Update annually (typically January 1)
- **Social Security Rates:** Monitor for changes (typically stable)

### Monitoring Requirements

- **Minijob-Zentrale:** Check for Gleitzone Untergrenze updates
- **Bundesagentur für Arbeit:** Check for F-Factor updates
- **Bundesfinanzministerium:** Check for tax constant updates
- **Bundesministerium für Arbeit und Soziales:** Check for social security rate updates
- **Frequency:** Annually (January) or when laws change
- **Source:** Official announcements, Minijob-Zentrale, BA, BMAS

## Testing

### Test Cases

**Normal Cases:**

- Test 1: 1,500€ Brutto, SK1, Basic Mode → Expected: ~1,190€ Netto
- Test 2: 1,000€ Brutto, SK3, Advanced Mode, 2 children → Expected: ~950€ Netto
- Test 3: 2,000€ Brutto, SK1, Advanced Mode → Expected: Maximum Gleitzone

**Edge Cases:**

- Edge case 1: 556.01€ (minimum) → Expected: Minimum Gleitzone calculation
- Edge case 2: 2,000€ (maximum) → Expected: Maximum Gleitzone calculation
- Edge case 3: Below 556.01€ → Expected: Error message
- Edge case 4: Above 2,000€ → Expected: Error message
- Edge case 5: Steuerklasse III with children → Expected: Low/no tax
- Edge case 6: Saxony Pflegeversicherung → Expected: Different split

### Browser Testing

- Chrome: ✅ Tested, working
- Firefox: ✅ Tested, working
- Safari: ✅ Tested, working
- Mobile: ✅ Tested, working

### Export Testing

- PDF Export: ✅ Tested, working
- CSV Export: ✅ Tested, working
- Email Gating: ✅ Tested, working

## Maintenance Notes

### Known Issues

- H1 shows "2025" - needs 2026 update
- Gleitzone values show 2026 values - need 2026 updates
- F-Factor needs verification for 2026
- PDF/CSV exports mention "2025" - need 2026 updates

### Future Improvements

- Add Excel export functionality
- Add comparison visualization (charts)
- Add historical F-Factor tracking
- Improve Gleitzone explanation
- Add more tax optimization tips

### Related Tools

**Complementary Tools:**

- **[Minijob-Rechner](minijob-rechner-documentation.md)** - Calculate net salary for Minijob (€0-€603/month)
  - Use together when: Comparing Minijob vs Midijob options
  - Example workflow: Calculate Minijob net → Calculate Midijob net → Compare net income and benefits

- **[Brutto-Netto-Rechner](brutto-netto-rechner-documentation.md)** - Calculate net salary for full-time employment
  - Use together when: Comparing Midijob vs full-time employment
  - Example workflow: Calculate Midijob net → Calculate full-time net → Compare options

- **[Stundenlohnrechner](stundenlohnrechner-documentation.md)** - Calculate hourly wage from monthly salary
  - Use together when: Converting Midijob monthly salary to hourly rate
  - Example workflow: Enter Midijob monthly salary → Calculate equivalent hourly rate

- **[Einkommensteuer-Rechner](einkommensteuer-rechner-documentation.md)** - Calculate annual income tax
  - Use together when: Need annual tax calculation for Midijob income
  - Example workflow: Calculate Midijob net → Calculate annual tax → Plan tax payments

**Alternative Tools:**

- **[Minijob-Rechner](minijob-rechner-documentation.md)** - Use instead when income is €0-€603/month
  - Use instead when: Calculating for Minijob range (no Gleitzone calculation)

- **[Brutto-Netto-Rechner](brutto-netto-rechner-documentation.md)** - Use instead when income exceeds €2,000/month
  - Use instead when: Calculating for full-time employment (above Gleitzone)

**Sequential Tools:**

- **[Kostenrechner](kostenrechner-documentation.md)** - Overall cost analysis
  - Use after: Calculating Midijob costs
  - Use before: Overall business cost planning

## References

### Official Sources

- **Minijob-Zentrale:** Gleitzone Untergrenze and F-Factor
- **Bundesagentur für Arbeit:** F-Factor calculation
- **Bundesfinanzministerium:** Tax constants
- **Bundesministerium für Arbeit und Soziales:** Social security rates
- **Sozialgesetzbuch IV (SGB IV):** Gleitzone regulations

### Documentation Files

- `BROWSER_TESTING_FRAMEWORK.md`: Browser testing guidelines
- `CODE_ANALYSIS_FRAMEWORK.md`: Code analysis guidelines
- `TOOL_DOCUMENTATION_TEMPLATE.md`: Documentation template
