2026-04-18·19 min read·

GDPR Art.6: Six Lawful Bases for Processing — Complete Developer Guide (2026)

Post #438 in the sota.io EU Cyber Compliance Series

Art.6 is the gateway to every lawful data processing activity. Without a valid lawful basis from Art.6(1) — or Art.9(2) for special categories — processing is unlawful under Art.5(1)(a) and constitutes a serious GDPR violation. Choosing the wrong basis is not a technicality: it determines what you can do with data, when data subjects can object, and whether you can ever change your processing purpose. The six bases are not interchangeable, and supervisory authorities actively challenge post-hoc basis substitution.


The Six Lawful Bases at a Glance

Art.BasisCore Legal TestSaaS Applicability
Art.6(1)(a)ConsentFreely given, specific, informed, unambiguous indication of agreementMarketing, optional analytics, third-party data sharing
Art.6(1)(b)ContractProcessing objectively necessary for contract performance or pre-contractual stepsAccount creation, billing, service delivery
Art.6(1)(c)Legal obligationProcessing required by EU or Member State lawTax records, AML/KYC, employment law
Art.6(1)(d)Vital interestsProcessing necessary to protect life of data subject or another personEmergency situations only — very narrow
Art.6(1)(e)Public taskProcessing necessary for official authority or public interest taskGovernment, public bodies, researchers
Art.6(1)(f)Legitimate interestsNecessary for legitimate interests not overridden by data subject rightsFraud prevention, IT security, B2B analytics

Critical rule: You must identify your lawful basis before processing begins and document it in your ROPA (Art.30). You cannot switch from one basis to another if challenged, nor can you stack bases as a fallback — each processing activity needs exactly one primary basis.


Consent under Art.6(1)(a) must satisfy four cumulative requirements from Art.4(11):

  1. Freely given — No genuine choice = no valid consent. Bundling consent with a service (take it or leave it) is invalid. Power imbalance (employer/employee) typically invalidates employment consent.
  2. Specific — One consent per purpose. A single blanket "I agree to data processing" covering multiple purposes is invalid; each purpose needs separate consent.
  3. Informed — Data subject must know the controller's identity, the processing purpose, and the right to withdraw before consenting (Art.13(2)(c)).
  4. Unambiguous — Positive opt-in action required. Pre-ticked boxes, silence, or scrolling do not constitute consent (Recital 32).

Art.7 adds four additional requirements when consent is the basis:

Art.7 ConditionRequirementDeveloper Implication
Art.7(1)Controller must demonstrate consent was givenLog: timestamp, IP, consent text version, mechanism used
Art.7(2)Consent in writing must be clearly distinguishableSeparate consent checkboxes from T&C acceptance
Art.7(3)Right to withdraw at any time, as easy as giving consentOne-click withdrawal in account settings — not buried in support request flow
Art.7(4)Bundling with service = presumption of non-free consentAnalytics consent cannot gate access to core service

The EDPB Guidelines 05/2020 on Consent clarify:

CJEU Case Law

Planet49 (C-673/17, 2019): Pre-ticked checkboxes for statistical cookies and third-party partner access do not constitute valid consent. The court confirmed that silence, pre-ticked boxes, or inactivity cannot constitute consent under the GDPR/ePrivacy Directive.

Orange România (C-61/19, 2020): Consent boxes pre-ticked by default in a customer contract for ID document copying were invalid. The controller had to prove freely given consent; the burden shifts to the controller.

Consent is the wrong basis when:

Anti-pattern: Using consent as a default "safety net" basis for all processing. Consent is the most fragile basis — it can be withdrawn at any time, triggering Art.17 erasure obligations. If processing is genuinely necessary for a contract, use Art.6(1)(b).


Art.6(1)(b) — Contract

Processing is lawful when it is objectively necessary for:

The key word is "necessary." This is a strict test — processing is not justified merely because it is convenient or makes the contract better for the controller. The EDPB Guidelines 2/2019 on Art.6(1)(b) state: "the processing must be necessary for the performance of the contract with the data subject, not just useful."

EDPB Necessity Test for Art.6(1)(b)

  1. Identify the contract — What specific contractual obligation is being performed?
  2. Is processing integral to contract performance? — Would it be impossible or fundamentally different without this processing?
  3. Data subject as party — The contract must be with the data subject. Processing data about a data subject who is not a contract party (e.g., end-user of a B2B product) does not satisfy Art.6(1)(b).
  4. Not substitutable — Is there a less privacy-invasive way to perform the contract?

Developer Use Cases for Art.6(1)(b)

Processing ActivityArt.6(1)(b) Valid?Reason
Storing delivery address for order fulfillment✅ YesNecessary for contract performance
Processing payment card data for billing✅ YesNecessary for contract performance
Sending transactional emails (order confirmation)✅ YesExpected part of contract
IP address logging for rate limiting / fair use⚠️ MaybeOnly if contractually required; may need LI
Personalization beyond what service requires❌ NoConvenient, not necessary
Sharing with analytics third parties❌ NoNot necessary for contract with data subject
Profiling for product improvement❌ NoBenefits controller, not contract performance

CJEU / EDPB Guidance

EDPB Guidelines 2/2019 (Online Services): Mapping personal data for "personalised ads" or "improving the service" to Art.6(1)(b) is not valid when the core service (social network, search engine) could function without targeted advertising or profiling. These must be justified under Art.6(1)(a) or Art.6(1)(f).

Worked example: A SaaS team collaboration tool stores user name, email, avatar. Art.6(1)(b) covers name/email (necessary to create an account and identify users within the service). It does not cover storing browsing behaviour for building a usage-pattern ML model — that requires a separate basis.


Processing is lawful when it is necessary to comply with a legal obligation to which the controller is subject. The obligation must be imposed by EU law or Member State law (Recital 41) — not by contract, industry standard, or the controller's internal policy.

Requirements for Art.6(1)(c)

  1. Legal basis must exist in law — A specific EU regulation, directive implemented in national law, or Member State statute. "Industry practice" or "contractual obligation" are not Art.6(1)(c) sources.
  2. Necessity — The specific processing must be required to fulfill the obligation; collecting more than the law requires is not justified.
  3. Documentation — ROPA entry must identify the specific legal provision (e.g., "§ 147 AO — German Fiscal Code, 10-year retention for business records").
Legal ObligationJurisdictionRetention / Processing Requirement
VAT/tax recordsAll EU (§ 147 AO, § 132 BAO, etc.)7–10 years depending on Member State
AML/KYC (AMLD6)All EUCustomer due diligence records 5 years
Employment lawMember State specificPayroll, working time, contracts
Consumer protection (DMCA)EUOrder/invoice records
NIS2 Art.20–23All EUIncident records + notification evidence
DORA Art.17EU financial sectorICT incident records 5 years
Accounting directiveAll EUAnnual accounts 10 years

Art.6(1)(c) vs Art.6(1)(f) Confusion

A common mistake: using Art.6(1)(f) legitimate interests for processing actually required by law. If a law requires you to process, use Art.6(1)(c) — data subjects have no right to object to Art.6(1)(c) processing (unlike Art.6(1)(f) where Art.21 objection rights apply). This distinction matters operationally: if a tax authority requests data you processed under Art.6(1)(c), you have a strong compliance position; under Art.6(1)(f), you may face more scrutiny.


Art.6(1)(d) — Vital Interests

Processing is lawful when it is necessary to protect vital interests of the data subject or another natural person. Recital 46 clarifies this basis is intended to cover situations where consent cannot be given (e.g., the data subject is incapacitated) and where the processing is needed to protect life.

Scope and Limitations

Art.6(1)(d) is the narrowest basis in practice:

Developer note: If you are building healthcare or emergency response applications, Art.6(1)(d) may be relevant for emergency record access. For standard SaaS, this basis can be documented as "not applicable."


Art.6(1)(e) — Public Task

Processing is lawful when it is necessary for the performance of a task carried out in the public interest or in the exercise of official authority vested in the controller. The specific task and official authority must have a basis in EU or Member State law (Art.6(3)).

Applicability

Art.6(1)(e) applies to:

For private SaaS companies: Art.6(1)(e) is generally not available unless you have a specific statutory mandate. Commercial interest, however beneficial, is not "public interest" for Art.6(1)(e) purposes.


Art.6(1)(f) — Legitimate Interests

The Three-Part Test

Art.6(1)(f) is the most flexible but complex basis. Processing is lawful only if all three conditions are met:

Step 1 — Purpose test: Is there a legitimate interest?

Step 2 — Necessity test: Is processing necessary for that interest?

Step 3 — Balancing test: Are the controller's interests overridden by the data subject's interests or fundamental rights? Consider:

Legitimate Interest Examples (Developer Focus)

ProcessingLI Valid?Reasoning
IT security logging (access logs, auth events)✅ YesEDPB confirmed — network security LI established
Fraud prevention scoring✅ YesBoth controller and data subject benefit; proportionate safeguards apply
Direct marketing to existing customers✅ ConditionalRecital 47: existing customer relationship; must offer opt-out (Art.21(2))
B2B prospecting (professional contact details)✅ ConditionalRecital 47; depends on reasonable expectations of B2B contacts
Profiling for personalised advertising❌ Usually noData subjects do not reasonably expect and advertising interest does not override privacy rights without consent (confirmed post-Meta IAB TCF fine)
Sharing customer data with group companies for analytics⚠️ ComplexIntra-group transfers may qualify but need documented LI assessment
Cross-site tracking via cookies❌ NoePrivacy Directive requires consent; LI is unavailable for ePrivacy-regulated tracking

Right to Object Under Art.21

When processing is based on Art.6(1)(f), data subjects have an absolute right to object to processing for direct marketing (Art.21(2)) — the controller must stop without any balancing. For other purposes (Art.21(1)), the controller can override the objection if it demonstrates compelling legitimate grounds, but the burden is on the controller.

Implementation implication: Systems relying on Art.6(1)(f) must implement an Art.21 objection mechanism and process objections within one month (Art.12(3)). This creates operational overhead compared to Art.6(1)(b) or (c) where no objection right applies.

CJEU Case Law on Legitimate Interests

Fashion ID (C-40/17, 2019): Facebook's social plugin embedded on Fashion ID's website transmitted user data to Facebook. Fashion ID was a joint controller for collection/transmission. The LI basis required Fashion ID's own LI assessment — they could not rely on Facebook's separate LI for downstream processing.

Schrems II (C-311/18, 2020): While primarily about international transfers, the court confirmed that surveillance-enabling transfers cannot be justified by controller LI because the interference with fundamental rights (Art.7/8 EU Charter) is too severe. US CLOUD Act/FISA 702 exposure is not a "safeguard" that can offset the balancing test.

RW (C-272/19, 2020): Name and contact details of public officials in their professional capacity may be published based on public task (Art.6(1)(e)) or LI (Art.6(1)(f)) given the transparency context — but only the capacity-relevant data, not personal home contact details.


For Art.6(1)(c) and Art.6(1)(e), Art.6(3) requires that the legal basis for processing be laid down in EU law or the law of the Member State to which the controller is subject. National law must meet the requirements of the EU Charter and must specify:

This means a company cannot invent an Art.6(1)(c) basis — they must identify the specific statutory provision. Consulting national data protection authorities' guidance for your Member State is essential.


Art.6(4) — Compatible Further Processing

Art.6(4) permits controllers to process personal data for a purpose compatible with the original collection purpose without needing a new lawful basis — but requires a compatibility assessment using five factors:

FactorAssessment Question
Link between purposesHow closely related is the new purpose to the original?
Context of collectionWhat were data subjects' reasonable expectations at collection?
Nature of dataAre special categories (Art.9) or criminal data (Art.10) involved?
Possible consequencesWhat harm could secondary processing cause to data subjects?
Existence of safeguardsDoes pseudonymisation, encryption, or access limitation reduce risk?

Art.6(4) use cases:

Art.6(4) is NOT available for consent-based processing — if you collected data based on consent, secondary processing for a different purpose requires new consent (or another basis), not just an Art.6(4) compatibility analysis.


Choosing the Right Basis: Decision Framework

Processing Activity: [describe specific activity]
│
├─ Required by EU/national law? → Art.6(1)(c)
│   └─ Document: specific legal provision + retention period
│
├─ Directly necessary to perform contract with data subject? → Art.6(1)(b)
│   └─ Test: Could contract be performed without this processing?
│   └─ Scope: Only data the data subject is party to the contract for
│
├─ Emergency life-threatening situation? → Art.6(1)(d)
│   └─ Very narrow — document why consent is unavailable
│
├─ Public authority exercising official function? → Art.6(1)(e)
│   └─ Requires statutory mandate in EU/national law
│
├─ Controller has legitimate interest that outweighs data subject rights?
│   → Art.6(1)(f) + conduct and document 3-part LI Assessment
│   └─ Note: data subject has Art.21 objection right
│
└─ None of the above → Art.6(1)(a) CONSENT required
    └─ Consent must be freely given, specific, informed, unambiguous
    └─ Art.7 conditions must be satisfied
    └─ Right to withdraw at any time

Python: LawfulBasisSelector

from dataclasses import dataclass, field
from enum import Enum
from typing import Optional

class LawfulBasis(Enum):
    CONSENT = "Art.6(1)(a) — Consent"
    CONTRACT = "Art.6(1)(b) — Contract"
    LEGAL_OBLIGATION = "Art.6(1)(c) — Legal Obligation"
    VITAL_INTERESTS = "Art.6(1)(d) — Vital Interests"
    PUBLIC_TASK = "Art.6(1)(e) — Public Task"
    LEGITIMATE_INTERESTS = "Art.6(1)(f) — Legitimate Interests"


@dataclass
class ProcessingActivity:
    name: str
    description: str
    # Contract
    is_contract_party: bool = False
    contract_necessary: bool = False
    # Legal obligation
    specific_legal_provision: Optional[str] = None
    # Vital interests
    life_threatening_emergency: bool = False
    # Public task
    has_statutory_mandate: bool = False
    # Legitimate interests
    li_purpose_identified: bool = False
    li_necessary: bool = False
    li_balancing_favours_controller: bool = False
    # Special concerns
    involves_special_categories: bool = False
    children_data: bool = False


@dataclass
class BasisAssessment:
    activity: str
    recommended_basis: LawfulBasis
    rationale: str
    warnings: list[str] = field(default_factory=list)
    action_required: list[str] = field(default_factory=list)


def select_lawful_basis(activity: ProcessingActivity) -> BasisAssessment:
    warnings = []
    actions = []

    # Priority 1: Legal obligation (strongest — no data subject objection right)
    if activity.specific_legal_provision:
        return BasisAssessment(
            activity=activity.name,
            recommended_basis=LawfulBasis.LEGAL_OBLIGATION,
            rationale=f"Required by {activity.specific_legal_provision}",
            action_required=[
                f"Document provision '{activity.specific_legal_provision}' in ROPA",
                "Define exact retention period required by law",
                "Confirm Member State implementation applies to your entity",
            ],
        )

    # Priority 2: Contract (only if data subject is party AND processing is objectively necessary)
    if activity.is_contract_party and activity.contract_necessary:
        if activity.involves_special_categories:
            warnings.append(
                "Special categories require Art.9(2) basis in addition to Art.6(1)(b)"
            )
        return BasisAssessment(
            activity=activity.name,
            recommended_basis=LawfulBasis.CONTRACT,
            rationale="Objectively necessary for contract performance with data subject",
            warnings=warnings,
            action_required=[
                "Document which specific contractual obligation requires this processing",
                "Confirm data subject (not a third party) is party to the contract",
                "Apply necessity test: could contract be performed with less data?",
            ],
        )

    # Priority 3: Vital interests (very narrow)
    if activity.life_threatening_emergency:
        return BasisAssessment(
            activity=activity.name,
            recommended_basis=LawfulBasis.VITAL_INTERESTS,
            rationale="Life-threatening emergency where consent cannot be obtained",
            action_required=[
                "Document why consent is unavailable (e.g., incapacitation)",
                "Confirm life-threatening nature of situation",
                "Switch to another basis (consent, contract) as soon as possible",
            ],
        )

    # Priority 4: Public task (requires statutory mandate)
    if activity.has_statutory_mandate:
        return BasisAssessment(
            activity=activity.name,
            recommended_basis=LawfulBasis.PUBLIC_TASK,
            rationale="Performance of task in public interest under statutory authority",
            action_required=[
                "Identify specific statutory provision granting public task/official authority",
                "Confirm entity qualifies as public authority or public interest body",
                "Document Art.6(3) legal basis in ROPA",
            ],
        )

    # Priority 5: Legitimate interests (requires documented 3-part assessment)
    if (
        activity.li_purpose_identified
        and activity.li_necessary
        and activity.li_balancing_favours_controller
    ):
        if activity.children_data:
            warnings.append(
                "LI unlikely to be valid for children's data — stronger protections apply (Recital 38)"
            )
        if activity.involves_special_categories:
            warnings.append(
                "LI is NOT a valid basis for special category data (Art.9) — explicit consent or another Art.9(2) ground required"
            )
        return BasisAssessment(
            activity=activity.name,
            recommended_basis=LawfulBasis.LEGITIMATE_INTERESTS,
            rationale="Legitimate interest identified, processing necessary, balancing favours controller",
            warnings=warnings,
            action_required=[
                "Complete and document Legitimate Interests Assessment (LIA)",
                "Implement Art.21 objection mechanism (right to object to LI processing)",
                "Provide LI disclosure in privacy notice (Art.13(1)(d))",
                "Review LIA annually or when processing changes",
            ],
        )

    # Default: Consent required
    if activity.involves_special_categories:
        warnings.append(
            "Special category data requires explicit consent (Art.9(2)(a)) — 'explicit' is higher bar than standard consent"
        )
    if activity.children_data:
        warnings.append(
            "Children's consent: Art.8 requires parental consent for under-16 (or under-13 per Member State)"
        )
    return BasisAssessment(
        activity=activity.name,
        recommended_basis=LawfulBasis.CONSENT,
        rationale="No other lawful basis applies — consent is required",
        warnings=warnings,
        action_required=[
            "Design consent mechanism: positive opt-in, no pre-ticked boxes",
            "Separate consent per purpose (Art.4(11) specificity requirement)",
            "Implement Art.7(3) withdrawal: as easy as giving consent",
            "Log consent: timestamp, IP, consent text version shown",
            "Do NOT bundle consent with T&C acceptance (Art.7(4))",
        ],
    )


def print_assessment(assessment: BasisAssessment):
    print(f"\n{'='*60}")
    print(f"Processing Activity: {assessment.activity}")
    print(f"Recommended Basis: {assessment.recommended_basis.value}")
    print(f"Rationale: {assessment.rationale}")
    if assessment.warnings:
        print("\n⚠️  Warnings:")
        for w in assessment.warnings:
            print(f"  • {w}")
    print("\n📋 Actions Required:")
    for a in assessment.action_required:
        print(f"  → {a}")


# Example 1: Email marketing to existing customers
email_marketing = ProcessingActivity(
    name="Marketing emails to existing customers",
    description="Sending product update and promotional emails to registered users",
    li_purpose_identified=True,
    li_necessary=True,
    li_balancing_favours_controller=True,
)
print_assessment(select_lawful_basis(email_marketing))
# → Art.6(1)(f) LI (existing customer relationship per Recital 47)
# → BUT: Art.21(2) hard objection right applies; must offer unsubscribe

# Example 2: VAT record retention
vat_records = ProcessingActivity(
    name="Invoice and VAT record retention",
    description="Retaining customer invoices for 10 years for tax compliance",
    specific_legal_provision="§ 147 AO (German Fiscal Code) — 10-year commercial records",
)
print_assessment(select_lawful_basis(vat_records))
# → Art.6(1)(c) Legal Obligation — no data subject objection right

# Example 3: Account creation
account_creation = ProcessingActivity(
    name="User account creation — name, email, password hash",
    description="Processing name and email to create and manage user account",
    is_contract_party=True,
    contract_necessary=True,
)
print_assessment(select_lawful_basis(account_creation))
# → Art.6(1)(b) Contract — core service delivery

# Example 4: Optional analytics
analytics = ProcessingActivity(
    name="Optional product analytics (behaviour tracking)",
    description="Tracking user clicks and navigation for product improvement",
)
print_assessment(select_lawful_basis(analytics))
# → Art.6(1)(a) Consent — cannot rely on contract (not necessary) or LI without documented assessment

Sample output for Example 1 (email marketing):

============================================================
Processing Activity: Marketing emails to existing customers
Recommended Basis: Art.6(1)(f) — Legitimate Interests
Rationale: Legitimate interest identified, processing necessary, balancing favours controller

📋 Actions Required:
  → Complete and document Legitimate Interests Assessment (LIA)
  → Implement Art.21 objection mechanism (right to object to LI processing)
  → Provide LI disclosure in privacy notice (Art.13(1)(d))
  → Review LIA annually or when processing changes

Basis Selection: Common SaaS Scenarios

FeatureCorrect BasisIncorrect BasisWhy Wrong
User registration (name, email)Art.6(1)(b)Art.6(1)(a) ConsentProcessing necessary for contract — consent invalid per Art.7(4)
Password reset emailArt.6(1)(b)Art.6(1)(f) LINecessary for contract; LI redundant and weaker
Product invoice (7-year retention)Art.6(1)(c)Art.6(1)(b)Retention after contract end is legal obligation, not contract
Session authentication cookiesArt.6(1)(b)Art.6(1)(a) ConsentStrictly necessary for service = Art.6(1)(b); ePrivacy Directive exempts from cookie consent
Usage analytics (Mixpanel, Amplitude)Art.6(1)(a) ConsentArt.6(1)(b)Not necessary for core service — conviction from EDPB 2/2019
DMARC/SPF security loggingArt.6(1)(f) LIArt.6(1)(b)Security logging = LI per EDPB, not contract performance
Support ticket historyArt.6(1)(b) or (f)ConsentContractual or LI basis; consent inappropriate for necessary support
A/B testing user behaviourArt.6(1)(a) ConsentArt.6(1)(f)Primarily benefits controller, not established LI vs. privacy intrusion

Interaction with Art.9: Special Categories

Art.9(1) prohibits processing special category data (health, genetic, biometric, racial/ethnic origin, political opinions, religious beliefs, trade union membership, sex life/orientation) unless an exception in Art.9(2) applies. Art.9 is an additional requirement on top of Art.6 — you need both a lawful basis under Art.6 and a ground under Art.9(2).

The most common Art.9(2) grounds for SaaS:

Developer implication: If your product processes health data (e.g., a fitness app, HR system, medical records), identify both the Art.6 basis and the Art.9(2) exception, and document both in ROPA.


EU Hosting and Lawful Basis Integrity

The choice of infrastructure directly affects the enforceability of your lawful basis:

Art.6(1)(f) Legitimate Interests (IT Security): Under US CLOUD Act, a US-based controller or processor must disclose data to US authorities on a valid warrant — without notifying the data subject. This secret compelled disclosure is structurally incompatible with the transparency requirements underpinning any Art.6 basis. Data subjects who consented to processing by a EU-based controller cannot reasonably have consented to US law enforcement access.

Art.6(1)(a) Consent: If a data subject consents to analytics processing, that consent does not extend to processing by US intelligence services under EO 12333 (no judicial authorisation, no notification). Storing consent-based analytics data on US infrastructure creates a structural consent defect.

EU-native infrastructure (such as sota.io, hosted on European servers subject only to EU/EEA law) eliminates the CLOUD Act/FISA 702 structural risk. Controllers can document a clean Art.6 basis without a shadow transfer mechanism or FISA 702 rider undermining it. This is not a theoretical risk — the EDPB's Schrems II follow-up guidance explicitly notes that US cloud infrastructure creates a structural Art.5(1)(f) and Art.6 tension for data transfers.


Enforcement: Lawful Basis Violations

DecisionSAViolationFine
Meta (IAB TCF)IE DPCArt.6 — no valid basis for behavioural advertising (relabelled as LI/contract; both rejected)€390M (combined)
TikTok LiteFR CNILArt.6(1)(b) misapplied — points reward program not "necessary" for serviceEmergency order + fine
Clearview AIIT Garante / FR CNIL / GR DPANo valid Art.6 basis for biometric scraping€20M (IT), €20M (FR), €20M (GR)
LinkedIn IEIE DPCArt.6(1)(f) LI for behavioural advertising — balancing test failed€310M (2024)
SpotifySE IMYArt.6(1)(b) overclaimed — processing not objectively necessary for streaming contract€5M

Key pattern: Supervisory authorities scrutinise Art.6 basis claims retroactively. Relabelling Art.6(1)(a) consent as Art.6(1)(b) contract or Art.6(1)(f) LI after consent rates drop is treated as bad faith and results in significantly higher fines.


Art.6 Compliance Checklist for Developers


GDPR Chapter I Navigation

Related GDPR Posts: